Closed namratam30 closed 1 year ago
We have the existing script that sets up the roles for a user:
https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/scripts/roles.sh
You would need to enable managed identity for your app service app in the Identity tab, copy that principal id, and run it in the script.
I can't run the script as i don't have access. Is there anyway to create this identity from Azure portal.
First, make sure that your app service app has Managed identity enabled:
Then click the "Azure role assignments" button on that screen.
Select "+ Add role assignment" from that screen.
Repeat for roles "Storage Blob Data Reader" and "Search Index Data Reader".
When done, your role assignments should look like:
Please let us know if that worked for you. I'm curious why you'd be able to do that in the Portal but not able to do it via the script, I thought the permissions would be the same.
We have the existing script that sets up the roles for a user:
https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/scripts/roles.sh
You would need to enable managed identity for your app service app in the Identity tab, copy that principal id, and run it in the script.
Hi @pamelafox
I tried to run the code with existing resources created by the owner. And i have RBAC role in the Resource group level. But i couldn't get access to enable managed identity for my app service in the Identity tab and though couldn't copy that principal id. Then how can i run the code with only RBAC role to the resource group. Please help me.
And got the error when I try to assign the roles mannually.
Failed to add "WebAPP resource" as Cognitive Services OpenAI User for "Resource group name" : The client 'XXX@XXX.com' with object id '33e66c54-5b0d-475a-9b18-6d4ee4b59310' has an authorization with ABAC condition that is not fulfilled to perform action 'Microsoft.Authorization/roleAssignments/write' over scope '/subscriptions/XXX/resourceGroups/"Resource group name"/providers/Microsoft.Authorization/roleAssignments/fcce671d-a4e1-4ea5-98ea-02cc62a8be2c' or the scope is invalid. If access was recently granted, please refresh your credentials..
- First, make sure that your app service app has Managed identity enabled:
- Then click the "Azure role assignments" button on that screen.
Select "+ Add role assignment" from that screen.
- For scope, select "Resource group".
- For role, select "Cognitive Services OpenAI user".
- Repeat for roles "Storage Blob Data Reader" and "Search Index Data Reader".
- When done, your role assignments should look like:
Please let us know if that worked for you. I'm curious why you'd be able to do that in the Portal but not able to do it via the script, I thought the permissions would be the same.
It is working but it's giving responses outside of the resources provided.
@ayus786 Please see this guide for tips on debugging low quality answers:
I haven't experienced it giving responses outside of the resources provided, but that can vary across domain, so you may need to do additional prompt engineering or try GPT-4.
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
azd version?
Versions
Mention any other details that might be useful