Skip to content

Commit 6d72a4c

Browse files
authored
Merge pull request #18 from Blackmist/300714-entra-id
documenting entra id option
2 parents 52f440f + 7fd09ca commit 6d72a4c

File tree

8 files changed

+70
-20
lines changed

8 files changed

+70
-20
lines changed

articles/ai-studio/concepts/rbac-ai-studio.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,31 @@ If your AI Studio hub is configured with a **user-assigned managed identity**, t
214214

215215
Within the key vault, the user or service principal must have the create, get, delete, and purge access to the key through a key vault access policy. For more information, see [Azure Key Vault security](/azure/key-vault/general/security-features#controlling-access-to-key-vault-data).
216216

217+
## Scenario: Connections using Microsoft Entra ID authentication
218+
219+
When you create a connection that uses Microsoft Entra ID authentication, you must assign roles to your developers so they can access the resource.
220+
221+
| Resource connection | Role | Description |
222+
|----------|------|-------------|
223+
| Azure AI Search | Contributor | List API-Keys to list indexes from Azure OpenAI Studio. |
224+
| Azure AI Search | Search Index Data Contributor | Required for indexing scenarios |
225+
| Azure AI services/Azure OpenAI | Cognitive Services OpenAI Contributor | Call public ingestion API from Azure OpenAI Studio. |
226+
| Azure AI services/OpenAI | Cognitive Services User | List API-Keys from Azure OpenAI Studio. |
227+
| Azure AI services/OpenAI | Contributor | Allows for calls to the control plane. |
228+
229+
When using Microsoft Entra ID authenticated connections in the chat playground, the services need to authorize each other to access the required resources. The admin performing the configuration needs to have the __Owner__ role on these resources to add role assignments. The following table lists the required role assignments for each resource. The __Assignee__ column refers to the system-assigned managed identity of the listed resource. The __Resource__ column refers to the resource that the assignee needs to access. For example, Azure OpenAI has a system-assigned managed identity that needs to be assigned the __Search Index Data Reader__ role for the Azure AI Search resource.
230+
231+
| Role | Assignee | Resource | Description |
232+
|------|----------|----------|-------------|
233+
| Search Index Data Reader | Azure AI services/OpenAI | Azure AI Search | Inference service queries the data from the index. Only used for inference scenarios. |
234+
| Search Index Data Contributor | Azure AI services/OpenAI | Azure AI Search | Read-write access to content in indexes. Import, refresh, or query the documents collection of an index. Only used for ingestion and inference scenarios. |
235+
| Search Service Contributor | Azure AI services/OpenAI | Azure AI Search | Read-write access to object definitions (indexes, aliases, synonym maps, indexers, data sources, and skillsets). Inference service queries the index schema for auto fields mapping. Data ingestion service creates index, data sources, skill set, indexer, and queries the indexer status. |
236+
| Cognitive Services OpenAI Contributor | Azure AI Search | Azure AI services/OpenAI | Custom skill |
237+
| Cognitive Services OpenAI User | Azure OpenAI Resource for chat model | Azure OpenAI resource for embedding model | Required only if using two Azure OpenAI resources to communicate. |
238+
239+
> [!NOTE]
240+
> The __Cognitive Services OpenAI User__ role is only required if you are using two Azure OpenAI resources: one for your chat model and one for your embedding model. If this applies, enable Trusted Services AND ensure the connection for your embedding model Azure OpenAI resource has Microsoft Entra ID enabled.
241+
217242
## Scenario: Use an existing Azure OpenAI resource
218243

219244
When you create a connection to an existing Azure OpenAI resource, you must also assign roles to your users so they can access the resource. You should assign either the **Cognitive Services OpenAI User** or **Cognitive Services OpenAI Contributor** role, depending on the tasks they need to perform. For information on these roles and the tasks they enable, see [Azure OpenAI roles](/azure/ai-services/openai/how-to/role-based-access-control#azure-openai-roles).

articles/ai-studio/how-to/connections-add.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ Follow these steps to create a new connection that's only available for the curr
5252

5353
:::image type="content" source="../media/data-connections/connection-add-browse-azure-ai-search.png" alt-text="Screenshot of the page to select Azure AI Search from a list of other resources." lightbox="../media/data-connections/connection-add-browse-azure-ai-search.png":::
5454

55-
1. Browse for and select your Azure AI Search service from the list of available services. Select **Add connection**.
55+
1. Browse for and select your Azure AI Search service from the list of available services and then select the type of __Authentication__ to use for the resource. Select **Add connection**.
56+
57+
> [!TIP]
58+
> Different connection types support different authentication methods. Using Microsoft Entra ID may require specific Azure role-based access permissions for your developers. For more information, visit [Role-based access control](../concepts/rbac-ai-studio.md#scenario-connections-using-microsoft-entra-id-authentication).
59+
>
60+
> Microsoft Entra ID support with the Azure AI Search connection is currently in preview.
5661
5762
:::image type="content" source="../media/data-connections/connection-add-azure-ai-search-connect.png" alt-text="Screenshot of the page to select the Azure AI Search service that you want to connect to." lightbox="../media/data-connections/connection-add-azure-ai-search-connect.png":::
5863

articles/ai-studio/how-to/develop/connections-add-sdk.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: azure-ai-studio
77
ms.custom:
88
- build-2024
99
ms.topic: how-to
10-
ms.date: 5/21/2024
10+
ms.date: 08/29/2024
1111
ms.reviewer: dantaylo
1212
ms.author: larryfr
1313
author: Blackmist
@@ -31,6 +31,10 @@ Connections are a way to authenticate and consume both Microsoft and other resou
3131

3232
[!INCLUDE [SDK setup](../../includes/development-environment-config.md)]
3333

34+
## Authenticating with Microsoft Entra ID
35+
36+
There are various authentication methods for the different connection types. When you use Microsoft Entra ID, in addition to creating the connection you might also need to grant Azure role-based access control permissions before the connection can be used. For more information, visit [Role-based access control](../../concepts/rbac-ai-studio.md#scenario-connections-using-microsoft-entra-id-authentication).
37+
3438
## Azure OpenAI Service
3539

3640
The following example creates an Azure OpenAI Service connection.
@@ -44,14 +48,20 @@ from azure.ai.ml.entities import UsernamePasswordConfiguration
4448

4549
name = "XXXXXXXXX"
4650

47-
target = "https://XXXXXXXXX.cognitiveservices.azure"
48-
api_key= "my-key"
51+
target = "https://XXXXXXXXX.cognitiveservices.azure.com/"
52+
4953
resource_id= "Azure-resource-id"
5054

55+
# Microsoft Entra ID
56+
credentials = None
57+
# Uncomment the following to use API key instead
58+
# api_key= "my-key"
59+
# credentials = ApiKeyConfiguration(key=api_key)
60+
5161
wps_connection = AzureOpenAIConnection(
5262
name=name,
5363
azure_endpoint=target,
54-
credentials=ApiKeyConfiguration(key=api_key),
64+
credentials=credentials,
5565
resource_id = resource_id,
5666
is_shared=False
5767
)
@@ -70,12 +80,17 @@ name = "my-ai-services"
7080

7181
target = "https://XXXXXXXXX.cognitiveservices.azure.com/"
7282
resource_id=""
73-
api_key="XXXXXXXXX"
83+
84+
# Microsoft Entra ID
85+
credentials = None
86+
# Uncomment the following to use API key instead
87+
# api_key= "my-key"
88+
# credentials = ApiKeyConfiguration(key=api_key)
7489

7590
wps_connection = AzureAIServicesConnection(
7691
name=name,
7792
endpoint=target,
78-
credentials=ApiKeyConfiguration(key=api_key),
93+
credentials=credentials,
7994
ai_services_resource_id=resource_id,
8095
)
8196
ml_client.connections.create_or_update(wps_connection)
@@ -90,13 +105,18 @@ from azure.ai.ml.entities import AzureAISearchConnection, ApiKeyConfiguration
90105
from azure.ai.ml.entities import UsernamePasswordConfiguration
91106

92107
name = "my_aisearch_demo_connection"
93-
94108
target = "https://XXXXXXXXX.search.windows.net"
95-
api_key="XXXXXXXXX"
109+
110+
# Microsoft Entra ID
111+
credentials = None
112+
# Uncomment the following to use API key instead
113+
# api_key= "my-key"
114+
# credentials = ApiKeyConfiguration(key=api_key)
115+
96116
wps_connection = AzureAISearchConnection(
97117
name=name,
98118
endpoint=target,
99-
credentials=ApiKeyConfiguration(key=api_key),
119+
credentials=credentials,
100120
)
101121
ml_client.connections.create_or_update(wps_connection)
102122
```
@@ -132,7 +152,7 @@ from azure.ai.ml.entities import ServerlessConnection
132152

133153
name = "my_maas_apk"
134154

135-
endpoint = "https://XXXXXXXXX.eastus2.inference.ai.azure.com"
155+
endpoint = "https://XXXXXXXXX.eastus2.inference.ai.azure.com/"
136156
api_key = "XXXXXXXXX"
137157
wps_connection = ServerlessConnection(
138158
name=name,
-183 KB
Loading
-436 KB
Loading

articles/machine-learning/reference-yaml-connection-ai-search.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.topic: reference
1111

1212
author: Blackmist
1313
ms.author: larryfr
14-
ms.date: 05/09/2024
14+
ms.date: 08/29/2024
1515
ms.reviewer: ambadal
1616
---
1717

@@ -32,7 +32,7 @@ ms.reviewer: ambadal
3232
| `type` | string | **Required.** The connection type. | `azure_ai_search` | `azure_ai_search` |
3333
| `is_shared` | boolean | `true` if the connection is shared across other projects in the hub; otherwise, `false`. | | `true` |
3434
| `endpoint` | string | **Required.** The URL of the endpoint. | | |
35-
| `api_key` | string | **Required.** The API key used to authenticate the connection. If not provided, a Microsoft Entra ID (credential-less authentication) connection is created. | | |
35+
| `api_key` | string | The API key used to authenticate the connection. If not provided, the connection is authenticated via Microsoft Entra ID (credential-less authentication). | | |
3636

3737
## Remarks
3838

@@ -54,7 +54,7 @@ endpoint: https://contoso.search.windows.net/
5454
api_key: XXXXXXXXXXXXXXX
5555
```
5656
57-
### YAML: credential-less
57+
### YAML: Microsoft Entra ID (preview)
5858
5959
```yml
6060
#AzureContentSafetyConnection.yml

articles/machine-learning/reference-yaml-connection-ai-services.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.topic: reference
1111

1212
author: Blackmist
1313
ms.author: larryfr
14-
ms.date: 08/21/2024
14+
ms.date: 08/29/2024
1515
ms.reviewer: ambadal
1616
---
1717

@@ -32,7 +32,7 @@ ms.reviewer: ambadal
3232
| `type` | string | **Required.** The connection type. | `azure_ai_services` | `azure_ai_services` |
3333
| `is_shared` | boolean | `true` if the connection is shared across other projects in the hub; otherwise, `false`. | | `true` |
3434
| `endpoint` | string | **Required.** The URL of the endpoint. | | |
35-
| `api_key` | string | **Required.** The API key used to authenticate the connection. If not provided, a Microsoft Entra ID (credential-less authentication) connection is created. | | |
35+
| `api_key` | string | The API key used to authenticate the connection. If not provided, the connection is authenticated via Microsoft Entra ID (credential-less authentication). | | |
3636
| `ai_services_resource_id` | string | **Required.** The fully qualified Azure resource ID of the Azure AI Services resource. | | |
3737

3838

@@ -63,7 +63,7 @@ api_key: XXXXXXXXXXXXXXX
6363
```
6464
6565
66-
### YAML: credential-less
66+
### YAML: Microsoft Entra ID
6767
6868
```yml
6969
#AzureAIServiceConnection.yml

articles/machine-learning/reference-yaml-connection-azure-openai.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.topic: reference
1111

1212
author: Blackmist
1313
ms.author: larryfr
14-
ms.date: 05/09/2024
14+
ms.date: 08/29/2024
1515
ms.reviewer: ambadal
1616
---
1717

@@ -32,7 +32,7 @@ ms.reviewer: ambadal
3232
| `type` | string | **Required.** The connection type. | `azure_open_ai` | `azure_open_ai` |
3333
| `is_shared` | boolean | `true` if the connection is shared across other projects in the hub; otherwise, `false`. | | `true` |
3434
| `endpoint` | string | **Required.** The URL of the endpoint. | | |
35-
| `api_key` | string | **Required.** The API key used to authenticate the connection. If not provided, a Microsoft Entra ID (credential-less authentication) connection is created. | | |
35+
| `api_key` | string | The API key used to authenticate the connection. If not provided, the connection is authenticated via Microsoft Entra ID (credential-less authentication). | | |
3636
| `open_ai_resource_id` | string | **Required.** The fully qualified Azure resource ID of the Azure OpenAI resource. | | |
3737

3838

@@ -58,7 +58,7 @@ api_key: XXXXXXXXXXXXXXX
5858
```
5959
6060
61-
### YAML: credential-less
61+
### YAML: Microsoft Entra ID
6262
6363
```yml
6464
#AzureOpenAIConnection.yml

0 commit comments

Comments
 (0)