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

Failed to get managed identity token. #699

Closed
iunknown80 opened this issue Mar 13, 2024 · 11 comments
Closed

Failed to get managed identity token. #699

iunknown80 opened this issue Mar 13, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@iunknown80
Copy link

Describe the bug
While testing the code locally using your own data. I am getting the below error. Works well for just chat.

Error
Error code: 400 - {'error': {'requestid': 'aae728a0-799f-49de-8ade-c1e51a5bbbbc', '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."}}'}}

Use AzureSearch Service with semantic search

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
No error.

Screenshots
image

Configuration: Please provide the following

  • Azure OpenAI model name and version (e.g. 'gpt-35-turbo-16k, version 0613'): gtp35turbo
  • Is chat history enabled? No
  • Are you using data? If so, what data source? (e.g. Azure AI Search, Azure CosmosDB Mongo vCore, etc) AzureAI Search

Additional context
We have multiple AI apps using data is deployment are running successfully. I checked out the latest code to test and upgrade all the AI apps eventually.

@iunknown80 iunknown80 added the bug Something isn't working label Mar 13, 2024
@sarah-widder
Copy link
Contributor

Hi @gabrielsusai have you set AZURE_OPENAI_KEY and AZURE_SEARCH_KEY in your local .env file? It looks like it's attempting to use managed identity authentication which is not configured for your resource, so you should set the keys instead.

@iunknown80
Copy link
Author

@sarah-widder All the below keys have values in my local .env file. I have two copies of the sample-app. The older copy works fine which is currently deployed in production with the same resources. Now, I took the latest version of the sample-app and using the same configuration. Does the new code requires to make any change in the Azure AI resources?

AZURE_OPENAI_RESOURCE=bxxxxx
AZURE_OPENAI_MODEL=Gxxxxx
AZURE_OPENAI_KEY=6xxxxx
AZURE_OPENAI_MODEL_NAME=gptxxxxx
AZURE_SEARCH_SERVICE=bxxxxx
AZURE_SEARCH_INDEX=axxxxxx
AZURE_SEARCH_KEY=Yxxxxx
AZURE_SEARCH_SEMANTIC_SEARCH_CONFIG=default

@neissljanik
Copy link

neissljanik commented Mar 18, 2024

Could there be an API Version mismatch? I've had this issue before and resolved it by updating the API version in the .env file to the version actually used by the application code. If these values don't match, the API expects the payload in a different format compared to what it actually receives from the application. A mismatch might be caused by pulling the latest upstream changes, where maybe a new API version was implemented in the code, but not updating the API version in the .env file.

@iunknown80
Copy link
Author

@neissljanik Latest version of the code resolved the issue and I noticed a few changes in the utilization of API version and your own data.

@GraysonQuartech
Copy link

I am currently also getting this error.... same repro steps as above. using typescript
image

@harshbangad
Copy link

Started getting this error since last week. Chat playground works fine on Azure AI Studio but the webapp throws this error. @gabrielsusai Please check this bug #1024

@sarah-widder
Copy link
Contributor

@harshbangad @GraysonQuartech check if system assigned managed identity is enabled on the Azure OpenAI resource, that would be the cause of this error message. It needs to be enabled.

@harshbangad
Copy link

@sarah-widder It is enabled. I never changed anything. I have other similar deployments which work fine in both chat and webapp. But since last week, the chat is working fine but webapp is not. You can check the bug i posted above. Others are facing it too. Did something change on webapp side?

image

@kunalghangas
Copy link

Same issue here.

@LucasPonzo
Copy link

@harshbangad @GraysonQuartech check if system assigned managed identity is enabled on the Azure OpenAI resource, that would be the cause of this error message. It needs to be enabled.

In my case, as in 30/Aug/2024 it was disabled. I enabled the managed identity for the AI Service (created via AI Studio Hub) and the Web App worked gracefully!

@thenewnano
Copy link

I can confirm that I had the same strange understanding that the managed identity for the AI Services need to be enabled, and it solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants