Skip to content

Commit fa18d8f

Browse files
committed
adding details to connections section
1 parent 67c14ca commit fa18d8f

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

articles/ai-services/agents/includes/acs/acs-setup.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff 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+
110
## Setup: Create an agent that can use an existing Azure AI Search index
211

3-
#### 1. Prerequisite: Have an existing Azure AI Search index
12+
#### Prerequisite: Have an existing Azure AI Search index
413
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.
514
- [Quickstart: Create a vector index using the Azure portal](../../../../search/search-get-started-portal-import-vectors.md)
615
- [Quickstart: Create a vector index using REST API](../../../../search/search-get-started-vector.md)
716

817

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).
1120
- 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}`.
1221
- **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).
1322

1423

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
1625
If you already connected the AI Search resource that contains the index you want to use to your project, skip this step.
1726

1827
##### 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.
2029
- 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.
2231
- In the Overview tab, copy the URL of your resource. The URL should be in the format `https://<your-resource-name>.search.windows.net/`.
2332
:::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":::
2433

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**.
2635
- From the left-hand navigation bar, scroll down to the Settings section and select **Keys**.
2736
- Under the **API Access Control** section, ensure the option **Both** API key and Role-based access control is selected.
2837
- 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
3140
##### Create an Azure AI Search project connection
3241

3342
# [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+
3745

3846
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):
3947
- API Key example:
@@ -52,14 +60,20 @@ You can use either an API key or credential-less YAML configuration file. For mo
5260
type: azure_ai_search
5361
endpoint: https://contoso.search.windows.net/
5462
```
63+
**Then, run the following command:**
5564
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+
```
5669
# [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.
5771
```python
5872
from azure.ai.ml.entities import AzureAISearchConnection
5973
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
6377
my_api_keys = None # leave blank for Authentication type = AAD
6478
6579
my_connection = AzureAISearchConnection(name=my_connection_name,

0 commit comments

Comments
 (0)