Skip to content

Commit fbfead4

Browse files
committed
fixes
1 parent dd3ed5e commit fbfead4

File tree

7 files changed

+83
-7
lines changed

7 files changed

+83
-7
lines changed

articles/ai-foundry/model-inference/includes/code-create-chat-client-entra.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ import os
2222
from azure.ai.inference import ChatCompletionsClient
2323
from azure.identity import DefaultAzureCredential
2424

25+
client = ChatCompletionsClient(
26+
endpoint="https://<resource>.services.ai.azure.com/models",
27+
credential=DefaultAzureCredential(),
28+
)
29+
```
30+
31+
If you need to configure a custom audience, do as follows:
32+
33+
```python
34+
import os
35+
from azure.ai.inference import ChatCompletionsClient
36+
from azure.identity import DefaultAzureCredential
37+
2538
client = ChatCompletionsClient(
2639
endpoint="https://<resource>.services.ai.azure.com/models",
2740
credential=DefaultAzureCredential(),
@@ -44,6 +57,19 @@ import ModelClient from "@azure-rest/ai-inference";
4457
import { isUnexpected } from "@azure-rest/ai-inference";
4558
import { DefaultAzureCredential } from "@azure/identity";
4659

60+
const client = new ModelClient(
61+
"https://<resource>.services.ai.azure.com/models",
62+
new DefaultAzureCredential()
63+
);
64+
```
65+
66+
If you need to configure a custom audience, do as follows:
67+
68+
```javascript
69+
import ModelClient from "@azure-rest/ai-inference";
70+
import { isUnexpected } from "@azure-rest/ai-inference";
71+
import { DefaultAzureCredential } from "@azure/identity";
72+
4773
const clientOptions = { credentials: { "https://cognitiveservices.azure.com" } };
4874

4975
const client = new ModelClient(
@@ -77,6 +103,15 @@ using Azure.AI.Inference;
77103

78104
Then, you can use the package to consume the model. The following example shows how to create a client to consume chat completions with Entra ID:
79105

106+
```csharp
107+
ChatCompletionsClient client = new ChatCompletionsClient(
108+
new Uri("https://<resource>.services.ai.azure.com/models"),
109+
new DefaultAzureCredential()
110+
);
111+
```
112+
113+
If you need to configure a custom audience, do as follows:
114+
80115
```csharp
81116
TokenCredential credential = new DefaultAzureCredential();
82117
AzureAIInferenceClientOptions clientOptions = new AzureAIInferenceClientOptions();
@@ -86,7 +121,7 @@ clientOptions.AddPolicy(tokenPolicy, HttpPipelinePosition.PerRetry);
86121
ChatCompletionsClient client = new ChatCompletionsClient(
87122
new Uri("https://<resource>.services.ai.azure.com/models"),
88123
credential,
89-
clientOptions.
124+
clientOptions
90125
);
91126
```
92127

articles/ai-foundry/model-inference/includes/configure-entra-id/intro.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ ms.date: 01/23/2025
77
ms.topic: include
88
---
99

10-
[!INCLUDE [Feature preview](../../../includes/feature-preview.md)]
11-
1210
Models deployed to Azure AI model inference in Azure AI Services support key-less authorization using Microsoft Entra ID. Key-less authorization enhances security, simplifies the user experience, reduces operational complexity, and provides robust compliance support for modern development. It makes it a strong choice for organizations adopting secure and scalable identity management solutions.
1311

1412
This article explains how to configure Microsoft Entra ID for inference in Azure AI model inference.

articles/ai-foundry/model-inference/includes/configure-entra-id/troubleshooting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following table contains multiple scenarios that can help troubleshooting Mi
2929
| You're using an SDK. | Known issues. | Before making further troubleshooting, it's advisable to install the latest version of the software you are using to connect to the service. Authentication bugs may have been fixed in a newer version of the software you're using. |
3030
| `401 Principal does not have access to API/Operation` | The request indicates authentication in the correct way, however, the user principal doesn't have the required permissions to use the inference endpoint. | Ensure you have: <br /> 1. Assigned the role **Cognitive Services User** to your principal to the Azure AI Services resource. Notice that **Cognitive Services OpenAI User** grants only access to OpenAI models. **Owner** or **Contributor** don't provide access either.<br /> 2. Wait at least 5 minutes before making the first call. |
3131
| `401 HTTP/1.1 401 PermissionDenied` | The request indicates authentication in the correct way, however, the user principal doesn't have the required permissions to use the inference endpoint. | Assigned the role **Cognitive Services User** to your principal in the Azure AI Services resource. Roles like **Administrator** or **Contributor** don't grand inference access. Wait at least 5 minutes before making the first call. |
32+
| You're using Microsoft Entra ID with Azure AI Inference package and you get `401 Unauthorized. Access token is missing, invalid, audience is incorrect, or have expired.` | The request is failing to perform authentication with Entra ID. | Ensure you have the latest version of the Azure AI Inference package installed. The default scope for Microsoft Entra ID may have changed from the version you were using before. Azure AI Model Inference uses the scope `https://cognitiveservices.azure.com/.default`. |
3233
| You're using REST API calls and you get `401 Unauthorized. Access token is missing, invalid, audience is incorrect, or have expired.` | The request is failing to perform authentication with Entra ID. | Ensure the `Authentication` header contains a valid token with a scope `https://cognitiveservices.azure.com/.default`. |
3334
| You're using `AzureOpenAI` class and you get `401 Unauthorized. Access token is missing, invalid, audience is incorrect, or have expired.` | The request is failing to perform authentication with Entra ID. | Ensure that you are using an **OpenAI model** connected to the endpoint `https://<resource>.openai.azure.com`. You can't use `OpenAI` class or a Models-as-a-Service model. If your model is not from OpenAI, use the Azure AI Inference SDK. |
3435
| You're using the Azure AI Inference SDK and you get `401 Unauthorized. Access token is missing, invalid, audience is incorrect, or have expired.` | The request is failing to perform authentication with Entra ID. | Ensure you're connected to the endpoint `https://<resource>.services.ai.azure.com/model` and that you indicated the right scope for Entra ID (`https://cognitiveservices.azure.com/.default`). |

articles/ai-foundry/model-inference/includes/create-model-deployments/intro.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ ms.date: 1/21/2025
77
ms.topic: include
88
---
99

10-
[!INCLUDE [Feature preview](../../../includes/feature-preview.md)]
11-
1210
You can decide and configure which models are available for inference in the inference endpoint. When a given model is configured, you can then generate predictions from it by indicating its model name or deployment name on your requests. No further changes are required in your code to use it.
1311

1412
In this article, you'll learn how to add a new model to Azure AI model inference in Azure AI Foundry.

articles/ai-foundry/model-inference/includes/create-resources/intro.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ ms.date: 1/21/2025
77
ms.topic: include
88
---
99

10-
[!INCLUDE [Feature preview](../../../includes/feature-preview.md)]
11-
1210
In this article, you learn how to create the resources required to use Azure AI model inference and consume flagship models from Azure AI model catalog.
1311

1412
## Understand the resources
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Azure AI Model Inference API version lifecycle
3+
titleSuffix: Azure AI Foundry
4+
description: Learn more about API version retirement in Azure OpenAI Services.
5+
manager: scottpolly
6+
ms.service: azure-ai-model-inference
7+
ms.topic: conceptual
8+
ms.date: 03/01/2025
9+
ms.reviewer: fasantia
10+
ms.author: mopeakande
11+
author: msakande
12+
---
13+
14+
# Azure AI Model Inference API lifecycle
15+
16+
This article explains Azure AI Model Inference API versions and how you think about them. Whenever possible we recommend using either the latest GA, or preview API releases.
17+
18+
## Latest API releases
19+
20+
The following list contains the latest releases of APIs for Azure AI Model Inference.
21+
22+
### 2025-04-01
23+
24+
This version expands the previous API version and introduces the following features:
25+
26+
* General availability.
27+
* Reasoning models return reasoning content in the field `reasoning_content` on messages of with role `assistant`. When streaming content, both `content` and `reasoning_content` are included in deltas.
28+
* Route `/info` adds an optional parameter `model` to indicate the model deployment name to get information from when the endpoint is running multiple model deployments.
29+
30+
### 2024-05-01-preview
31+
32+
This version introduces the following features:
33+
34+
* Embeddings models.
35+
* Image embeddings models.
36+
* Chat completions models with images and audio inputs.
37+
38+
## Deprecation
39+
40+
The following API version has been deprecated and marked for retirement:
41+
42+
| API Version | Status | Deprecation date | Retirement date | Replacement |
43+
|--------------------|------------|------------------|-----------------|-------------|
44+
| 2024-05-01-preview | Deprecated | 04/10/2024 | 04/10/2025 | 2025-04-01 |

articles/ai-foundry/model-inference/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ items:
104104
items:
105105
- name: What's the Azure AI Model Inference API?
106106
href: /rest/api/aifoundry/modelinference
107+
- name: API versioning
108+
href: ./reference/api-version-updates.md
107109
- name: Reference
108110
items:
109111
- name: Get Model Info

0 commit comments

Comments
 (0)