Unable to authenticate access to Azure Open AI service model using microsoft entrada id for langchain?

Taimoor Akhtar 20 Reputation points Microsoft Employee
2025-03-03T03:56:15.6666667+00:00

I have setup Azure Open AI service and deployed a model for access using Microsoft entrada ID. While I was able to connect to the model using python's openai library (specifically AsyncAzureOpenAI). However, I have had no success when attempting the same to enable model access for langchain (specifically via AzureAIChatCompletionsModel class in langchain_azure_ai.chat_models). I am certain that the api_version is correct for the model. Also, I use AzureCliCredential for authentication. However, I had no success whatsoever and get the following error:

ClientAuthenticationError: (None) Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired.

I understand that the above error was reported by other tickets too. I tried resolution through tips on those tickets but have not found a solution yet. Kindly provide assistance on this.

Azure OpenAI in Foundry Models
0 comments No comments

1 answer

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.