Skip to content

Commit d05ce41

Browse files
Merge pull request #277721 from andyaviles121/updateworkspace
Update Workspace app insights and container registry via sdk/cli
2 parents a336003 + c5920e7 commit d05ce41

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

articles/ai-studio/how-to/create-azure-ai-resource.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,45 @@ For hubs that use CMK encryption mode, you can update the encryption key to a ne
102102

103103
### Update Azure Application Insights and Azure Container Registry
104104

105-
To use custom environments for Prompt Flow, you're required to configure an Azure Container Registry for your hub. To use Azure Application Insights for Prompt Flow deployments, a configured Azure Application Insights resource is required for your hub.
105+
To use custom environments for Prompt Flow, you're required to configure an Azure Container Registry for your hub. To use Azure Application Insights for Prompt Flow deployments, a configured Azure Application Insights resource is required for your hub. Updating the workspace-attached Azure Container Registry or ApplicationInsights resources may break lineage of previous jobs, deployed inference endpoints, or your ability to rerun earlier jobs in the workspace.
106106

107-
You can configure your hub for these resources during creation or update after creation. To update Azure Application Insights from the Azure portal, navigate to the **Properties** for your hub in the Azure portal, then select **Change Application Insights**. You can also use the Azure SDK/CLI options or infrastructure-as-code templates to update both Azure Application Insights and Azure Container Registry for the hub.
107+
You can use the Azure Portal, Azure SDK/CLI options, or the infrastructure-as-code templates to update both Azure Application Insights and Azure Container Registry for the hub.
108+
109+
# [Azure portal](#tab/portal)
110+
111+
You can configure your hub for these resources during creation or update after creation.
112+
113+
To update Azure Application Insights from the Azure portal, navigate to the **Properties** for your hub in the Azure portal, then select **Change Application Insights**.
108114

109115
:::image type="content" source="~/reusable-content/ce-skilling/azure/media/how-to/resource-manage-update-associated-resources.png" alt-text="Screenshot of the properties page of the hub resource in the Azure portal." lightbox="~/reusable-content/ce-skilling/azure/media/how-to/resource-manage-update-associated-resources.png":::
110116

117+
# [Python SDK](#tab/python)
118+
119+
```python
120+
from azure.ai.ml.entities import Hub
121+
122+
my_app_insights = "{APPLICATION_INSIGHTS_ARM_ID}"
123+
my_container_registry = "{CONTAINER_REGISTRY_ARM_ID}"
124+
125+
# construct a basic hub
126+
my_hub = Hub(name="myexamplehub",
127+
location="East US",
128+
application_insights=my_app_insights,
129+
container_registry=my_container_registry)
130+
131+
# update_dependent_resources is used to give consent to update the workspace dependent resources.
132+
created_hub = ml_client.workspaces.begin_update(workspace=my_hub, update_dependent_resources=True).result()
133+
```
134+
135+
# [Azure CLI](#tab/azurecli)
136+
137+
See flag documentation for [```az ml workspace update```](/cli/azure/ml/workspace#az-ml-workspace-update)
138+
139+
```azurecli
140+
az ml workspace update -n "myexamplehub" -g "{MY_RESOURCE_GROUP}" -a "APPLICATION_INSIGHTS_ARM_ID" -u
141+
```
142+
---
143+
111144
## Next steps
112145

113146
- [Create a project](create-projects.md)

0 commit comments

Comments
 (0)