azure-search-openai-demo
azure-search-openai-demo copied to clipboard
InvalidTemplateDeployment Reponse 400: Bad Request
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
Any log messages given by the failure
ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: starting deployment to subscription: PUT https://management.azure.com/subscriptions/64e1b7f2-1942-45c9-abeb-53639c742966/providers/Microsoft.Resources/deployments/openaidemo-dev-1685332326
RESPONSE 400: 400 Bad Request ERROR CODE: InvalidTemplateDeployment
{ "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment failed with error: 'Authorization failed for template resource 'rg-openaidemo-dev' of type 'Microsoft.Resources/resourceGroups'. The client '[email here]' with object id '9cf168c1-e2ee-43e6-aee6-09a224dfd411' does not have permission to perform action 'Microsoft.Resources/subscriptions/resourceGroups/write' at scope '/subscriptions/64e1b7f2-1942-45c9-abeb-53639c742966/resourceGroups/rg-openaidemo-dev'.'." } }
TraceID: 4d40f0939994ac5ee25474bfcbff5ffc
Expected/desired behavior
Build successful
OS and Version?
Windows 10
azd version?
1.0.1
Versions
Mention any other details that might be useful
Thanks! We'll be in touch soon.
+1 this
anyone that could fix this?
Do you have permissions to create new resource groups? That is required for azd up to work. The error seems to suggest you don't, from my reading of it.
If you can't create new resource groups, then you could try setting resourceGroupName, searchServiceResourceGroupName, storageResourceGroupName, and openAiResourceGroupName in infra/main.bicep to an existing resource group. That may work.
Do you have permissions to create new resource groups? That is required for
azd upto work. The error seems to suggest you don't, from my reading of it. If you can't create new resource groups, then you could try setting resourceGroupName, searchServiceResourceGroupName, storageResourceGroupName, and openAiResourceGroupName in infra/main.bicep to an existing resource group. That may work.
I've tried setting every avaliable resource with proper perms but didn't work. The obly thing that worked was having subscription level access.
Do you have permissions to create new resource groups? That is required for
azd upto work. The error seems to suggest you don't, from my reading of it. If you can't create new resource groups, then you could try setting resourceGroupName, searchServiceResourceGroupName, storageResourceGroupName, and openAiResourceGroupName in infra/main.bicep to an existing resource group. That may work.
Turns out that I wasn't assigned as contributor in the resource group that had the OpenAI service assigned. Once I obtained the owner permission in that specific resource group I was able to run the demo without any problems.
I didn't have the right permission when I ran the script. After applying the recommended role, the build was successful.