Skip to content

Commit 35011bd

Browse files
committed
agentic-search-rest-python
1 parent 81d07b1 commit 35011bd

File tree

4 files changed

+38
-30
lines changed

4 files changed

+38
-30
lines changed

articles/search/includes/quickstarts/agentic-retrieval-python.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: haileytap
44
ms.author: haileytapia
55
ms.service: azure-ai-search
66
ms.topic: include
7-
ms.date: 6/13/2025
7+
ms.date: 6/15/2025
88
---
99

1010
[!INCLUDE [Feature preview](../previews/preview-generic.md)]
@@ -21,23 +21,26 @@ This quickstart is based on the [Quickstart-Agentic-Retrieval](https://github.co
2121

2222
+ An [Azure AI Search service](../../search-create-service-portal.md) on the Basic tier or higher with [semantic ranker enabled](../../semantic-how-to-enable-disable.md).
2323

24-
+ An [Azure AI Foundry project](/azure/ai-foundry/how-to/create-projects).
24+
+ An [Azure AI Foundry project](/azure/ai-foundry/how-to/create-projects). You get an Azure AI Foundry resource (that's needed for model deployments) when you create an Azure AI Foundry project.
2525

2626
+ [Visual Studio Code](https://code.visualstudio.com/download) with the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) and [Jupyter package](https://pypi.org/project/jupyter/).
2727

28-
+ Install the [Azure CLI](/cli/azure/install-azure-cli) used for keyless authentication with Microsoft Entra ID.
28+
+ The [Azure CLI](/cli/azure/install-azure-cli) for keyless authentication with Microsoft Entra ID.
2929

3030
[!INCLUDE [Setup](./agentic-retrieval-setup.md)]
3131

3232
## Connect from your local system
3333

3434
You configured role-based access to interact with Azure AI Search and Azure OpenAI.
3535

36-
Run the following Azure CLI command and sign in with your Azure account. If you have multiple subscriptions, select the one that contains your Azure AI Search service and Azure AI Foundry project.
36+
To connect from your local system:
3737

38-
```azurecli
39-
az login
40-
```
38+
1. Open a new terminal in Visual Studio Code and change to the directory where you want to save your files.
39+
1. Run the following Azure CLI command and sign in with your Azure account. If you have multiple subscriptions, select the one that contains your Azure AI Search service and Azure AI Foundry project.
40+
41+
```azurecli
42+
az login
43+
```
4144
4245
For more information, see [Quickstart: Connect without keys](../../search-get-started-rbac.md).
4346
@@ -47,7 +50,7 @@ Before you run any code, install Python packages and define credentials, endpoin
4750
4851
To install the packages and load the connections:
4952
50-
1. Open Visual Studio Code and create a `.ipynb` file. For example, you can name the file `quickstart-agentic-retrieval.ipynb`.
53+
1. In Visual Studio Code, create a `.ipynb` file. For example, you can name the file `quickstart-agentic-retrieval.ipynb`.
5154
5255
1. In the first code cell, paste the following code to install the required packages.
5356
@@ -83,7 +86,7 @@ To install the packages and load the connections:
8386
api_version = "2025-05-01-Preview"
8487
```
8588
86-
1. Replace `endpoint` and `azure_openai_endpoint` with the values you obtained in [Get endpoints](#get-endpoints). Set `endpoint` to your Azure AI Search service endpoint, which looks like `https://<your-search-service-name>.search.windows.net`, and `azure_openai_endpoint` to your Azure AI Foundry endpoint, which looks like `https://<your-foundry-resource-name>.openai.azure.com`.
89+
1. Set `endpoint` to your Azure AI Search endpoint, which looks like `https://<your-search-service-name>.search.windows.net.` Set `azure_openai_endpoint` to your Azure AI Foundry endpoint, which looks like `https://<your-foundry-resource-name>.openai.azure.com.` You obtained both values in the [Get endpoints](#get-endpoints) section.
8790
8891
1. To verify the variables, run the code cell.
8992

articles/search/includes/quickstarts/agentic-retrieval-rest.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: haileytap
44
ms.author: haileytapia
55
ms.service: azure-ai-search
66
ms.topic: include
7-
ms.date: 6/13/2025
7+
ms.date: 6/15/2025
88
---
99

1010
[!INCLUDE [Feature preview](../previews/preview-generic.md)]
@@ -22,11 +22,11 @@ Although you can provide your own data, this quickstart uses [sample JSON docume
2222

2323
+ An [Azure AI Search service](../../search-create-service-portal.md) on the Basic tier or higher with [semantic ranker enabled](../../semantic-how-to-enable-disable.md).
2424

25-
+ An [Azure AI Foundry project](/azure/ai-foundry/how-to/create-projects).
25+
+ An [Azure AI Foundry project](/azure/ai-foundry/how-to/create-projects). You get an Azure AI Foundry resource (that's needed for model deployments) when you create an Azure AI Foundry project.
2626

2727
+ [Visual Studio Code](https://code.visualstudio.com/download) with a [REST client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client).
2828

29-
+ Install the [Azure CLI](/cli/azure/install-azure-cli) used for keyless authentication with Microsoft Entra ID.
29+
+ The [Azure CLI](/cli/azure/install-azure-cli) for keyless authentication with Microsoft Entra ID.
3030

3131
[!INCLUDE [Setup](./agentic-retrieval-setup.md)]
3232

@@ -36,6 +36,8 @@ You configured role-based access to interact with Azure AI Search and Azure Open
3636

3737
To connect from your local system:
3838

39+
1. Open a new terminal in Visual Studio Code and change to the directory where you want to save your files.
40+
3941
1. Run the following command and sign in with your Azure account. If you have multiple subscriptions, select the one that contains your Azure AI Search service and Azure AI Foundry project.
4042

4143
```azurecli
@@ -54,7 +56,8 @@ Before you send any requests, define credentials, endpoints, and deployment deta
5456

5557
To load the connections:
5658

57-
1. In Visual Studio Code, paste the following placeholders into a `.rest` or `.http` file. For example, you can create a file named `agentic-retrieval.rest`.
59+
1. In Visual Studio Code create a `.rest` or `.http` file. For example, you can name the file `agentic-retrieval.rest`.
60+
1. Paste these placeholders into the new file:
5861

5962
```HTTP
6063
@baseUrl = PUT-YOUR-SEARCH-SERVICE-URL-HERE
@@ -69,7 +72,7 @@ To load the connections:
6972
@api-version = 2025-05-01-Preview
7073
```
7174
72-
1. Replace `@baseUrl` and `@aoaiBaseUrl` with the values you obtained in [Get endpoints](#get-endpoints).
75+
1. Set `@baseUrl` to your Azure AI Search endpoint, which looks like `https://<your-search-service-name>.search.windows.net.` Set `@aoaiBaseUrl` to your Azure AI Foundry endpoint, which looks like `https://<your-foundry-resource-name>.openai.azure.com.` You obtained both values in the [Get endpoints](#get-endpoints) section.
7376
7477
1. Replace `@token` with the Microsoft Entra token you obtained in [Connect from your local system](#connect-from-your-local-system).
7578

articles/search/includes/quickstarts/agentic-retrieval-setup.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,19 @@ author: haileytap
44
ms.author: haileytapia
55
ms.service: azure-ai-search
66
ms.topic: include
7-
ms.date: 6/13/2025
7+
ms.date: 6/15/2025
88
---
99

1010
## Configure role-based access
1111

12-
Azure AI Search needs access to your Azure OpenAI models. For this task, you can use API keys or Microsoft Entra ID with role assignments. Keys are easier to start with, but roles are more secure. This quickstart assumes roles.
12+
You can use search service API keys or Microsoft Entra ID with role assignments. Keys are easier to start with, but roles are more secure. This quickstart assumes roles.
1313

1414
To configure the recommended role-based access:
1515

1616
1. Sign in to the [Azure portal](https://portal.azure.com/).
1717

1818
1. [Enable role-based access](../../search-security-enable-roles.md) on your Azure AI Search service.
1919

20-
1. [Create a system-assigned managed identity](../../search-howto-managed-identities-data-sources.md#create-a-system-managed-identity) on your Azure AI Search service. Here's how to do it using the Azure CLI:
21-
22-
```azurecli
23-
az search service update --name YOUR-SEARCH-SERVICE-NAME --resource-group YOUR-RESOURCE-GROUP-NAME --identity-type SystemAssigned
24-
```
25-
26-
If you already have a managed identity, you can skip this step.
27-
2820
1. On your Azure AI Search service, [assign the following roles](../../search-security-rbac.md#how-to-assign-roles-in-the-azure-portal) to yourself.
2921

3022
+ **Search Service Contributor**
@@ -33,7 +25,17 @@ To configure the recommended role-based access:
3325

3426
+ **Search Index Data Reader**
3527

36-
1. On your Azure AI Foundry resource, assign **Cognitive Services User** to the managed identity that you created for your search service.
28+
For agentic retrieval, Azure AI Search also needs access to your Azure OpenAI Foundry resource.
29+
30+
1. [Create a system-assigned managed identity](../../search-howto-managed-identities-data-sources.md#create-a-system-managed-identity) on your Azure AI Search service. Here's how to do it using the Azure CLI:
31+
32+
```azurecli
33+
az search service update --name YOUR-SEARCH-SERVICE-NAME --resource-group YOUR-RESOURCE-GROUP-NAME --identity-type SystemAssigned
34+
```
35+
36+
If you already have a managed identity, you can skip this step.
37+
38+
1. On your Azure AI Foundry resource, assign **Cognitive Services User** to the managed identity that you created for your search service.
3739

3840
## Deploy models
3941

@@ -57,11 +59,11 @@ To deploy the Azure OpenAI models:
5759

5860
1. Select **Deploy**.
5961

60-
Repeat the previous steps via the model catalog to deploy the **text-embedding-3-large** embedding model.
62+
1. Repeat the previous steps, but this time deploy the **text-embedding-3-large** embedding model.
6163

6264
## Get endpoints
6365

64-
In your code, you specify the following endpoints to establish connections with Azure AI Search and Azure OpenAI. These steps assume that you configured role-based access in the previous section.
66+
In your code, you specify the following endpoints to establish connections with you Azure AI Search service and Azure AI Foundry resource. These steps assume that you [configured role-based access as described previously](#configure-role-based-access).
6567

6668
To obtain your service endpoints:
6769

@@ -75,6 +77,6 @@ To obtain your service endpoints:
7577

7678
1. On your Azure AI Foundry resource:
7779

78-
1. From the left pane, select **Resource Management** > **Keys and Endpoint**.
80+
1. From the left pane, select **Resource Management** > **Keys and Endpoint**.
7981

80-
1. Copy the URL, which should be similar to `https://my-resource.openai.azure.com`.
82+
1. Select the **OpenAI** tab and copy the URL that looks similar to `https://my-resource.openai.azure.com`.

articles/search/search-get-started-agentic-retrieval.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: haileytap
66
ms.author: haileytapia
77
ms.service: azure-ai-search
88
ms.topic: quickstart
9-
ms.date: 6/13/2025
9+
ms.date: 6/15/2025
1010
zone_pivot_groups: search-get-started-agentic-retrieval
1111
---
1212

0 commit comments

Comments
 (0)