Skip to content

Azure AI Inference SDK Authentication Audience invalid. #40260

Closed
@mrm9084

Description

@mrm9084
  • Package Name: azure-ai-inference, azure-identity
  • Package Version: 1.0.0b9, 1.21.0
  • Operating System: Windows
  • Python Version: 3.12.9

Describe the bug
The instructions inside of Azure AI Foundry for authenticating with Entra ID fail when using the Azure AI Inference SDK.

To Reproduce
Steps to reproduce the behavior:

  1. Crate a standard hub and project, note API key validation is disabled.
  2. Use the instructions to create a ChatCompletionClient

Running the code result in the following error:

ERROR:app:Error processing chat request: (None) Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired.
Code: None
Message: Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired.

Note: The instructions for the openai library work fine.

Metadata

Metadata

Assignees

Labels

AI Model InferenceIssues related to the client library for Azure AI Model Inference (\sdk\ai\azure-ai-inference)ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions