azure-search-openai-demo
azure-search-openai-demo copied to clipboard
The role assignment already exists. (Code: RoleAssignmentExists)
Please provide us with the following information:
This issue is for a: (mark with an x)
- [ X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce
azd up ----redeploying with changes in infra, already done the same multiple times without an issue.
Any log messages given by the failure
{"code":"RoleAssignmentExists","message":"The role assignment already exists."}
Expected/desired behavior
OS and Version?
Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10
azd version?
run
azd versionand copy paste here.
azd version 1.4.4 (commit 45a48a32c9f3caad481343869ade05221df26ec7)
Versions
Mention any other details that might be useful
I ma facing issue while running azd up, though have successfully deployed multiple times.
{"code":"RoleAssignmentExists","message":"The role assignment already exists."}
Under deployment I can see the error comes for 'storage - role-user', ;formrecognizer role user, search contri role user and search role user.
Thanks! We'll be in touch soon.
Is it possible you're logged in with a different account now? Can you check the existing roles in the portal to see what user they're associated with. A quick fix would be to change the name in the bicep for each role: https://github.com/Azure-Samples/azure-search-openai-demo/blob/e518ab0589af8d8704761d85db68ec4dffbfef55/infra/main.bicep#L408
@pamelafox Would you happen to know how to resolve this conflict in the portal in Azure? I am running into something quite similar where deployments related to role-user are failing. I am quite new to Azure and I could not find the role assignments pertaining to a deployment like openai-role-user.
Those role assignments are declared in main.bicep. If you haven't modified them, then there should only be a single role with each name. You can try changing names there, however.
For me the problem was that I ran https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/scripts/roles.sh which lead to conflicts on azd up. Removing my user from these roles on the reosurce group and then running azd up fixed it.