Skip to content

Commit 044a33d

Browse files
author
Jill Grant
authored
Merge pull request #278224 from wangyuantao/yuantw/sts3
Azure OpenAI On Your Data - Search Trusted Service
2 parents eb48c81 + 9a36e12 commit 044a33d

File tree

6 files changed

+47
-42
lines changed

6 files changed

+47
-42
lines changed

articles/ai-services/openai/how-to/use-your-data-securely.md

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ recommendations: false
1414

1515
# Securely use Azure OpenAI On Your Data
1616

17+
> [!NOTE]
18+
> As of June 2024, the application form for the Microsoft managed private endpoint to Azure AI Search is no longer needed.
19+
>
20+
> The managed private endpoint will be deleted from the Microsoft managed virtual network at July 2025. If you have already provisioned a managed private endpoint through the application process before June 2024, migrate to the [Azure AI Search trusted service](#enable-trusted-service-1) as early as possible to avoid service disruption.
21+
1722
Use this article to learn how to use Azure OpenAI On Your Data securely by protecting data and resources with Microsoft Entra ID role-based access control, virtual networks, and private endpoints.
1823

1924
This article is only applicable when using [Azure OpenAI On Your Data with text](/azure/ai-services/openai/concepts/use-your-data). It does not apply to [Azure OpenAI On Your Data with images](/azure/ai-services/openai/concepts/use-your-image-data).
@@ -28,12 +33,12 @@ When you use Azure OpenAI On Your Data to ingest data from Azure blob storage, l
2833
* Downloading URLs to your blob storage is not illustrated in this diagram. After web pages are downloaded from the internet and uploaded to blob storage, steps 3 onward are the same.
2934
* Two indexers, two indexes, two data sources and a [custom skill](/azure/search/cognitive-search-custom-skill-interface) are created in the Azure AI Search resource.
3035
* The chunks container is created in the blob storage.
31-
* If the ingestion is triggered by a [scheduled refresh](../concepts/use-your-data.md#schedule-automatic-index-refreshes), the ingestion process starts from step 7.
36+
* If the schedule triggers the ingestion, the ingestion process starts from step 7.
3237
* Azure OpenAI's `preprocessing-jobs` API implements the [Azure AI Search customer skill web API protocol](/azure/search/cognitive-search-custom-skill-web-api), and processes the documents in a queue.
3338
* Azure OpenAI:
3439
1. Internally uses the first indexer created earlier to crack the documents.
35-
1. Uses a heuristic-based algorithm to perform chunking, honoring table layouts and other formatting elements in the chunk boundary to ensure the best chunking quality.
36-
1. If you choose to enable vector search, Azure OpenAI uses the selected embedding deployment to vectorize the chunks internally.
40+
1. Uses a heuristic-based algorithm to perform chunking. It honors table layouts and other formatting elements in the chunk boundary to ensure the best chunking quality.
41+
1. If you choose to enable vector search, Azure OpenAI uses the selected embedding setting to vectorize the chunks.
3742
* When all the data that the service is monitoring are processed, Azure OpenAI triggers the second indexer.
3843
* The indexer stores the processed data into an Azure AI Search service.
3944

@@ -43,32 +48,32 @@ For the managed identities used in service calls, only system assigned managed i
4348

4449
:::image type="content" source="../media/use-your-data/inference-architecture.png" alt-text="A diagram showing the process of using the inference API." lightbox="../media/use-your-data/inference-architecture.png":::
4550

46-
When you send API calls to chat with an Azure OpenAI model on your data, the service needs to retrieve the index fields during inference to perform fields mapping automatically if the fields mapping isn't explicitly set in the request. Therefore the service requires the Azure OpenAI identity to have the `Search Service Contributor` role for the search service even during inference.
51+
When you send API calls to chat with an Azure OpenAI model on your data, the service needs to retrieve the index fields during inference to perform fields mapping. Therefore the service requires the Azure OpenAI identity to have the `Search Service Contributor` role for the search service even during inference.
4752

48-
If an embedding deployment is provided in the inference request, the rewritten query will be vectorized by Azure OpenAI, and both query and vector are sent Azure AI Search for vector search.
53+
If an embedding dependency is provided in the inference request, Azure OpenAI will vectorize the rewritten query, and both query and vector are sent to Azure AI Search for vector search.
4954

5055
## Document-level access control
5156

5257
> [!NOTE]
5358
> Document-level access control is supported for Azure AI search only.
5459
55-
Azure OpenAI On Your Data lets you restrict the documents that can be used in responses for different users with Azure AI Search [security filters](/azure/search/search-security-trimming-for-azure-search-with-aad). When you enable document level access, the search results returned from Azure AI Search and used to generate a response will be trimmed based on user Microsoft Entra group membership. You can only enable document-level access on existing Azure AI Search indexes. To enable document-level access:
60+
Azure OpenAI On Your Data lets you restrict the documents that can be used in responses for different users with Azure AI Search [security filters](/azure/search/search-security-trimming-for-azure-search-with-aad). When you enable document level access, Azure AI Search will trim the search results based on user Microsoft Entra group membership specified in the filter. You can only enable document-level access on existing Azure AI Search indexes. To enable document-level access:
5661

57-
1. Follow the steps in the [Azure AI Search documentation](/azure/search/search-security-trimming-for-azure-search-with-aad) to register your application and create users and groups.
58-
1. [Index your documents with their permitted groups](/azure/search/search-security-trimming-for-azure-search-with-aad#index-document-with-their-permitted-groups). Be sure that your new [security fields](/azure/search/search-security-trimming-for-azure-search#create-security-field) have the schema below:
62+
1. To register your application and create users and groups, follow the steps in the [Azure AI Search documentation](/azure/search/search-security-trimming-for-azure-search-with-aad).
63+
1. [Index your documents with their permitted groups](/azure/search/search-security-trimming-for-azure-search-with-aad#index-document-with-their-permitted-groups). Be sure that your new [security fields](/azure/search/search-security-trimming-for-azure-search#create-security-field) have the schema:
5964

6065
```json
6166
{"name": "group_ids", "type": "Collection(Edm.String)", "filterable": true }
6267
```
6368

6469
`group_ids` is the default field name. If you use a different field name like `my_group_ids`, you can map the field in [index field mapping](../concepts/use-your-data.md#index-field-mapping).
6570

66-
1. Make sure each sensitive document in the index has the value set correctly on this security field to indicate the permitted groups of the document.
67-
1. In [Azure OpenAI Studio](https://oai.azure.com/portal), add your data source. in the [index field mapping](../concepts/use-your-data.md#index-field-mapping) section, you can map zero or one value to the **permitted groups** field, as long as the schema is compatible. If the **Permitted groups** field isn't mapped, document level access won't be enabled.
71+
1. Make sure each sensitive document in the index has this security field value set to the permitted groups of the document.
72+
1. In [Azure OpenAI Studio](https://oai.azure.com/portal), add your data source. in the [index field mapping](../concepts/use-your-data.md#index-field-mapping) section, you can map zero or one value to the **permitted groups** field, as long as the schema is compatible. If the **permitted groups** field isn't mapped, document level access is disabled.
6873

6974
**Azure OpenAI Studio**
7075

71-
Once the Azure AI Search index is connected, your responses in the studio will have document access based on the Microsoft Entra permissions of the logged in user.
76+
Once the Azure AI Search index is connected, your responses in the studio have document access based on the Microsoft Entra permissions of the logged in user.
7277

7378
**Web app**
7479

@@ -105,13 +110,10 @@ When using the API, pass the `filter` parameter in each API request. For example
105110

106111
## Resource configuration
107112

108-
Use the following sections to configure your resources for optimal secure usage. Even if you plan to only secure part of your resources, you still need to follow all the steps below.
113+
Use the following sections to configure your resources for optimal secure usage. Even if you plan to only secure part of your resources, you still need to follow all the steps.
109114

110115
This article describes network settings related to disabling public network for Azure OpenAI resources, Azure AI search resources, and storage accounts. Using selected networks with IP rules is not supported, because the services' IP addresses are dynamic.
111116

112-
> [!TIP]
113-
> You can use the bash script available on [GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/scripts/validate-oyd-vnet.sh) to validate your setup, and determine if all of the requirements listed here are being met.
114-
115117
## Create resource group
116118

117119
Create a resource group, so you can organize all the relevant resources. The resources in the resource group include but are not limited to:
@@ -127,19 +129,18 @@ Create a resource group, so you can organize all the relevant resources. The res
127129

128130
The virtual network has three subnets.
129131

130-
1. The first subnet is used for the private IPs of the three private endpoints.
131-
1. The second subnet is created automatically when you create the virtual network gateway.
132+
1. The first subnet is used for the virtual network gateway.
133+
1. The second subnet is used for the private endpoints for the three key services.
132134
1. The third subnet is empty, and used for Web App outbound virtual network integration.
133135

134136
:::image type="content" source="../media/use-your-data/virtual-network.png" alt-text="A diagram showing the virtual network architecture." lightbox="../media/use-your-data/virtual-network.png":::
135137

136-
Note the Microsoft managed virtual network is created by Microsoft, and you cannot see it. The Microsoft managed virtual network is used by Azure OpenAI to securely access your Azure AI Search.
137138

138139
## Configure Azure OpenAI
139140

140141
### Enabled custom subdomain
141142

142-
If you created the Azure OpenAI via Azure portal, the [custom subdomain](/azure/ai-services/cognitive-services-custom-subdomains) should have been created already. The custom subdomain is required for Microsoft Entra ID based authentication, and private DNS zone.
143+
The [custom subdomain](/azure/ai-services/cognitive-services-custom-subdomains) is required for Microsoft Entra ID based authentication, and private DNS zone. If the Azure OpenAI resource is created using ARM template, the custom subdomain must be specified explicitly.
143144

144145
### Enable managed identity
145146

@@ -179,7 +180,7 @@ To allow access to your Azure OpenAI service from your client machines, like usi
179180

180181
## Configure Azure AI Search
181182

182-
You can use basic pricing tier and higher for the configuration below. It's not necessary, but if you use the S2 pricing tier you will see [additional options](#create-shared-private-link) available for selection.
183+
You can use basic pricing tier and higher for the search resource. It's not necessary, but if you use the S2 pricing tier, [advanced options](#create-shared-private-link) are available.
183184

184185
### Enable managed identity
185186

@@ -188,36 +189,44 @@ To allow your other resources to recognize the Azure AI Search using Microsoft E
188189
:::image type="content" source="../media/use-your-data/outbound-managed-identity-ai-search.png" alt-text="A screenshot showing the managed identity setting for Azure AI Search in the Azure portal." lightbox="../media/use-your-data/outbound-managed-identity-ai-search.png":::
189190

190191
### Enable role-based access control
191-
As Azure OpenAI uses managed identity to access Azure AI Search, you need to enable role-based access control in your Azure AI Search. To do it on Azure portal, select **Both** in the **Keys** tab in the Azure portal.
192+
As Azure OpenAI uses managed identity to access Azure AI Search, you need to enable role-based access control in your Azure AI Search. To do it on Azure portal, select **Both** or **Role-based access control** in the **Keys** tab in the Azure portal.
192193

193194
:::image type="content" source="../media/use-your-data/managed-identity-ai-search.png" alt-text="A screenshot showing the managed identity option for Azure AI search in the Azure portal." lightbox="../media/use-your-data/managed-identity-ai-search.png":::
194195

195-
To enable role-based access control via the REST API, set `authOptions` as `aadOrApiKey`. For more information, see the [Azure AI Search RBAC article](/azure/search/search-security-rbac?tabs=config-svc-rest%2Croles-portal%2Ctest-portal%2Ccustom-role-portal%2Cdisable-keys-portal#configure-role-based-access-for-data-plane).
196-
197-
```json
198-
"disableLocalAuth": false,
199-
"authOptions": {
200-
"aadOrApiKey": {
201-
"aadAuthFailureMode": "http401WithBearerChallenge"
202-
}
203-
}
204-
```
196+
For more information, see the [Azure AI Search RBAC article](/azure/search/search-security-enable-roles).
205197

206198
### Disable public network access
207199

208200
You can disable public network access of your Azure AI Search resource in the Azure portal.
209201

210202
To allow access to your Azure AI Search resource from your client machines, like using Azure OpenAI Studio, you need to create [private endpoint connections](/azure/search/service-create-private-endpoint) that connect to your Azure AI Search resource.
211203

212-
> [!NOTE]
213-
> To allow access to your Azure AI Search resource from Azure OpenAI resource, you need to submit an [application form](https://aka.ms/applyacsvpnaoaioyd). The application will be reviewed in 5 business days and you will be contacted via email about the results. If you are eligible, we will provision the private endpoint in Microsoft managed virtual network, and send a private endpoint connection request to your search service, and you will need to approve the request.
214204

215-
:::image type="content" source="../media/use-your-data/approve-private-endpoint.png" alt-text="A screenshot showing private endpoint approval screen." lightbox="../media/use-your-data/approve-private-endpoint.png":::
205+
### Enable trusted service
206+
207+
You can enable trusted service of your search resource from Azure portal.
208+
209+
Go to your search resource's network tab. With the public network access set to **disabled**, select **Allow Azure services on the trusted services list to access this search service.**
210+
211+
:::image type="content" source="../media/use-your-data/search-trusted-service.png" alt-text="A diagram showing the search trusted service." lightbox="../media/use-your-data/search-trusted-service.png":::
212+
213+
You can also use the REST API to enable trusted service. This example uses the Azure CLI and the `jq` tool.
216214

217-
The private endpoint resource is provisioned in a Microsoft managed tenant, while the linked resource is in your tenant. You can't access the private endpoint resource by just clicking the **private endpoint** link (in blue font) in the **Private access** tab of the **Networking page**. Instead, click elsewhere on the row, then the **Approve** button above should be clickable.
215+
```bash
216+
rid=/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.Search/searchServices/<YOUR-RESOURCE-NAME>
217+
apiVersion=2024-03-01-Preview
218+
#store the resource properties in a variable
219+
az rest --uri "https://management.azure.com$rid?api-version=$apiVersion" > search.json
218220

219-
Learn more about the [manual approval workflow](/azure/private-link/private-endpoint-overview#access-to-a-private-link-resource-using-approval-workflow).
221+
#replace bypass with AzureServices using jq
222+
jq '.properties.networkRuleSet.bypass = "AzureServices"' search.json > search_updated.json
220223

224+
#apply the updated properties to the resource
225+
az rest --uri "https://management.azure.com$rid?api-version=$apiVersion" \
226+
--method PUT \
227+
--body @search_updated.json
228+
229+
```
221230

222231
### Create shared private link
223232

@@ -228,19 +237,15 @@ This section is only applicable for S2 pricing tier search resource, because it
228237

229238
To create shared private link from your search resource connecting to your Azure OpenAI resource, see the [search documentation](/azure/search/search-indexer-howto-access-private). Select **Resource type** as `Microsoft.CognitiveServices/accounts` and **Group ID** as `openai_account`.
230239

231-
With shared private link, [step eight](#data-ingestion-architecture) of the data ingestion architecture diagram is changed from **bypass trusted service** to **private endpoint**.
240+
With shared the private link, [step 8](#data-ingestion-architecture) of the data ingestion architecture diagram is changed from **bypass trusted service** to **shared private link**.
232241

233242
:::image type="content" source="../media/use-your-data/ingestion-architecture-s2.png" alt-text="A diagram showing the process of ingesting data with an S2 search resource." lightbox="../media/use-your-data/ingestion-architecture-s2.png":::
234243

235-
The Azure AI Search shared private link you created is also in a Microsoft managed virtual network, not your virtual network. The difference compared to the other managed private endpoint created [earlier](#disable-public-network-access-1) is that the managed private endpoint `[1]` from Azure OpenAI to Azure Search is provisioned through the [form application](#disable-public-network-access-1), while the managed private endpoint `[2]` from Azure Search to Azure OpenAI is provisioned via Azure portal or REST API of Azure Search.
236-
237-
:::image type="content" source="../media/use-your-data/virtual-network-s2.png" alt-text="A diagram showing the virtual network architecture with S2 search resource." lightbox="../media/use-your-data/virtual-network-s2.png":::
238-
239244
## Configure Storage Account
240245

241246
### Enable trusted service
242247

243-
To allow access to your Storage Account from Azure OpenAI and Azure AI Search, while the Storage Account has no public network access, you need to set up Storage Account to bypass your Azure OpenAI and Azure AI Search as [trusted services based on managed identity](/azure/storage/common/storage-network-security?tabs=azure-portal#trusted-access-based-on-a-managed-identity).
248+
To allow access to your Storage Account from Azure OpenAI and Azure AI Search, you need to set up Storage Account to bypass your Azure OpenAI and Azure AI Search as [trusted services based on managed identity](/azure/storage/common/storage-network-security?tabs=azure-portal#trusted-access-based-on-a-managed-identity).
244249

245250
In the Azure portal, navigate to your storage account networking tab, choose "Selected networks", and then select **Allow Azure services on the trusted services list to access this storage account** and click Save.
246251

7.46 KB
Loading
17.3 KB
Loading
8.9 KB
Loading
100 KB
Loading
32.8 KB
Loading

0 commit comments

Comments
 (0)