Skip to content

Commit b20ad3b

Browse files
authored
Merge pull request #1761 from MicrosoftDocs/main
11/28/2024 PM Publish
2 parents d308844 + ea9c62f commit b20ad3b

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

articles/search/search-get-started-rbac.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ ms.author: heidist
77
ms.service: azure-ai-search
88

99
ms.topic: quickstart
10-
ms.date: 11/26/2024
10+
ms.date: 11/28/2024
1111
---
1212

1313
# Quickstart: Connect without keys
1414

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.
1616

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.
1818

1919
## Prerequisites
2020

@@ -24,43 +24,51 @@ If you stepped through other quickstarts that connect using API keys, this quick
2424

2525
- A command line tool, such as the [Azure CLI](/cli/azure/install-azure-cli).
2626

27-
## Step 1: Set up your Azure subscription and tenant
27+
## Step 1: Get your Azure subscription and tenant IDs
2828

2929
This step is necessary if you have more than one subscription or tenant.
3030

3131
1. Get the Azure subscription and tenant for your search service:
3232

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.
3434

3535
1. Notice the subscription name and ID in **Overview** > **Essentials**.
3636

37-
1. Select the subscription name to view the parent management group (tenant ID).
37+
1. Now select the subscription name to confirm the parent management group (tenant ID) on the next page.
3838

3939
:::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":::
4040

41-
1. Identify the active Azure subscription and tenant on your local device:
41+
1. Switching to your local device and a command prompt, identify the active Azure subscription and tenant:
4242

43-
`az account show`
43+
```azurecli
44+
az account show
45+
```
4446

45-
1. Set your Azure subscription to the subscription and tenant:
47+
1. If the active subscription is different from the information obtained in the previous step, change the subscription ID. Next, sign in to Azure using the tenant ID also found in the previous step:
4648

47-
`az account set --subscription <your-subscription-id>`
49+
```azurecli
50+
az account set --subscription <your-subscription-id>
4851
49-
`az login --tenant <your-tenant-id>`
52+
az login --tenant <your-tenant-id>
53+
```
5054

51-
1. Check your tenant ID:
55+
1. Verify your tenant ID:
5256

53-
`az account show --query tenantId --output tsv`
57+
```azurecli
58+
az account show --query tenantId --output tsv
59+
```
5460

55-
## Step 2: Configure Azure AI Search for Microsoft Entra ID authentication
61+
## Step 2: Configure Azure AI Search for RBAC
5662

57-
1. Sign in to the Azure portal and navigate to your Azure AI Search service.
63+
1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your Azure AI Search service.
5864

5965
1. Enable role-based access control (RBAC):
6066

6167
1. Go to **Settings** > **Keys**.
6268

63-
1. Choose **Role-based control** or **Both** if you need time to transition clients to role-based access control1.
69+
1. Choose **Role-based control** or **Both** if you need time to transition clients to role-based access control.
70+
71+
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.
6472

6573
1. Assign roles in the Azure portal:
6674

@@ -70,10 +78,23 @@ This step is necessary if you have more than one subscription or tenant.
7078

7179
1. Select **+ Add** > **Add role assignment**.
7280

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).
81+
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.
82+
83+
Repeat for each role.
84+
85+
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).
86+
87+
> [!TIP]
88+
> 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.
7489
7590
## Step 3: Connect from your local system
7691

92+
If you haven't yet signed in to Azure:
93+
94+
```azurecli
95+
az login
96+
```
97+
7798
### Using Python and Jupyter notebooks
7899

79100
1. Install the Azure Identity and Azure Search libraries:
@@ -105,7 +126,7 @@ Several quickstarts and tutorials use a REST client, such as Visual Studio Code
105126

106127
1. Get a personal identity token:
107128

108-
`az account get-access-token --resource https://<your-search-service-name>.search.windows.net`
129+
`az account get-access-token --scope https://search.azure.com/.default`
109130

110131
1. Extract the token from the output:
111132

0 commit comments

Comments
 (0)