@@ -13,7 +13,7 @@ ms.custom: devx-track-terraform
13
13
content_well_notification :
14
14
- AI-contribution
15
15
ai-usage : ai-assisted
16
- customer intent : As a Terraform user, I want to see how to create an Azure AI hub and its associated resources.
16
+ # customer intent: As a Terraform user, I want to see how to create an Azure AI hub and its associated resources.
17
17
---
18
18
19
19
# Use Terraform to create an Azure AI Studio hub
@@ -47,16 +47,20 @@ In this article, you use Terraform to create an Azure AI hub, an AI project, and
47
47
1 . Create a directory in which to test and run the sample Terraform code and make it the current directory.
48
48
49
49
1 . Create a file named ` providers.tf ` and insert the following code.
50
- :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/providers.tf":::
50
+
51
+ :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/providers.tf":::
51
52
52
53
1 . Create a file named ` main.tf ` and insert the following code.
53
- :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/main.tf":::
54
+
55
+ :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/main.tf":::
54
56
55
57
1 . Create a file named ` variables.tf ` and insert the following code.
56
- :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/variables.tf":::
58
+
59
+ :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/variables.tf":::
57
60
58
61
1 . Create a file named ` outputs.tf ` and insert the following code.
59
- :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/outputs.tf":::
62
+
63
+ :::code language="Terraform" source="~ /terraform_samples/quickstart/101-ai-studio/outputs.tf":::
60
64
61
65
## Initialize Terraform
62
66
@@ -72,13 +76,49 @@ In this article, you use Terraform to create an Azure AI hub, an AI project, and
72
76
73
77
## Verify the results
74
78
75
- Run [ ` az ml workspace show ` ] ( /cli/azure/ml/workspace#az_ml_workspace_show ) to view the Azure AI hub.
79
+ ### [ Azure CLI] ( #tab/azure-cli )
80
+
81
+ 1 . Get the Azure resource group name.
82
+
83
+ ``` console
84
+ resource_group_name=$(terraform output -raw resource_group_name)
85
+ ```
86
+
87
+ 1. Get the workspace name.
88
+
89
+ ```console
90
+ workspace_name=$(terraform output -raw workspace_name)
91
+ ```
92
+
93
+ 1. Run [az ml workspace show](/cli/azure/ml/workspace#az-ml-workspace-show) to display information about the new workspace.
76
94
77
- ``` azurecli
78
- az ml workspace show --name <workspace_name> --resource-group <resource_group_name>
79
- ```
95
+ ```azurecli
96
+ az ml workspace show --resource-group $resource_group_name \
97
+ --name $workspace_name
98
+ ```
80
99
81
- Replace ` <workspace_name> ` and ` <resource_group_name> ` with your Azure AI hub name and resource group name, respectively.
100
+ ### [Azure PowerShell](#tab/azure-powershell)
101
+
102
+ 1. Get the Azure resource group name.
103
+
104
+ ```console
105
+ $resource_group_name=$(terraform output -raw resource_group_name)
106
+ ```
107
+
108
+ 1. Get the workspace name.
109
+
110
+ ```console
111
+ $workspace_name=$(terraform output -raw workspace_name)
112
+ ```
113
+
114
+ 1. Run [Get-AzMLWorkspace](/powershell/module/az.machinelearningservices/get-azmlworkspace) to display information about the new workspace.
115
+
116
+ ```azurepowershell
117
+ Get-AzMLWorkspace -ResourceGroupName $resource_group_name `
118
+ -Name $workspace_name
119
+ ```
120
+
121
+ ---
82
122
83
123
## Clean up resources
84
124
0 commit comments