Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,396 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to connect a non-Azure OpenAI embedding model in AI Foundry using Microsoft Entra ID.
I don't have an issue connecting to Azure OpenAI embedding models using Microsoft Entra ID.
After creating a client and executing the following simple code:
model = EmbeddingsClient(
endpoint=endpoint,
credential=DefaultAzureCredential(),
model=model_name
)
response = model.embed(
input=["first phrase","second phrase","third phrase"],
)
I get the following error when "response" is created:
Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com or https://ai.azure.com), or have expired.
I have tried using the following in the code but I still have the issue
token_provider = get_bearer_token_provider(
DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
)