Azure AI Studio Deployed Web App Can't Generate Response
I followed instructions here: [https://learn.microsoft.com/en-us/azure/ai-studio/tutorials/deploy-chat-web-app](https://learn.microsoft.com/en-us/azure/ai-studio/tutorials/deploy-chat-web-app
) so that I could test my web app enterprise chatbot. I get the following error:
There was an error generating a response. Chat history can't be saved at this time. Error code: 400 - {'error': {'requestid': '8d1c6c04-bded-4ec7-ae52-19523888bc7e', 'code': 400, 'message': 'Failed to get managed identity token. Response: {"error":{"code":"ManagedIdentityIsNotEnabled","message":"Managed Identity (MI) is not set for this account while the encryption key source is 'Microsoft.KeyVault', customer managed storage or Network Security Perimeter is used."}}'}}
I've checked numerous places in Azure and feel that I have enabled ManagedIdentity but it still doesn't work. Can any one guide me what to try next?
Azure AI services
Azure Startups
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-22T23:31:07.41+00:00 @Jason Holt Thanks for reaching out to us, could you please share your region which you are working on to us so that we can investigate further?
Regards,
Yutong
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-23T17:41:31.2433333+00:00 @Jason Holt Thanks for reaching out to us again, I hope your issue is resolved, if you are still blocked by this issue, please kindly share your region so that we can check further on this issue.
Regards,
Yutong
-
Jason Holt • 5 Reputation points
2024-10-23T18:31:46.6266667+00:00 Hi there! US East 2.
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-23T19:07:52.5966667+00:00 Thanks for your information, this is a known issue and product team is working on a fix.
However, there is a workaround for you to unblock from this issue. The workaround for the issue is to enable Managed identity on the OpenAI resource manually at this moment.
First, please make sure you have the correct role assigned as this document
Then, as the product team suggested, please set your web app -
Please go to Azure portal and find your web app. Under Environment Variables, look for these 2 variables: Azure OPENAIEmbeddingEndpoint and AzureOpenAiEmbeddingKey.
Set these 2 values to the endpoint and key associated with your embedding model. This information can be found on the deployments tab of AI studio.
Make sure that the AZURE_SEARCH_KEY variable is populated. Clear any value for AzureOpenAiEmbeddingName. Save the updated Environment variables. Open the web app from the Azure portal itself (rather than from the studio).Please have a try and let us know how it works.
Regards,
Yutong
-
Jason Holt • 5 Reputation points
2024-10-24T09:56:58.83+00:00 It seems my AZURE_SEARCH_KEY is not populated. Is this an api key from the search service I'm using?
-
Jason Holt • 5 Reputation points
2024-10-24T10:07:58.6033333+00:00 I tried the search service API key in that space. I'm not getting any error. I asked the chat Tell me about your purpose and it just sits on Generating answer... forever.
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-24T18:40:03.5+00:00 Hello @Jason Holt
Yes, when use key-based authentication in the web app, populate the web app environment variables AZURE_OPENAI_KEY and AZURE_SEARCH_KEY with the AOAI resource key and AI Search admin key respectively.
Have you tried to open the web app from the Azure portal itself (rather than from the studio)? Does it work?
Please let me know if it is not working, I would recommend you raise a support ticket if that is the case.
Regards,
Yutong
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-27T08:43:01.7866667+00:00 @Jason Holt How is everything going right now? I hope this issue has been resolved, please let us know if you need more help.
Basically, there are two scenarios for handling web app deployments when it relates to authentication.
- Key based authentication
- Managed Identity.
When it comes to managed identity there is an expectation that you will have to setup the appropriate roles. This is as designed.
If you want to use key based authentication then you need to ensure that all of the resources are appropriately setup to use key based authentication, and that when adding data, they do so use key based authentication.
If you wish to go forward with key-based authentication and continue to face 400 issues we would need harr trace of the data being added, as well as when they attempt to deploy the wizard. If this is the case, I will suggest you raise a support ticket so that we can check on the backend data.
Regards,
Yutong
-
Jason Holt • 5 Reputation points
2024-10-27T15:55:44.0533333+00:00 Hey there as far as I know it's not solved yet. I prefer to use managed identity but as that was not working I tried the key solution. I did launch the app from the Azure Portal but this didn't help. Unfortunately adding the appropriate keys didn't work either. I'm not an expert with Azure but I've worked in IT and I currently do app development so most of the time I can figure things out but I'm a bit stuck at this point.
-
Jason Holt • 5 Reputation points
2024-10-27T15:58:02.8966667+00:00 I'm still getting an error, a different one. For some reason the last comment was auto deleted. But this is after trying key based authentication. I open the app from the Azure Portal not from AI Studio.
There was an error generating a response. Chat history can't be saved at this time. Error code: 400 - {'error': {'requestid': 'b6809e0b-2b07-43db-80f4-27a4a51c6181', 'code': 400, 'message': "Invalid AzureCognitiveSearch configuration detected: Call to get Azure Search index failed. Check if you are using the correct Azure Search endpoint and index name. If you are using key based authentication, check if the admin key is correct. If you are using access token authentication or managed identity of Azure OpenAI, check if the Azure Search has enabled RBAC based authentication and if the user identity or Azure OpenAI managed identity has required role assignments to access Azure Search resource [https://aka.ms/aoaioydauthentication]. If the Azure Search resource has no public network access, make sure enable trusted service of Azure Search.\nAzure Search Error: 403, message='Server responded with status 403. Error message: ', url='https://jhdigital-ai-search705333270289.search.windows.net/indexes/mythic-search-index?api-version=2024-03-01-preview'\nServer responded with status 403. Error message: "}}
_
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-28T17:15:32.87+00:00 @Jason Holt Sorry to hear that, to expediate the process, I would recommend you raise a support ticket at this moment so that a support engineer can check deeper with your HAR file and more details for your setting at the meantime, please let us know if you have no support plan, I am happy to enable you a free ticket for this issue.
I hope this helps.
Regards,
Yutong
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-30T00:27:05.0433333+00:00 Hello @Jason Holt
Thanks for reaching out to us. Follow up again to see if you need any help for creating support ticket. Thanks.
Regards,
Yutong
-
Jason Holt • 5 Reputation points
2024-10-30T06:15:33.7366667+00:00 Hey there thanks for your patience. That would be great if you could help with creating the support ticket (or free ticket). Also what part of the portal do I send the ticket from.
-
YutongTie-MSFT • 53,771 Reputation points
2024-10-30T17:13:02.9333333+00:00 @Jason Holt Sure, please share your Azure Subscription ID to me via private message, I am happy to enable you a free ticket. I will ping you there as well.
Regards,
Yutong
-
Scott Hermes • 0 Reputation points
2025-01-23T18:31:01.6766667+00:00 For anyone who shows up with this exact error, I fixed it by updating all of the permissions as outlined in the post above, filling in the value for AZURE_SEARCH_KEY on the deployed web app using the value from Keys section of the deployed AI Search resource, AND enabling BOTH RBAC and API Keys under the Keys section of the Azure AI Search resource.
It was probably only the missing key that was the problem, but I did all of these things
Sign in to comment