Skip to content

Commit 657e870

Browse files
authored
Merge pull request #277025 from HeidiSteen/heidist-june3
[azure search] Moved enable roles to standalone article
2 parents f86f71b + bbd2c72 commit 657e870

13 files changed

+373
-279
lines changed

articles/search/TOC.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,10 @@
418418
href: hybrid-search-how-to-query.md
419419
- name: Security
420420
items:
421+
- name: Enable role-based access control
422+
href: search-security-enable-roles.md
423+
- name: Configure a managed identity
424+
href: search-howto-managed-identities-data-sources.md
421425
- name: Inbound connections
422426
items:
423427
- name: Connect using API keys
@@ -438,8 +442,6 @@
438442
href: search-indexer-howto-access-trusted-service-exception.md
439443
- name: Connect using a managed identity
440444
items:
441-
- name: Any Azure resource
442-
href: search-howto-managed-identities-data-sources.md
443445
- name: Azure Storage
444446
href: search-howto-managed-identities-storage.md
445447
- name: Azure Cosmos DB
@@ -472,16 +474,16 @@
472474
href: search-api-versions.md
473475
- name: Preview features
474476
href: search-api-preview.md
475-
- name: Handle concurrent updates
476-
href: search-howto-concurrency.md
477-
- name: Develop in .NET
478-
href: search-howto-dotnet-sdk.md
477+
- name: Upgrade the REST API
478+
href: search-api-migration.md
479479
- name: Upgrade .NET libraries
480480
href: search-dotnet-sdk-migration-version-11.md
481+
- name: Develop in .NET
482+
href: search-howto-dotnet-sdk.md
481483
- name: Manage with Azure SDKs
482484
href: search-dotnet-mgmt-sdk-migration.md
483-
- name: Upgrade the REST API
484-
href: search-api-migration.md
485+
- name: Handle concurrent updates
486+
href: search-howto-concurrency.md
485487
- name: Monitoring and performance
486488
items:
487489
- name: Monitor
55.6 KB
Loading

articles/search/search-get-started-portal-import-vectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ If you're starting with the free service, you're limited to three indexes, three
6161

6262
We recommend role assignments for search service connections to other resources.
6363

64-
1. On Azure AI Search, [enable role-based access](search-security-rbac.md#enable-role-based-access-for-data-plane-operations).
64+
1. On Azure AI Search, [enable role-based access](search-security-enable-roles.md).
6565

6666
1. Configure your search service to [use a system or user-assigned managed identity](search-howto-managed-identities-data-sources.md#create-a-system-managed-identity).
6767

articles/search/search-how-to-index-onelake-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This article uses the REST APIs to illustrate each step.
4242
+ [Use data pipelines](/fabric/data-engineering/tutorial-lakehouse-data-ingestion) from [Microsoft Fabric](https://fabric.microsoft.com/)
4343
+ [Add shortcuts](/fabric/onelake/create-onelake-shortcut) from external data sources like [Amazon S3](/fabric/onelake/create-s3-shortcut) or [Google Cloud Storage](/fabric/onelake/create-gcs-shortcut).
4444

45-
+ A search service configured for either a [system managed identity](search-howto-managed-identities-data-sources.md#create-a-system-managed-identity) or [user-assigned assigned managed identity](search-howto-managed-identities-data-sources.md#create-a-user-assigned-managed-identity-preview).
45+
+ A search service configured for either a [system managed identity](search-howto-managed-identities-data-sources.md#create-a-system-managed-identity) or [user-assigned assigned managed identity](search-howto-managed-identities-data-sources.md#create-a-user-assigned-managed-identity).
4646

4747
+ A Contributor role assignment in the Microsoft Fabric workspace where the lakehouse is located. Steps are outlined in the [Grant permissions](#assign-service-permissions) section of this article.
4848

articles/search/search-howto-aad.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ All calls to the Management REST API are authenticated through Microsoft Entra I
6464
GET https://management.azure.com/subscriptions/{{subscriptionId}}/providers/Microsoft.Search/searchServices?api-version=2023-11-01
6565
```
6666

67-
1. Use PATCH to update service configuration. The following modifications enable both keys and role-based access. If you want a roles-only configuration, see [Disable API keys](search-security-rbac.md#disable-api-key-authentication).
67+
1. Use PATCH to update service configuration. The following modifications enable both keys and role-based access. If you want a roles-only configuration, see [Disable API keys](search-security-enable-roles.md#disable-api-key-authentication).
6868

6969
Under "properties", set ["authOptions"](/rest/api/searchmanagement/services/create-or-update#dataplaneauthoptions) to "aadOrApiKey". The "disableLocalAuth" property must be false to set "authOptions".
7070

articles/search/search-howto-managed-identities-data-sources.md

Lines changed: 70 additions & 69 deletions
Large diffs are not rendered by default.

articles/search/search-howto-managed-identities-storage.md

Lines changed: 48 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -8,141 +8,117 @@ manager: nitinme
88

99
ms.service: cognitive-search
1010
ms.topic: how-to
11-
ms.date: 02/22/2024
11+
ms.date: 06/03/2024
1212
ms.custom:
1313
- subject-rbac-steps
1414
- ignite-2023
1515
---
1616

17-
# Set up an indexer connection to Azure Storage using a managed identity
17+
# Connect to Azure Storage using a managed identity (Azure AI Search)
1818

19-
This article explains how to set up an indexer connection to an Azure Storage account using a managed identity instead of providing credentials in the connection string.
19+
This article explains how to configure a search service connection to an Azure Storage account using a managed identity instead of providing credentials in the connection string.
2020

21-
You can use a system-assigned managed identity or a user-assigned managed identity (preview). Managed identities are Microsoft Entra logins and require Azure role assignments to access data in Azure Storage.
21+
You can use a system-assigned managed identity or a user-assigned managed identity. Managed identities are Microsoft Entra logins and require role assignments for access to Azure Storage.
22+
23+
## Prerequisites
24+
25+
+ Azure AI Search, Basic tier or higher, with a [managed identity](search-howto-managed-identities-data-sources.md).
2226

2327
> [!NOTE]
2428
> If storage is network-protected and in the same region as your search service, you must use a system-assigned managed identity and either one of the following network options: [connect as a trusted service](search-indexer-howto-access-trusted-service-exception.md), or [connect using the resource instance rule](../storage/common/storage-network-security.md#grant-access-from-azure-resource-instances).
2529
26-
## Prerequisites
27-
28-
* [Create a managed identity](search-howto-managed-identities-data-sources.md) for your search service.
30+
## Create a role assignment in Azure Storage
2931

30-
* [Assign a role](search-howto-managed-identities-data-sources.md#assign-a-role) in Azure Storage:
32+
1. Sign in to Azure portal and find your storage account.
33+
1. Select **Access control (IAM)**.
34+
1. Select **Add** and then select **Role assignment**.
35+
1. From the list of job function roles, select the roles needed for your search service:
3136

32-
* Choose **Storage Blob Data Reader** for data read access in Blob Storage and ADLS Gen2.
37+
| Task | Role assignment |
38+
|------|-----------------|
39+
| Blob indexing using an indexer | Add **Storage Blob Data Reader** |
40+
| ADLS Gen2 indexing using an indexer | Add **Storage Blob Data Reader** |
41+
| Table indexing using an indexer | Add **Reader and Data Access** |
42+
| File indexing using an indexer | Add **Reader and Data Access** |
43+
| Write to a knowledge store | Add **Storage Blob DataContributor** for object and file projections, and **Reader and Data Access** for table projections. |
44+
| Write to an enrichment cache | Add **Storage Blob Data Contributor** |
45+
| Save debug session state | Add **Storage Blob Data Contributor** |
3346

34-
* Choose **Reader and Data** for data read access in Table Storage and File Storage.
47+
1. Select **Next**.
48+
1. Select **Managed identity** and then select **Members**.
49+
1. Filter by system-assigned managed identities or user-assigned managed identities. If you don't have a managed identity, see [Configure search to use a managed identity](search-howto-managed-identities-data-sources.md). If you already set one up but it's not available, give it a few minutes.
50+
1. Select the identity and save the role assignment.
3551

36-
* You should be familiar with [indexer concepts](search-indexer-overview.md) and [configuration](search-howto-indexing-azure-blob-storage.md).
52+
## Specify a managed identity in a connection string
3753

38-
> [!TIP]
39-
> For a code example in C#, see [Index Data Lake Gen2 using Microsoft Entra ID](https://github.com/Azure-Samples/azure-search-dotnet-utilities/blob/main/data-lake-gen2-acl-indexing/README.md) on GitHub.
54+
Once you have a role assignment, you can set up a connection to Azure Storage that operates under that role.
4055

41-
## Create the data source
56+
Indexers use a data source object for connections to an external data source. This section explains how to specify a system-assigned managed identity or a user-assigned managed identity on a data source connection string. You can find more [connection string examples](search-howto-managed-identities-data-sources.md#connection-string-examples) in the managed identity article.
4257

43-
Create the data source and provide either a system-assigned managed identity or a user-assigned managed identity (preview).
58+
> [!TIP]
59+
> You can create a data source connection to Azure Storage in the Azure portal, specifying either a system or user-assigned managed identity, and then view the JSON definition to see how the connection string is formulated.
4460
4561
### System-assigned managed identity
4662

47-
The [REST API](/rest/api/searchservice/create-data-source), Azure portal, and the [.NET SDK](/dotnet/api/azure.search.documents.indexes.models.searchindexerdatasourceconnection) support using a system-assigned managed identity.
63+
You must have a [system-assigned managed identity already configured](search-howto-managed-identities-data-sources.md), and it must have a role-assignment on Azure Storage.
4864

49-
When you're connecting with a system-assigned managed identity, the only change to the data source definition is the format of the "credentials" property. Provide a ResourceId that has no account key or password. The ResourceId must include the subscription ID of the storage account, the resource group of the storage account, and the storage account name.
65+
For connections made using a system-assigned managed identity, the only change to the [data source definition](/rest/api/searchservice/create-data-source) is the format of the `credentials` property.
5066

51-
Here's an example of how to create a data source to index data from a storage account using the [Create Data Source](/rest/api/searchservice/create-data-source) REST API and a managed identity connection string. The managed identity connection string format is the same for the REST API, .NET SDK, and the Azure portal.
67+
Provide a `ResourceId` that has no account key or password. The `ResourceId` must include the subscription ID of the storage account, the resource group of the storage account, and the storage account name.
5268

5369
```http
5470
POST https://[service name].search.windows.net/datasources?api-version=2023-11-01
55-
Content-Type: application/json
56-
api-key: [admin key]
5771
5872
{
5973
"name" : "blob-datasource",
6074
"type" : "azureblob",
6175
"credentials" : {
62-
"connectionString" : "ResourceId=/subscriptions/[subscription ID]/resourceGroups/[resource group name]/providers/Microsoft.Storage/storageAccounts/[storage account name]/;"
76+
"connectionString" : "ResourceId=/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MY-DEMO-RESOURCE-GROUP/providers/Microsoft.Storage/storageAccounts/MY-DEMO-STORAGE-ACCOUNT/;"
6377
},
6478
"container" : {
6579
"name" : "my-container", "query" : "<optional-virtual-directory-name>"
6680
}
6781
}
6882
```
6983

70-
### User-assigned managed identity (preview)
84+
### User-assigned managed identity
7185

72-
The 2021-04-30-preview REST API supports connections based on a user-assigned managed identity. When you're connecting with a user-assigned managed identity, there are two changes to the data source definition:
86+
You must have a [user-assigned managed identity already configured](search-howto-managed-identities-data-sources.md) and associated with your search service, and the identity must have a role-assignment on Azure Storage.
7387

74-
* First, the format of the "credentials" property is a ResourceId that has no account key or password. The ResourceId must include the subscription ID of the storage account, the resource group of the storage account, and the storage account name. This format is the same format as the system-assigned managed identity.
88+
Connections made through user-assigned managed identities use the same credentials as a system-assigned managed identity, plus an extra identity property that contains the collection of user-assigned managed identities. Only one user-assigned managed identity should be provided when creating the data source. Set `userAssignedIdentity` to the user-assigned managed identity..
7589

76-
* Second, add an "identity" property that contains the collection of user-assigned managed identities. Only one user-assigned managed identity should be provided when creating the data source. Set it to type "userAssignedIdentities".
90+
Provide a `ResourceId` that has no account key or password. The `ResourceId` must include the subscription ID of the storage account, the resource group of the storage account, and the storage account name.
7791

78-
Here's an example of how to create an indexer data source object using the [preview Create or Update Data Source](/rest/api/searchservice/preview-api/create-or-update-data-source) REST API:
92+
Provide an `identity` using the syntax shown in the following example.
7993

8094
```http
81-
POST https://[service name].search.windows.net/datasources?api-version=2021-04-30-preview
82-
Content-Type: application/json
83-
api-key: [admin key]
95+
POST https://[service name].search.windows.net/datasources?api-version=2023-11-01
8496
8597
{
8698
"name" : "blob-datasource",
8799
"type" : "azureblob",
88100
"credentials" : {
89-
"connectionString" : "ResourceId=/subscriptions/[subscription ID]/resourceGroups/[resource group name]/providers/Microsoft.Storage/storageAccounts/[storage account name]/;"
101+
"connectionString" : "ResourceId=/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MY-DEMO-RESOURCE-GROUP/providers/Microsoft.Storage/storageAccounts/MY-DEMO-STORAGE-ACCOUNT/;"
90102
},
91103
"container" : {
92104
"name" : "my-container", "query" : "<optional-virtual-directory-name>"
93105
},
94106
"identity" : {
95107
"@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
96-
"userAssignedIdentity" : "/subscriptions/[subscription ID]/resourcegroups/[resource group name]/providers/Microsoft.ManagedIdentity/userAssignedIdentities/[managed identity name]"
108+
"userAssignedIdentity" : "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/MY-DEMO-RESOURCE-GROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MY-DEMO-USER-MANAGED-IDENTITY"
97109
}
98110
}
99111
```
100112

101-
## Create the index
102-
103-
The index specifies the fields in a document, attributes, and other constructs that shape the search experience.
104-
105-
Here's a [Create Index](/rest/api/searchservice/create-index) REST API call with a searchable `content` field to store the text extracted from blobs:
106-
107-
```http
108-
POST https://[service name].search.windows.net/indexes?api-version=2023-11-01
109-
Content-Type: application/json
110-
api-key: [admin key]
111-
112-
{
113-
"name" : "my-target-index",
114-
"fields": [
115-
{ "name": "id", "type": "Edm.String", "key": true, "searchable": false },
116-
{ "name": "content", "type": "Edm.String", "searchable": true, "filterable": false, "sortable": false, "facetable": false }
117-
]
118-
}
119-
```
120-
121-
## Create the indexer
122-
123-
An indexer connects a data source with a target search index, and provides a schedule to automate the data refresh. Once the index and data source have been created, you're ready to create and run the indexer. If the indexer is successful, the connection syntax and role assignments are valid.
124-
125-
Here's a [Create Indexer](/rest/api/searchservice/create-indexer) REST API call with a blob indexer definition. The indexer runs when you submit the request.
126-
127-
```http
128-
POST https://[service name].search.windows.net/indexers?api-version=2023-11-01
129-
Content-Type: application/json
130-
api-key: [admin key]
131-
132-
{
133-
"name" : "blob-indexer",
134-
"dataSourceName" : "blob-datasource",
135-
"targetIndexName" : "my-target-index"
136-
}
137-
```
113+
Connection information and permissions on the remote service are validated at run time during indexer execution. If the indexer is successful, the connection syntax and role assignments are valid. For more information, see [Run or reset indexers, skills, or documents](search-howto-run-reset-indexers.md).
138114

139115
## Accessing network secured data in storage accounts
140116

141117
Azure storage accounts can be further secured using firewalls and virtual networks. If you want to index content from a storage account that is secured using a firewall or virtual network, see [Make indexer connections to Azure Storage as a trusted service](search-indexer-howto-access-trusted-service-exception.md).
142118

143119
## See also
144120

145-
* [Azure blob indexer](search-howto-indexing-azure-blob-storage.md)
146-
* [ADLS Gen2 indexer](search-howto-index-azure-data-lake-storage.md)
147-
* [Azure table indexer](search-howto-indexing-azure-tables.md)
148-
* [C# Example: Index Data Lake Gen2 using Microsoft Entra ID (GitHub)](https://github.com/Azure-Samples/azure-search-dotnet-utilities/blob/main/data-lake-gen2-acl-indexing/README.md)
121+
+ [Azure blob indexer](search-howto-indexing-azure-blob-storage.md)
122+
+ [ADLS Gen2 indexer](search-howto-index-azure-data-lake-storage.md)
123+
+ [Azure table indexer](search-howto-indexing-azure-tables.md)
124+
+ [C# Example: Index Data Lake Gen2 using Microsoft Entra ID (GitHub)](https://github.com/Azure-Samples/azure-search-dotnet-utilities/blob/main/data-lake-gen2-acl-indexing/README.md)

articles/search/search-manage-rest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ In this step, configure your search service to recognize an **authorization** he
184184

185185
To use role-based access control for data plane operations, set `authOptions` to `aadOrApiKey` and then send the request.
186186

187-
To use role-based access control exclusively, [turn off API key authentication](search-security-rbac.md#disable-api-key-authentication) by following up with a second request, this time setting `disableLocalAuth` to true.
187+
To use role-based access control exclusively, [turn off API key authentication](search-security-enable-roles.md#disable-api-key-authentication) by following up with a second request, this time setting `disableLocalAuth` to true.
188188

189189
```http
190190
PATCH https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2023-11-01 HTTP/1.1

0 commit comments

Comments
 (0)