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-get-started-rbac.md
+24-13Lines changed: 24 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,14 @@ ms.author: heidist
7
7
ms.service: azure-ai-search
8
8
9
9
ms.topic: quickstart
10
-
ms.date: 11/26/2024
10
+
ms.date: 11/28/2024
11
11
---
12
12
13
13
# Quickstart: Connect without keys
14
14
15
-
Configure Azure AI Search to use Microsoft Entra ID authentication and roles. Connect from your local system, running Jupyter notebooks, or using a REST client.
15
+
Configure Azure AI Search to use Microsoft Entra ID authentication and role-based access control (RBAC). Connect from your local system using your personal identity, using Jupyter notebooks or a REST client to interact with your search service.
16
16
17
-
If you stepped through other quickstarts that connect using API keys, this quickstart shows you how to switch to identity-based authentication so that you can avoid hard-coded API keys in your example code.
17
+
If you stepped through other quickstarts that connect using API keys, this quickstart shows you how to switch to identity-based authentication so that you can avoid hard-coded keys in your example code.
18
18
19
19
## Prerequisites
20
20
@@ -24,43 +24,45 @@ If you stepped through other quickstarts that connect using API keys, this quick
24
24
25
25
- A command line tool, such as the [Azure CLI](/cli/azure/install-azure-cli).
26
26
27
-
## Step 1: Set up your Azure subscription and tenant
27
+
## Step 1: Get your Azure subscription and tenant IDs
28
28
29
29
This step is necessary if you have more than one subscription or tenant.
30
30
31
31
1. Get the Azure subscription and tenant for your search service:
32
32
33
-
1. Sign into the Azure portal and navigate to your search service.
33
+
1. Sign into the [Azure portal](https://portal.azure.com) and navigate to your search service.
34
34
35
35
1. Notice the subscription name and ID in **Overview** > **Essentials**.
36
36
37
-
1. Select the subscription name to view the parent management group (tenant ID).
37
+
1. Select the subscription name to confirm the parent management group (tenant ID).
38
38
39
39
:::image type="content" source="media/search-get-started-rbac/select-subscription-name.png" lightbox="media/search-get-started-rbac/select-subscription-name.png" alt-text="Screenshot of the portal page providing the subscription name":::
40
40
41
41
1. Identify the active Azure subscription and tenant on your local device:
42
42
43
43
`az account show`
44
44
45
-
1.Set your Azure subscription to the subscription and tenant:
45
+
1.If the active subscription is different from the one used by Azure AI Search, change the subscription ID. Next, sign in to Azure using the same tenant ID as Azure AI Search.
46
46
47
47
`az account set --subscription <your-subscription-id>`
48
48
49
49
`az login --tenant <your-tenant-id>`
50
50
51
-
1.Check your tenant ID:
51
+
1.Verify your tenant ID.
52
52
53
53
`az account show --query tenantId --output tsv`
54
54
55
-
## Step 2: Configure Azure AI Search for Microsoft Entra ID authentication
55
+
## Step 2: Configure Azure AI Search for RBAC
56
56
57
-
1. Sign in to the Azure portal and navigate to your Azure AI Search service.
57
+
1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your Azure AI Search service.
58
58
59
59
1. Enable role-based access control (RBAC):
60
60
61
61
1. Go to **Settings** > **Keys**.
62
62
63
-
1. Choose **Role-based control** or **Both** if you need time to transition clients to role-based access control1.
63
+
1. Choose **Role-based control** or **Both** if you need time to transition clients to role-based access control.
64
+
65
+
If you choose **Role-based control**, make sure that you assign yourself all roles named in the next instruction or you won't be able to complete tasks in the portal or through a local client.
64
66
65
67
1. Assign roles in the Azure portal:
66
68
@@ -70,10 +72,19 @@ This step is necessary if you have more than one subscription or tenant.
70
72
71
73
1. Select **+ Add** > **Add role assignment**.
72
74
73
-
1. Choose a role (Search Service Contributor, Search Index Data Contributor, Search Index Data Reader) and assign it to your Microsoft Entra user or group identity. These three roles provide the full set of permissions for creating, loading, and querying objects on Azure AI Search. For more information, see [Connect using roles](search-security-rbac.md).
75
+
1. Choose a role (Search Service Contributor, Search Index Data Contributor, Search Index Data Reader) and assign it to your Microsoft Entra user or group identity.
76
+
77
+
Repeat for each role.
78
+
79
+
You need all three roles for creating, loading, and querying objects on Azure AI Search. For more information, see [Connect using roles](search-security-rbac.md).
80
+
81
+
> [!TIP]
82
+
> Later, if you get authentication failure errors, recheck the settings in this section. There could be policies at the subscription or resource group level that override any API settings you specify.
74
83
75
84
## Step 3: Connect from your local system
76
85
86
+
If you haven't yet signed in to Azure, do so now with an `az login` command.
87
+
77
88
### Using Python and Jupyter notebooks
78
89
79
90
1. Install the Azure Identity and Azure Search libraries:
@@ -105,7 +116,7 @@ Several quickstarts and tutorials use a REST client, such as Visual Studio Code
0 commit comments