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/ai-services/agents/includes/acs/acs-setup.md
+27-13Lines changed: 27 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,37 @@
1
+
---
2
+
manager: nitinme
3
+
author: fosteramanda
4
+
ms.author: fosteramanda
5
+
ms.service: azure
6
+
ms.topic: include
7
+
ms.date: 12/10/2024
8
+
---
9
+
1
10
## Setup: Create an agent that can use an existing Azure AI Search index
2
11
3
-
#### 1. Prerequisite: Have an existing Azure AI Search index
12
+
#### Prerequisite: Have an existing Azure AI Search index
4
13
A prerequisite of using the Azure AI Search tool is to have an existing Azure AI Search index. If you don't have an existing index, you can create one in the Azure portal or via REST API.
5
14
-[Quickstart: Create a vector index using the Azure portal](../../../../search/search-get-started-portal-import-vectors.md)
6
15
-[Quickstart: Create a vector index using REST API](../../../../search/search-get-started-vector.md)
7
16
8
17
9
-
#### 2. Complete the agent setup
10
-
-**Option 1: Standard Agent Setup using existing AI Search resource** If you want your agent to use an existing AI Search resource to create new indexes or bring existing ones you should use the [standard agent setup and add your AI Search resource ID](../../quickstart.md).
18
+
#### Complete the agent setup
19
+
-**Option 1: Standard Agent Setup using an existing AI Search resource** If you want your agent to use an existing AI Search resource to create new indexes or bring existing ones you should use the [standard agent setup and add your AI Search resource ID](../../quickstart.md).
11
20
- You can provide your Azure AI Search resource ID in the bicep file. Your resource ID should be in the format: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}`.
12
21
-**Option 2: Standard Agent Setup** If you want to create a new Azure AI Search resource for your agents to use when creating new indexes follow the [standard agent setup](../../quickstart.md).
13
22
14
23
15
-
#### 3. Create a project connection to the Azure AI Search resource with the index you want to use
24
+
#### Create a project connection to the Azure AI Search resource with the index you want to use
16
25
If you already connected the AI Search resource that contains the index you want to use to your project, skip this step.
17
26
18
27
##### Get your Azure AI Search resource connection key and endpoint
19
-
- Access your Azure AI Search resource.
28
+
1. Access your Azure AI Search resource.
20
29
- In the Azure portal, navigate to the AI Search resource that contains the index you want to use.
21
-
- Copy the connection endpoint.
30
+
2. Copy the connection endpoint.
22
31
- In the Overview tab, copy the URL of your resource. The URL should be in the format `https://<your-resource-name>.search.windows.net/`.
23
32
:::image type="content" source="../../media/tools/ai-search/connection-endpoint.png" alt-text="A screenshot of an AI Search resource Overview tab in the Azure portal." lightbox="../../media/tools/ai-search/connection-endpoint.png":::
24
33
25
-
- Verify API Acccess control is set to **Both** and copy one of the keys under **Manage admin keys**.
34
+
3. Verify API Acccess control is set to **Both** and copy one of the keys under **Manage admin keys**.
26
35
- From the left-hand navigation bar, scroll down to the Settings section and select **Keys**.
27
36
- Under the **API Access Control** section, ensure the option **Both** API key and Role-based access control is selected.
28
37
- If you want the connection to use API Keys for authentication, copy one of the keys under **Manage admin keys**.
@@ -31,9 +40,8 @@ If you already connected the AI Search resource that contains the index you want
31
40
##### Create an Azure AI Search project connection
32
41
33
42
# [Azure CLI](#tab/azurecli)
34
-
```azurecli
35
-
az ml connection create --file {connection.yml} --resource-group {my_resource_group} --workspace-name {my_hub_name}
36
-
```
43
+
**Create the following connections.yml file**
44
+
37
45
38
46
You can use either an API key or credential-less YAML configuration file. For more information on the YAML configuration file, see the [Azure AI Search connection YAML schema](../../../../machine-learning/reference-yaml-connection-ai-search.md):
39
47
- API Key example:
@@ -52,14 +60,20 @@ You can use either an API key or credential-less YAML configuration file. For mo
52
60
type: azure_ai_search
53
61
endpoint: https://contoso.search.windows.net/
54
62
```
63
+
**Then, run the following command:**
55
64
65
+
Replace ```my_resource``` and ```my_project_name``` with your resource group and project name created in the agent setup.
66
+
```azurecli
67
+
az ml connection create --file {connection.yml} --resource-group {my_resource_group} --workspace-name {my_project_name}
68
+
```
56
69
# [Python](#tab/pythonsdk)
70
+
Replace the placeholders ```my_connection_name```, ```my_endpoint```, and ```my_key``` (optional) with your Azure AI Search connection details and run the following code to create a project connection to your Azure AI Search resource.
57
71
```python
58
72
from azure.ai.ml.entities import AzureAISearchConnection
59
73
60
-
#constrict an Azure AI Search connection
61
-
my_connection_name = "myaiservivce"
62
-
my_endpoint = "demo.endpoint" # this could also be called target
74
+
# create an Azure AI Search project connection
75
+
my_connection_name = "my-acs-connection-name"
76
+
my_endpoint = "my-acs-endpoint" # this could also be called target
63
77
my_api_keys = None # leave blank for Authentication type = AAD
0 commit comments