Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provisioning with a Service Principal. #962

Open
jws-m-gotoh opened this issue Nov 16, 2023 · 6 comments
Open

Provisioning with a Service Principal. #962

jws-m-gotoh opened this issue Nov 16, 2023 · 6 comments
Labels
azd enhancement New feature or request

Comments

@jws-m-gotoh
Copy link

Please provide us with the following information:

I provisioned with a service principal because my environment does not allow browser authentication. I changed main.bicep because of some errors, is there a problem with this change? Search form the app seems to work. Thanks in advance.

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Created the service principal.

az ad sp create-for-rbac --name DemoServicePrincipalOwner \  
  --role Owner \  
  --scopes /subscriptions/<mysubscription_id>

login

azd auth login --client-id $APP_ID --tenant-id $TENANT_ID --client-secret $PASSWORD

provision

azd provision

  (✓) Done: Resource group: xxxxx
  (✓) Done: Storage account: xxxxx
  (✓) Done: Search service: xxxxx
  (✓) Done: App Service plan: xxxxx
  (✓) Done: Azure OpenAI: xxxxx
  (✓) Done: Form recognizer: xxxxx
  (✓) Done: App Service: xxxxx

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details:
UnmatchedPrincipalType: The PrincipalId 'xxxxx' has type 'ServicePrincipal' , which is different from specified PrinciaplType 'User'.

Changed main.bicep as follows:

module storageRoleUser 'core/security/role.bicep' = {
  scope: storageResourceGroup
  name: 'storage-role-user'
  params: {
    principalId: principalId
    roleDefinitionId: 'xxxxx'
    // principalType: 'User'
    principalType: 'ServicePrincipal'
  }
}

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Ubuntu 20.04

azd version?

run azd version and copy paste here.
azd version 1.4.5

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@jongio
Copy link
Member

jongio commented Nov 16, 2023

@pamelafox - Prob good idea to add a param to main.bicep that allows people to specify principalId type

@pamelafox pamelafox added enhancement New feature or request azd labels Nov 17, 2023
@pamelafox
Copy link
Collaborator

Yep, seems like a good idea, AZD_USER_TYPE or some such? I assume we can't detect it programmatically from the principalId.

@jongio
Copy link
Member

jongio commented Nov 20, 2023

AZURE_PRINCIPAL_TYPE

@diberry
Copy link
Contributor

diberry commented Dec 7, 2023

@pamelafox @jongio Is this limited to this repo or is there a broader AZD issue that needs to be addressed?

@pamelafox
Copy link
Collaborator

I think this particular issue can be resolved within this repo, though I haven't given it a go myself to be 100% certain.

@LianwMS
Copy link

LianwMS commented Jun 11, 2024

Any solution for the issue? I run azd up in github workflow meet the same issue. Any solution instead of change the main.bicep? and Why it's different from run azd up in local?

ratkinsoncinz pushed a commit to cinzlab/azure-search-openai-demo that referenced this issue Oct 6, 2024
…s#962)

Co-authored-by: Ian Seabock (Centific Technologies Inc) <v-ianseabock@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azd enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants