You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/search-howto-aad.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,11 @@ Search applications that are built on Azure Cognitive Search can now use the [Mi
20
20
21
21
This article shows you how to configure your client for Azure AD:
22
22
23
-
+ For authentication, you'll create a [managed identity](../active-directory/managed-identities-azure-resources/overview.md) as the security principle.
23
+
+ For authentication, you'll create a [managed identity](../active-directory/managed-identities-azure-resources/overview.md) as the security principle. You could also use a different type of service principal object, but this article uses managed identities because they eliminate the need to manage credentials.
24
24
25
25
+ For authorization, you'll assign an Azure role to the managed identity that grants permissions to run queries or manage indexing jobs.
26
26
27
-
+ Update your client code to call [DefaultAzureCredential()](/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet)
27
+
+ Update your client code to call [DefaultAzureCredential()](/dotnet/api/azure.identity.defaultazurecredential)
28
28
29
29
## Prepare your search service
30
30
@@ -63,7 +63,7 @@ You can also change these settings programatically as described in the [Azure Co
63
63
64
64
## Create a managed identity
65
65
66
-
In this step, create a [managed identity](../active-directory/managed-identities-azure-resources/overview.md) for your client application. You could also use a different type of service principal object, but this article focuses on managed identities because they eliminate the need to manage credentials.
66
+
In this step, create a [managed identity](../active-directory/managed-identities-azure-resources/overview.md) for your client application.
67
67
68
68
1. Sign in to the [Azure portal](https://portal.azure.com).
69
69
@@ -73,13 +73,13 @@ In this step, create a [managed identity](../active-directory/managed-identities
73
73
74
74
1. Give your managed identity a name and select a region. Then, select **Create**.
75
75
76
-
:::image type="content" source="media/search-howto-aad/create-managed-identity.png" alt-text="Screenshot of the create managed identity wizard." border="true" :::
76
+
:::image type="content" source="media/search-howto-aad/create-managed-identity.png" alt-text="Screenshot of the Create Managed Identity wizard." border="true" :::
77
77
78
78
## Assign a role to the managed identity
79
79
80
80
Next, you need to grant your managed identity access to your search service. Azure Cognitive Search has various [built-in roles](search-security-rbac.md#built-in-roles-used-in-search). You can also create a [custom role](search-security-rbac.md#create-a-custom-role).
81
81
82
-
It's a best practice to grant minimum permissions. If your application only needs to handle queries, you should assign the [Search Index Data Reader (preview)](../role-based-access-control/built-in-roles.md#search-index-data-reader) role. Alternatively, if it needs read and write permissions on a search index, you should use the [Search Index Data Contributor (preview)](../role-based-access-control/built-in-roles.md#search-index-data-contributor) role.
82
+
It's a best practice to grant minimum permissions. If your application only needs to handle queries, you should assign the [Search Index Data Reader (preview)](../rolebased-access-control/built-in-roles.md#search-index-data-reader) role. Alternatively, if it needs both read and write access on a search index, you should use the [Search Index Data Contributor (preview)](../role-based-access-control/built-in-roles.md#search-index-data-contributor) role.
83
83
84
84
1. Sign in to the [Azure portal](https://portal.azure.com).
85
85
@@ -146,7 +146,7 @@ The following instructions reference an existing C# sample to demonstrate the co
146
146
> [!NOTE]
147
147
> User-assigned managed identities work only in Azure environments. If you run this code locally, `DefaultAzureCredential` will fall back to authenticating with your credentials. Make sure you've also given yourself the required access to the search service if you plan to run the code locally.
148
148
149
-
The Azure.Identity documentation also has more details on using [Azure AD authentication with the Azure SDK for .NET](/dotnet/api/overview/azure/identity-readme), which gives more details on how `DefaultAzureCredential` works as well as other authentication techniques available. `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
149
+
The Azure.Identity documentation has more details about `DefaultAzureCredential` and using [Azure AD authentication with the Azure SDK for .NET](/dotnet/api/overview/azure/identity-readme). `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
Copy file name to clipboardExpand all lines: articles/search/search-security-rbac.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Azure provides a global [role-based access control (RBAC) authorization system](
20
20
21
21
+ Use new preview roles for data requests, including creating, loading, and querying indexes.
22
22
23
-
Per-user access over search results (sometimes referred to as row-level security or document-level security) is not supported. As a workaround, [create security filters](search-security-trimming-for-azure-search.md) that trim results by user identity, removing documents for which the requestor should not have access.
23
+
Per-user access over search results (sometimes referred to as row-level security or document-level security) isn't supported. As a workaround, [create security filters](search-security-trimming-for-azure-search.md) that trim results by user identity, removing documents for which the requestor shouldn't have access.
24
24
25
25
## Built-in roles used in Search
26
26
@@ -30,8 +30,8 @@ Built-in roles include generally available and preview roles. If these roles are
30
30
| ---- | ---------------------------- |
31
31
|[Owner](../role-based-access-control/built-in-roles.md#owner)| (Generally available) Full access to the search resource, including the ability to assign Azure roles. Subscription administrators are members by default.</br></br> (Preview) This role has the same access as the Search Service Contributor role on the data plane. It includes access to all data plane actions except the ability to query the search index or index documents. |
32
32
|[Contributor](../role-based-access-control/built-in-roles.md#contributor)| (Generally available) Same level of access as Owner, minus the ability to assign roles or change authorization options. </br></br> (Preview) This role has the same access as the Search Service Contributor role on the data plane. It includes access to all data plane actions except the ability to query the search index or index documents. |
33
-
|[Reader](../role-based-access-control/built-in-roles.md#reader)| (Generally available) Limited access to partial service information. In the portal, the Reader role can access information in the service Overview page, in the Essentials section and under the Monitoring tab. All other tabs and pages are off limits. </br></br>This role has access to service information: service name, resource group, service status, location, subscription name and ID, tags, URL, pricing tier, replicas, partitions, and search units. This role also has access to service metrics: search latency, percentage of throttled requests, average queries per second. </br></br>There is no access to API keys, role assignments, content (indexes or synonym maps), or content metrics (storage consumed, number of objects). |
34
-
| [Search Service Contributor](../role-based-access-control/built-in-roles.md#search-service-contributor) | (Generally available) This role is identical to the Contributor role and applies to control plane operations. </br></br>(Preview) When you enable the RBAC preview for the data plane, this role also provides full access to all data plane actions on indexes, synonym maps, indexers, data sources, and skillsets as defined by [`Microsoft.Search/searchServices/*`](../role-based-access-control/resource-provider-operations.md#microsoftsearch). This role does not give you access to query search indexes or index documents. This role is for search service administrators who need to manage the search service and its objects, but without the ability to view or access object data. </br></br>Like Contributor, members of this role cannot make or manage role assignments or change authorization options. To use the preview capabilities of this role, your service must have the preview feature enabled, as described in this article. |
33
+
|[Reader](../role-based-access-control/built-in-roles.md#reader)| (Generally available) Limited access to partial service information. In the portal, the Reader role can access information in the service Overview page, in the Essentials section and under the Monitoring tab. All other tabs and pages are off limits. </br></br>This role has access to service information: service name, resource group, service status, location, subscription name and ID, tags, URL, pricing tier, replicas, partitions, and search units. This role also has access to service metrics: search latency, percentage of throttled requests, average queries per second. </br></br>This role doesn't allow access to API keys, role assignments, content (indexes or synonym maps), or content metrics (storage consumed, number of objects). |
34
+
| [Search Service Contributor](../role-based-access-control/built-in-roles.md#search-service-contributor) | (Generally available) This role is identical to the Contributor role and applies to control plane operations. </br></br>(Preview) When you enable the RBAC preview for the data plane, this role also provides full access to all data plane actions on indexes, synonym maps, indexers, data sources, and skillsets as defined by [`Microsoft.Search/searchServices/*`](../role-based-access-control/resource-provider-operations.md#microsoftsearch). This role does not give you access to query search indexes or index documents. This role is for search service administrators who need to manage the search service and its objects, but without the ability to view or access object data. </br></br>Like Contributor, members of this role can't make or manage role assignments or change authorization options. To use the preview capabilities of this role, your service must have the preview feature enabled, as described in this article. |
35
35
|[Search Index Data Contributor](../role-based-access-control/built-in-roles.md#search-index-data-contributor)| (Preview) Provides full data plane access to content in all indexes on the search service. This role is for developers or index owners who need to import, refresh, or query the documents collection of an index. |
36
36
|[Search Index Data Reader](../role-based-access-control/built-in-roles.md#search-index-data-reader)| (Preview) Provides read-only data plane access to search indexes on the search service. This role is for apps and users who run queries. |
37
37
@@ -101,7 +101,7 @@ If you can't save your selection, or if you get "API access control failed to up
101
101
102
102
Use the Management REST API version 2021-04-01-Preview, [Create or Update Service](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update), to configure your service.
103
103
104
-
If you are using Postman or another web testing tool, see the Tip below for help on setting up the request.
104
+
If you're using Postman or another web testing tool, see the Tip below for help on setting up the request.
105
105
106
106
1. Under "properties", set ["AuthOptions"](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update#dataplaneauthoptions) to "aadOrApiKey".
107
107
@@ -125,7 +125,7 @@ If you are using Postman or another web testing tool, see the Tip below for help
125
125
}
126
126
```
127
127
128
-
1. [Assign roles](#step-3-assign-roles) on the service and verify they are working correctly against the data plane.
128
+
1. [Assign roles](#step-3-assign-roles) on the service and verify they're working correctly against the data plane.
129
129
130
130
> [!TIP]
131
131
> Management REST API calls are authenticated through Azure Active Directory. For guidance on setting up a security principal and a request, see this blog post [Azure REST APIs with Postman (2021)](https://blog.jongallant.com/2021/02/azure-rest-apis-postman-2021/). The previous example was tested using the instructions and Postman collection provided in the blog post.
@@ -209,7 +209,7 @@ Recall that you can only scope access to top-level resources, such as indexes, s
209
209
210
210
1. On the Overview page, select the **Indexes** tab:
211
211
212
-
+ Members of Search Index Data Reader can use Search Explorer to query the index. You can use any API version to check for access. You should be able to issue queries and view results, but you should not be able to view the index definition.
212
+
+ Members of Search Index Data Reader can use Search Explorer to query the index. You can use any API version to check for access. You should be able to issue queries and view results, but you shouldn't be able to view the index definition.
213
213
214
214
+ Members of Search Index Data Contributor can select **New Index** to create a new index. Saving a new index will verify write access on the service.
215
215
@@ -227,7 +227,7 @@ For more information on how to acquire a token for a specific environment, see [
227
227
228
228
The Azure SDK for .NET supports an authorization header in the [NuGet Gallery | Azure.Search.Documents 11.4.0-beta.2](https://www.nuget.org/packages/Azure.Search.Documents/11.4.0-beta.2) package.
229
229
230
-
Additional configuration is required to register an application with Azure Active Directory, and to obtain and pass authorization tokens.
230
+
Configuration is required to register an application with Azure Active Directory, and to obtain and pass authorization tokens:
231
231
232
232
+ When obtaining the OAuth token, the scope is "https://search.azure.com/.default". The SDK requires the audience to be "https://search.azure.com". The ".default" is an Azure AD convention.
233
233
@@ -240,7 +240,7 @@ var tokenCredential = new ClientSecretCredential(aadTenantId, aadClientId, aadS
More details about using [AAD authentication with the Azure SDK for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) are available in the SDK's GitHub repo.
243
+
More details about using [Azure AD authentication with the Azure SDK for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) are available in the SDK's GitHub repo.
244
244
245
245
> [!NOTE]
246
246
> If you get a 403 error, verify that your search service is enrolled in the preview program and that your service is configured for preview role assignments.
@@ -395,7 +395,7 @@ The PowerShell example shows the JSON syntax for creating a custom role that's a
395
395
396
396
## Disable API key authentication
397
397
398
-
API keys cannot be deleted, but they can be disabled on your service. If you are using the Search Service Contributor, Search Index Data Contributor, and Search Index Data Reader preview roles and Azure AD authentication, you can disable API keys, causing the search service to refuse all data-related requests that pass an API key in the header for content-related requests.
398
+
API keys can't be deleted, but they can be disabled on your service. If you're using the Search Service Contributor, Search Index Data Contributor, and Search Index Data Reader preview roles and Azure AD authentication, you can disable API keys, causing the search service to refuse all data-related requests that pass an API key in the header for content-related requests.
399
399
400
400
To disable [key-based authentication](search-security-api-keys.md), use the Management REST API version 2021-04-01-Preview and send two consecutive requests for [Update Service](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update).
401
401
@@ -435,9 +435,9 @@ Owner or Contributor permissions are required to disable features. Use Postman o
435
435
}
436
436
```
437
437
438
-
You cannot combine steps one and two. In step one, "disableLocalAuth" must be false to meet the requirements for setting "AuthOptions", whereas step two changes that value to true.
438
+
You can't combine steps one and two. In step one, "disableLocalAuth" must be false to meet the requirements for setting "AuthOptions", whereas step two changes that value to true.
439
439
440
-
To re-enable key authentication, rerun the last request, setting "disableLocalAuth" to false. The search service will resume acceptance of API keys on the request automatically (assuming they are specified).
440
+
To re-enable key authentication, rerun the last request, setting "disableLocalAuth" to false. The search service will resume acceptance of API keys on the request automatically (assuming they're specified).
441
441
442
442
> [!TIP]
443
443
> Management REST API calls are authenticated through Azure Active Directory. For guidance on setting up a security principal and a request, see this blog post [Azure REST APIs with Postman (2021)](https://blog.jongallant.com/2021/02/azure-rest-apis-postman-2021/). The previous example was tested using the instructions and Postman collection provided in the blog post.
@@ -463,4 +463,4 @@ To enable a Conditional Access policy for Azure Cognitive Search, follow the bel
463
463
1. Save the policy.
464
464
465
465
> [!IMPORTANT]
466
-
> If your search service has a managed identity assigned to it, the specific search service will show up as a cloud app that can be included or excluded as part of the Conditional Access policy. Conditional Access policies cannot be enforced on a specific search service. Instead make sure you select the general **Azure Cognitive Search** cloud app.
466
+
> If your search service has a managed identity assigned to it, the specific search service will show up as a cloud app that can be included or excluded as part of the Conditional Access policy. Conditional Access policies can't be enforced on a specific search service. Instead make sure you select the general **Azure Cognitive Search** cloud app.
0 commit comments