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-api-keys.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,10 @@ ms.date: 1/16/2025
15
15
16
16
# Connect to Azure AI Search using keys
17
17
18
-
Azure AI Search offers both keyless and key-based authentication for connections to your search service. An API key is a unique string composed of 52 randomly generated numbers and letters. In your source code, you can specify it as an [environment variable](/azure/ai-services/cognitive-services-environment-variables) or as an app setting in your project, and then reference the variable on the request. A request made to a search service endpoint is accepted if both the request and the API key are valid.
18
+
Azure AI Search supports both keyless and key-based authentication for connections to your search service. An API key is a unique string composed of 52 randomly generated numbers and letters. In your source code, you can specify it as an [environment variable](/azure/ai-services/cognitive-services-environment-variables) or as an app setting in your project, and then reference the variable on the request. A request made to a search service endpoint is accepted if both the request and the API key are valid.
19
19
20
20
> [!IMPORTANT]
21
-
> When you create a search service, key-based authentication is the default, but it's not the most secure option. We recommend that you replace it with [role-based access](search-security-enable-roles.md), which eliminates the need for hardcoded keys in your codebase.
21
+
> When you create a search service, key-based authentication is the default, but it's not the most secure option. We recommend that you replace it with [role-based access](search-security-enable-roles.md).
Copy file name to clipboardExpand all lines: articles/search/search-security-enable-roles.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,21 @@
2
2
title: Enable role-based access control
3
3
titleSuffix: Azure AI Search
4
4
description: Enable or disable role-based access control for token authentication using Microsoft Entra ID on Azure AI Search.
5
-
6
5
manager: nitinme
7
6
author: HeidiSteen
8
7
ms.author: heidist
9
8
ms.service: azure-ai-search
10
9
ms.topic: how-to
11
-
ms.date: 10/30/2024
12
-
10
+
ms.date: 1/16/2025
11
+
#customer intent: As a developer, I want to enable role-based access control for token authentication using Microsoft Entra ID on Azure AI Search so that I can secure my search service.
13
12
---
14
13
15
14
# Enable or disable role-based access control in Azure AI Search
16
15
17
-
Azure AI Search uses [key-based authentication](search-security-api-keys.md) by default, but it fully supports Microsoft Entra ID authentication and authorization for all control plane and data plane operations through Azure role-based access control (RBAC).
16
+
Azure AI Search supports both keyless and [key-based authentication](search-security-api-keys.md) for for all control plane and data plane operations. You can use Microsoft Entra ID authentication and authorization for all control plane and data plane operations through Azure role-based access control (RBAC).
17
+
18
+
> [!IMPORTANT]
19
+
> When you create a search service, key-based authentication is the default, but it's not the most secure option. We recommend that you replace it with role-based access as described in this article.
18
20
19
21
Before you can assign roles for authorized data plane access to Azure AI Search, you must enable role-based access control on your search service. Roles for service administration (control plane) are built in and can't be enabled or disabled.
20
22
@@ -37,18 +39,18 @@ The default failure mode for unauthorized requests is `http401WithBearerChalleng
37
39
38
40
### [**Azure portal**](#tab/config-svc-portal)
39
41
40
-
1. Sign in to the [Azure portal](https://portal.azure.com) and open the search service page.
42
+
1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your search service.
41
43
42
44
1. Select **Settings** and then select **Keys** in the left navigation pane.
43
45
44
46
:::image type="content" source="media/search-security-rbac/search-security-enable-roles.png" lightbox="media/search-security-rbac/search-security-enable-roles.png" alt-text="Screenshot of the keys page with authentication options." border="true":::
45
47
46
-
1. Choose **Role-based control** or**Both** if you're currently using keys and need time to transition clients to role-based access control.
48
+
1. Choose **Role-based control**. Only choose**Both** if you're currently using keys and need time to transition clients to role-based access control.
47
49
48
50
| Option | Description |
49
51
|--------|--------------|
50
-
| API Key |(default). Requires [API keys](search-security-api-keys.md) on the request header for authorization. |
51
-
| Role-based access control | Requires membership in a role assignment to complete the task. It also requires an authorization header on the request. |
52
+
| API Key (default)| Requires [API keys](search-security-api-keys.md) on the request header for authorization. |
53
+
| Role-based access control (recommended) | Requires membership in a role assignment to complete the task. It also requires an authorization header on the request. |
52
54
| Both | Requests are valid using either an API key or role-based access control, but if you provide both in the same request, the API key is used. |
53
55
54
56
1. As an administrator, if you choose a roles-only approach, [assign data plane roles](search-security-rbac.md) to your user account to restore full administrative access over data plane operations in the Azure portal. Roles include Search Service Contributor, Search Index Data Contributor, and Search Index Data Reader. You need the first two roles if you want equivalent access.
@@ -140,7 +142,7 @@ All calls to the Management REST API are authenticated through Microsoft Entra I
140
142
141
143
It's possible to disable role-based access control for data plane operations and use key-based authentication instead. You might do this as part of a test workflow, for example to rule out permission issues.
142
144
143
-
Reverse the steps you followed previously to enable role-based access.
145
+
To disable role-based access control in the Azure portal:
144
146
145
147
1. Sign in to the [Azure portal](https://portal.azure.com) and open the search service page.
146
148
@@ -221,9 +223,9 @@ To re-enable key authentication, set "disableLocalAuth" to false. The search ser
221
223
222
224
---
223
225
224
-
## Effects of role-based access control
226
+
## Effects of multiple service principals
225
227
226
-
+ Role-based access control can increase the latency of some requests. Each unique combination of service resource (index, indexer, skillsets and so forth) and service principal triggers an authorization check. These authorization checks can add up to 200 milliseconds of latency per request.
228
+
+ Each unique combination of service resource (index, indexer, skillsets and so forth) and service principal triggers an authorization check. These authorization checks can add up to 200 milliseconds of latency per request.
227
229
228
230
+ In rare cases where requests originate from a high number of different service principals, all targeting different service resources (indexes, indexers, and so forth), 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.
0 commit comments