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-security-rbac.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ author: HeidiSteen
8
8
ms.author: heidist
9
9
ms.service: cognitive-search
10
10
ms.topic: how-to
11
-
ms.date: 01/12/2023
11
+
ms.date: 01/26/2023
12
12
ms.custom: subject-rbac-steps, references_regions
13
13
---
14
14
@@ -52,11 +52,19 @@ Built-in roles include generally available and preview roles. If these roles are
52
52
53
53
+ In rare cases where requests originate from a high number of different service principals, all targeting different service resources (indexes, indexers, etc.), it's possible for the authorization checks to result in throttling. Throttling would only happen if hundreds of unique combinations of search service resource and service principal were used within a second.
54
54
55
+
+ Role-based access control is supported in Azure portal and in the following search clients:
+[azure.search.documents (Azure SDK for .NET) version 11.4](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/CHANGELOG.md)
59
+
+[azure.search.documents (Azure SDK for Python) version 11.3](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/CHANGELOG.md)
60
+
+[azure-search-documents (Azure SDK for Java) beta versions of 11.5 and 11.6](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/CHANGELOG.md),
61
+
+[@azure/search-documents (Azure SDK for JavaScript), version 11.3 (see change log)](https://www.npmjs.com/package/@azure/search-documents?activeTab=explore).
62
+
55
63
## Configure role-based access for data plane
56
64
57
65
**Applies to:** Search Index Data Contributor, Search Index Data Reader, Search Service Contributor
58
66
59
-
In this step, configure your search service to recognize an **authorization** header on data requests that provide an OAuth2 access token.
67
+
In this step, configure your search service to recognize an **authorization** header on data requests that provide an OAuth2 access token.
60
68
61
69
### [**Azure portal**](#tab/config-svc-portal)
62
70
@@ -71,9 +79,11 @@ In this step, configure your search service to recognize an **authorization** he
71
79
| Option | Status | Description |
72
80
|--------|--------|-------------|
73
81
| API Key | Generally available (default) | Requires an [admin or query API keys](search-security-api-keys.md) on the request header for authorization. No roles are used. |
74
-
| Role-based access control | Preview | Requires membership in a role assignment to complete the task, described in the next step. It also requires an authorization header. Choosing this option limits you to clients that support the [2021-04-30-preview REST API](/rest/api/searchservice/index-preview). |
82
+
| Role-based access control | Preview | Requires membership in a role assignment to complete the task, described in the next step. It also requires an authorization header. |
75
83
| Both | Preview | Requests are valid using either an API key or role-based access control. |
76
84
85
+
Once you make a request, it can take a few minutes for the change to take effect.
86
+
77
87
All network calls for search service operations and content will respect the option you select: API keys, bearer token, or either one if you select **Both**.
78
88
79
89
When you enable role-based access control in the portal, the failure mode will be "http401WithBearerChallenge" if authorization fails. Use the Management REST API to update the service if you want to use "http403" instead.
@@ -82,7 +92,7 @@ When you enable role-based access control in the portal, the failure mode will b
82
92
83
93
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.
84
94
85
-
If you're using Postman or another REST client, see [Manage Azure Cognitive Search using REST](search-manage-rest.md) for help with setting up the client.
95
+
All calls to the Management REST API are authenticated through Azure Active Directory, with Contributor or Owner permissions. For help setting up authenticated requests in Postman, see [Manage Azure Cognitive Search using REST](search-manage-rest.md).
86
96
87
97
1. Under "properties", set ["AuthOptions"](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update#dataplaneauthoptions) to "aadOrApiKey".
88
98
@@ -278,10 +288,10 @@ This approach assumes Postman as the REST client and uses a Postman collection a
278
288
279
289
1. Save the collection.
280
290
281
-
1. Send a request that uses the variables you've specified. For the "Search Index Data Reader" role, you can query an index (remember to provide a valid search service name on the URI):
291
+
1. Send a request that uses the variables you've specified. For the "Search Index Data Reader" role, you can query an index (remember to provide a valid search service name on the URI). You can use any [supported API version](/rest/api/searchservice/search-service-api-versions).
282
292
283
293
```http
284
-
POST https://<service-name>.search.windows.net/indexes/hotels-quickstart/docs/search?api-version=2020-06-20
294
+
POST https://<service-name>.search.windows.net/indexes/hotels-quickstart/docs/search?api-version=2020-06-30
285
295
{
286
296
"queryType": "simple",
287
297
"search": "motel",
@@ -297,7 +307,7 @@ For more information on how to acquire a token for a specific environment, see [
297
307
298
308
See [Authorize access to a search app using Azure Active Directory](/search-howto-aad.md) for instructions that create an identity for your client app, assign a role, and call [DefaultAzureCredential()](/dotnet/api/azure.identity.defaultazurecredential).
299
309
300
-
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. Configuration is required to register an application with Azure Active Directory, and to obtain and pass authorization tokens:
310
+
The Azure SDK for .NET supports an authorization header in the [NuGet Gallery | Azure.Search.Documents 11.4.0](https://www.nuget.org/packages/Azure.Search.Documents/11.4.0) package. Configuration is required to register an application with Azure Active Directory, and to obtain and pass authorization tokens:
301
311
302
312
+ 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.
0 commit comments