Skip to content

Commit afdda6f

Browse files
committed
freshness: update create-hub-project-sdk.md
1 parent 4b04408 commit afdda6f

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

articles/ai-studio/how-to/develop/create-hub-project-sdk.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: scottpolly
66
ms.service: azure-ai-foundry
77
ms.custom: build-2024, devx-track-azurecli
88
ms.topic: how-to
9-
ms.date: 11/21/2024
9+
ms.date: 02/13/2025
1010
ms.reviewer: dantaylo
1111
ms.author: sgilley
1212
author: sdgilley
@@ -78,18 +78,26 @@ az ml workspace create --kind hub --resource-group {my_resource_group} --name {m
7878

7979
## Create an AI Services connection
8080

81-
After creating your own AI Services, you can connect it to your hub:
81+
After creating your own AI Services, you can connect it to your hub.
8282

8383
# [Python SDK](#tab/python)
8484

85+
First, create a connection to ml_client that includes your hub as the workspace_name:
86+
87+
[!notebook-python[](~/azureml-examples-main/sdk/python/resources/connections/connections.ipynb?name=details)]
88+
[!notebook-python[](~/azureml-examples-main/sdk/python/resources/connections/connections.ipynb?name=ml_client)]
89+
90+
Then use ml_client to create the connection to your AI Services:
91+
8592
```python
8693
from azure.ai.ml.entities import AzureAIServicesConnection
8794

88-
# constrict an AI Services connection
89-
my_connection_name = "myaiservivce"
90-
my_endpoint = "demo.endpoint" # this could also be called target
95+
# construct an AI Services connection
96+
my_connection_name = "myaiservivce" # any name you want
97+
aiservices_resource_name = <resource_name> # copy from Azure AI Foundry portal
98+
my_endpoint = "<endpoint>" # copy from Azure AI Foundry portal
9199
my_api_keys = None # leave blank for Authentication type = AAD
92-
my_ai_services_resource_id = "" # ARM id required
100+
resource_id = f"/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.CognitiveServices/accounts/{aiservices_resource_name}"
93101

94102
my_connection = AzureAIServicesConnection(name=my_connection_name,
95103
endpoint=my_endpoint,
@@ -113,18 +121,22 @@ You can use either an API key or credential-less YAML configuration file. For mo
113121
```yml
114122
name: myazai_ei
115123
type: azure_ai_services
116-
endpoint: https://contoso.cognitiveservices.azure.com/
124+
endpoint: <endpoint for your AI Services>
117125
api_key: XXXXXXXXXXXXXXX
126+
ai_services_resource_id: <fully_qualified_resource_id>
118127
```
119128
120129
- Credential-less
121130
122131
```yml
123132
name: myazai_apk
124133
type: azure_ai_services
125-
endpoint: https://contoso.cognitiveservices.azure.com/
134+
endpoint: <endpoint for your AI Services>
135+
ai_services_resource_id: <fully_qualified_resource_id>
126136
```
127137
138+
The <fully_qualified_resource_id> is the resource ID of your AI Services resource. It is in the format `/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.CognitiveServices/accounts/{aiservices_resource_name}`.
139+
128140
---
129141

130142
## Create an Azure AI Foundry hub using existing dependency resources

0 commit comments

Comments
 (0)