Skip to content

Commit 51f1731

Browse files
authored
Merge pull request #1765 from MicrosoftDocs/main
11/29/2024 AM Publish
2 parents ec569af + 61ed3c3 commit 51f1731

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

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

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

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

1313
# Quickstart: Connect without keys
1414

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.
15+
Configure Azure AI Search to use Microsoft Entra ID authentication and role-based access control (RBAC). Connect from your local system with your personal identity, using Jupyter notebooks or a REST client to interact with your search service.
1616

1717
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

2121
- An Azure subscription. [Create one for free](https://azure.microsoft.com/free/).
2222

23-
- [Azure AI Search](search-create-service-portal.md), any region or tier, but you need Basic or higher to configure a system-assigned managed identity for Azure AI Search.
23+
- [Azure AI Search](search-create-service-portal.md), any region or tier, but you need Basic or higher to configure a managed identity for Azure AI Search.
2424

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

2727
## Step 1: Get your Azure subscription and tenant IDs
2828

29-
This step is necessary if you have more than one subscription or tenant.
29+
You need this step if you have more than one subscription or tenant.
3030

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

@@ -38,13 +38,13 @@ This step is necessary if you have more than one subscription or tenant.
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. Switching to your local device and a command prompt, identify the active Azure subscription and tenant:
41+
1. You now know which subscription and tenant Azure AI Search is under. Switching to your local device and a command prompt, identify the active Azure subscription and tenant on your device:
4242

4343
```azurecli
4444
az account show
4545
```
4646

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:
47+
1. If the active subscription and tenant differ 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:
4848

4949
```azurecli
5050
az account set --subscription <your-subscription-id>
@@ -122,24 +122,33 @@ az login
122122

123123
### Using a REST client
124124

125-
Several quickstarts and tutorials use a REST client, such as Visual Studio Code with the REST extension. Here's how you connect to Azure AI Search from Visual Studio Code.
125+
[Several quickstarts](search-get-started-vector.md) and tutorials use a REST client, such as Visual Studio Code with the REST extension. Here's how you connect to Azure AI Search from Visual Studio Code.
126126

127127
1. Get a personal identity token:
128128

129-
`az account get-access-token --scope https://search.azure.com/.default`
129+
```azurecli
130+
az account get-access-token --scope https://search.azure.com/.default
131+
```
132+
133+
1. Set variables used for the connection, pasting the full search service endpoint and the token you got in the previous step.
134+
135+
```http
136+
@baseUrl = PUT-YOUR-SEARCH-SERVICE-URL-HERE
137+
@token = PUT-YOUR-PERSONAL-IDENTITY-TOKEN-HERE
138+
```
130139
131-
1. Extract the token from the output:
140+
<!-- 1. Extract the token from the output:
132141
133142
`TOKEN=$(az account get-access-token --resource https://<your-search-service-name>.search.windows.net --query accessToken --output tsv)`
134143
135144
1. Provide the token in a request header:
136145
137-
`az rest --method get --url "https://<your-search-service-name>.search.windows.net/indexes/<your-index-name>/docs?api-version=2021-04-30-Preview&search=*" --headers "Authorization=Bearer $TOKEN"`
146+
`az rest --method get --url "https://<your-search-service-name>.search.windows.net/indexes/<your-index-name>/docs?api-version=2021-04-30-Preview&search=*" --headers "Authorization=Bearer $TOKEN"` -->
138147
139148
1. Specify the authorization bearer token in a REST call:
140149
141150
```REST
142-
POST https://{{baseUrl}}/indexes/{{index-name}}/docs/search?api-version=2024-07-01 HTTP/1.1
151+
POST https://{{baseUrl}}/indexes/hotels-sample-index/docs/search?api-version=2024-07-01 HTTP/1.1
143152
Content-type: application/json
144153
Authorization: Bearer {{token}}
145154

0 commit comments

Comments
 (0)