Skip to content

Commit 6357c77

Browse files
committed
fix: temp
1 parent b3761f3 commit 6357c77

File tree

4 files changed

+57
-19
lines changed

4 files changed

+57
-19
lines changed

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

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ from azure.identity import AzureDefaultCredential
2828
model = ChatCompletionsClient(
2929
endpoint=os.environ["AZUREAI_ENDPOINT_URL"],
3030
credential=AzureDefaultCredential(),
31+
model="mistral-large-2407",
3132
)
3233
```
3334

@@ -48,7 +49,8 @@ import { AzureDefaultCredential } from "@azure/identity";
4849

4950
const client = new ModelClient(
5051
process.env.AZUREAI_ENDPOINT_URL,
51-
new AzureDefaultCredential()
52+
new AzureDefaultCredential(),
53+
"mistral-large-2407"
5254
);
5355
```
5456

@@ -79,13 +81,43 @@ Then, you can use the package to consume the model. The following example shows
7981
```csharp
8082
ChatCompletionsClient client = new ChatCompletionsClient(
8183
new Uri(Environment.GetEnvironmentVariable("AZURE_INFERENCE_ENDPOINT")),
82-
new DefaultAzureCredential(includeInteractiveCredentials: true)
84+
new AzureDefaultCredential(includeInteractiveCredentials: true),
85+
"mistral-large-2407"
8386
);
8487
```
8588

89+
# [Java](#tab/java)
90+
91+
Add the package to your project:
92+
93+
```xml
94+
<dependency>
95+
<groupId>com.azure</groupId>
96+
<artifactId>azure-ai-inference</artifactId>
97+
<version>1.0.0-beta.1</version>
98+
</dependency>
99+
<dependency>
100+
<groupId>com.azure</groupId>
101+
<artifactId>azure-identity</artifactId>
102+
<version>1.13.3</version>
103+
</dependency>
104+
```
105+
106+
Then, you can use the package to consume the model. The following example shows how to create a client to consume chat completions:
107+
108+
```java
109+
ChatCompletionsClient client = new ChatCompletionsClientBuilder()
110+
.credential(new DefaultAzureCredential()))
111+
.endpoint("{endpoint}")
112+
.model("mistral-large-2407")
113+
.buildClient();
114+
```
115+
116+
Explore our [samples](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-inference/src/samples) and read the [API reference documentation](https://aka.ms/azsdk/azure-ai-inference/java/reference) to get yourself started.
117+
86118
# [REST](#tab/rest)
87119

88-
Use the reference section to explore the API design and which parameters are available and indicate authentication token in the header `Authorization`. For example, the reference section for [Chat completions](reference-model-inference-chat-completions.md) details how to use the route `/chat/completions` to generate predictions based on chat-formatted instructions. Notice that the path `/models` is included to the root of the URL:
120+
Use the reference section to explore the API design and which parameters are available and indicate authentication token in the header `Authorization`. For example, the reference section for [Chat completions](../../../ai-studio/reference/reference-model-inference-chat-completions.md) details how to use the route `/chat/completions` to generate predictions based on chat-formatted instructions. Notice that the path `/models` is included to the root of the URL:
89121

90122
__Request__
91123

@@ -94,4 +126,10 @@ POST models/chat/completions?api-version=2024-04-01-preview
94126
Authorization: Bearer <bearer-token>
95127
Content-Type: application/json
96128
```
97-
---
129+
---
130+
131+
For testing purposes, the easiest way to get a valid token for your user account is to use the Azure CLI. In a console, run the following Azure CLI command:
132+
133+
```azurecli
134+
az account get-access-token --resource https://cognitiveservices.azure.com --query "accessToken" --output tsv
135+
```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ In your console, follow these steps:
6161

6262
1. Define the main deployment:
6363

64-
__deploy-simple-entra-id.bicep__
64+
__deploy-entra-id.bicep__
6565

66-
:::code language="bicep" source="~/azureai-model-inference-bicep/infra/deploy-simple-entra-id.bicep":::
66+
:::code language="bicep" source="~/azureai-model-inference-bicep/infra/deploy-entra-id.bicep":::
6767

6868
2. Log into Azure:
6969

@@ -86,7 +86,7 @@ In your console, follow these steps:
8686
az deployment group create \
8787
--resource-group $RESOURCE_GROUP \
8888
--securityPrincipalId $SECURITY_PRINCIPAL_ID
89-
--template-file deploy-simple-entra-id.bicep
89+
--template-file deploy-entra-id.bicep
9090
```
9191
9292
7. The template outputs the Azure AI model inference endpoint that you can use to consume any of the model deployments you have created.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[!INCLUDE [Feature preview](../../../../ai-studio/includes/feature-preview.md)]
22

3-
Models deployed to Azure AI model inference in Azure AI Services support key-less authorization using Microsoft Entra ID. It enhances security, simplifies the user experience, reduces operational complexity, and provides robust compliance support for modern development. This makes it a strong choice for organizations adopting secure and scalable identity management solutions. You can [configure Microsoft Entra ID authorization in the resource](#configure-microsoft-entra-id-for-inferenced) and, optionally, [disable key-based authentication to prevent any user to still use keys to access the service](#disable-key-based-authentication-in-the-resource).
3+
Models deployed to Azure AI model inference in Azure AI Services support key-less authorization using Microsoft Entra ID. It 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. You can configure Microsoft Entra ID authorization in the resource and, optionally, **disable key-based authentication** to prevent any user to still use keys to access the service.
44

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

77
## Understand roles in the context of resource in Azure
88

99
Microsoft Entra ID uses the idea of Role-based Access Control (RBAC) for authorization. Roles are central to managing access to your cloud resources. A role is essentially a collection of permissions that define what actions can be performed on specific Azure resources. By assigning roles to users, groups, service principals, or managed identities—collectively known as security principals—you control their access within your Azure environment to specific resources.
1010

11-
When you assign a role, you specify the security principal, the role definition, and the scope. This combination is known as a role assignment. Azure AI model inference is a capability of the Azure AI Services resources, and hence, access to the service is controlled by the roles assigned to that particular resource.
11+
When you assign a role, you specify the security principal, the role definition, and the scope. This combination is known as a role assignment. Azure AI model inference is a capability of the Azure AI Services resources, and hence, roles assigned to that particular resource control the access for inference.
1212

1313
You identify two different types of access to the resources:
1414

15-
* **Administration access**: The actions that are related with the administration of the resources. These type of operations usually change the state of the resource and its configuration. In Azure, those operations are usually considered control-plane operations and can be executed using the Azure Portal, the Azure CLI, or with infrastructure as code. Examples of these are create new model deployments, change content filtering configurations, change the version of the model served, change SKU of a deployment.
16-
* **Developer access**: The actions that are related with the consumption of the resources. These type of operations consumes the capabilities of the resource. For example, invoking the chat completions API. However, the user can't change the state of the resource and its configuration.
15+
* **Administration access**: The actions that are related with the administration of the resources. They usually change the state of the resource and its configuration. In Azure, those operations are control-plane operations and can be executed using the Azure portal, the Azure CLI, or with infrastructure as code. Examples of includes creating a new model deployments, changing content filtering configurations, changing the version of the model served, or changing SKU of a deployment.
16+
* **Developer access**: The actions that are related with the consumption of the resources. They consumes the capabilities of the resource. For example, invoking the chat completions API. However, the user can't change the state of the resource and its configuration.
1717

1818
In Azure, administration operations are always performed using Microsoft Entra ID. Roles like **Cognitive Services Contributor** allow you to perform those operations. On the other hand, developer operations can be performed using either access keys or/and Microsoft Entra ID. Roles like **Cognitive Services User** allow you to perform those operations.
1919

2020
> [!IMPORTANT]
21-
> Having administration access to a resource doesn't necessarily grants developer access to it. Explicit access by granting roles is still required. This is analogous to how database servers work. Having administrator access to the database server doesn't mean you can read the data inside of a database.
21+
> Having administration access to a resource doesn't necessarily grants developer access to it. Explicit access by granting roles is still required. It's analogous to how database servers work. Having administrator access to the database server doesn't mean you can read the data inside of a database.
2222
2323
Follow these steps to configure developer access to Azure AI model inference in the Azure AI Services resource.
2424

@@ -30,4 +30,4 @@ To complete this article, you need:
3030

3131
* An Azure AI services resource. For more information, see [Create an Azure AI Services resource](/articles/ai-foundry/model-inference/how-to/quickstart-create-resources.md).
3232

33-
* Administrator roles for the scope of the Azure AI Services resource or the resource group where it's deployed.
33+
* Administrator roles for the scope of the Azure AI Services resource or the resource group.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ zone_pivot_groups: azure-ai-models-deployment
1212

1313
## Configure Microsoft Entra ID for inference
1414

15-
Follow these steps to configure Microsoft Entra ID for inference if you are using **projects or hubs** in Azure AI Foundry. If your are not using them, Start from step 5 using the Azure portal.
15+
Follow these steps to configure Microsoft Entra ID for inference if you're using **projects or hubs** in Azure AI Foundry. If your are not using them, Start from step 5 using the Azure portal.
1616

17-
1. Go to the [Azure portal](https://portal.azure.com) and locate the Azure AI Services resource you are using. If you are using Azure AI Foundry with projects or hubs, you can navigate to it by:
17+
1. Go to the [Azure portal](https://portal.azure.com) and locate the Azure AI Services resource you're using. If you're using Azure AI Foundry with projects or hubs, you can navigate to it by:
1818

1919
1. Go to [Azure AI Foundry portal](https://ai.azure.com).
2020

2121
2. On the landing page, select **Open management center**.
2222

23-
3. Go to the section **Connected resources** and select the connection to the Azure AI Services resource that you want to configure. If it's not listed, select **View all** to see the full list.
23+
3. Go to the section **Connected resources** and select the connection to the Azure AI Services resource that you want to configure. If it isn't listed, select **View all** to see the full list.
2424

2525
4. On the **Connection details** section, under **Resource**, select the name of the Azure resource. A new page opens.
2626

27-
5. You are now in [Azure portal](https://portal.azure.com) where you can manage all the aspects of the resource itself.
27+
5. You're now in [Azure portal](https://portal.azure.com) where you can manage all the aspects of the resource itself.
2828

2929
2. On the left navigation bar, select **Access control (IAM)**.
3030

@@ -51,7 +51,7 @@ Notice that key-based access is still possible for users that already have keys
5151

5252
## Use Microsoft Entra ID in your code
5353

54-
Once Microsoft Entra ID has been configured in your resource, you need to update your code to use it when consuming the inference endpoint. The following example shows how to use a chat completions model:
54+
Once you configured Microsoft Entra ID in your resource, you need to update your code to use it when consuming the inference endpoint. The following example shows how to use a chat completions model:
5555

5656
[!INCLUDE [code](../code-create-chat-client-entra.md)]
5757

@@ -79,6 +79,6 @@ Even when your resource has Microsoft Entra ID configured, your projects may sti
7979

8080
## Disable key-based authentication in the resource
8181

82-
Disabling key-based authentication is advisable when you’ve implemented Microsoft Entra ID and fully addressed compatibility or fallback concerns in all the applications that consume the service.
82+
Disabling key-based authentication is advisable when you implemented Microsoft Entra ID and fully addressed compatibility or fallback concerns in all the applications that consume the service.
8383

8484

0 commit comments

Comments
 (0)