Azure-Samples / Azure-Samples/Copilot-Studio-with-Azure-AI-Search

[Bug] pac admin create-service-principal assumes default environment admin

Open
#384 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HCL
Stars
31
Forks
8
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue?

- [x] I have searched the existing issues

### Description

Errors like the one included below can occur when the user following the app registration setup instructions do not have user admin permissions on the default environment. There is a workaround, which is to run 'pac auth' against an environment that is _not_ the default environment, but as the instructions stand, this is a real hurdle for users trying to set up the accelerator.

`Error: Principal user (Id=<>, type=8, roleCount=<>, privilegeCount=<>, accessMode='', AADObjectId='', MetadataCachePrivilegesCount=, businessUnitId=<>), is missing prvCreateUser privilege (Id=<>) on OTC=8 for entity 'systemuser' (LocalizedName='User'). context.Caller=<>. Consider adding missed privilege to one of the principal (user/team) roles.`

### Steps to Reproduce

```markdown

```

### Expected Behavior

Run pac admin create-service-principal without errors.

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the accelerator's app registration setup instructions and the invocation of `pac admin create-service-principal`. Reproduce the failure when authenticated to the default environment, then verify that the command succeeds or that the documented setup avoids assuming default-environment admin permissions.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.