Skip to content

Commit 653c712

Browse files
authored
Merge pull request #102782 from Blackmist/template-update
draft update of resource manager template document
2 parents 7290fd0 + f6f7179 commit 653c712

File tree

1 file changed

+206
-2
lines changed

1 file changed

+206
-2
lines changed

articles/machine-learning/how-to-create-workspace-template.md

Lines changed: 206 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ms.custom: seoapril2019
1414
# Customer intent: As a DevOps person, I need to automate or customize the creation of Azure Machine Learning by using templates.
1515
---
1616
[!INCLUDE [aml-applies-to-basic-enterprise-sku](../../includes/aml-applies-to-basic-enterprise-sku.md)]
17+
<br>
1718

1819
# Use an Azure Resource Manager template to create a workspace for Azure Machine Learning
1920

@@ -68,6 +69,209 @@ For more information on templates, see the following articles:
6869
* [Deploy an application with Azure Resource Manager templates](../azure-resource-manager/templates/deploy-powershell.md)
6970
* [Microsoft.MachineLearningServices resource types](https://docs.microsoft.com/azure/templates/microsoft.machinelearningservices/allversions)
7071

72+
### Advanced template
73+
74+
The following example template demonstrates how to create a workspace with three settings:
75+
76+
* Enable high confidentiality settings for the workspace
77+
* Enable encryption for the workspace
78+
* Uses an existing Azure Key Vault
79+
80+
```json
81+
{
82+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
83+
"contentVersion": "1.0.0.0",
84+
"parameters": {
85+
"workspaceName": {
86+
"type": "string",
87+
"metadata": {
88+
"description": "Specifies the name of the Azure Machine Learning workspace."
89+
}
90+
},
91+
"location": {
92+
"type": "string",
93+
"defaultValue": "southcentralus",
94+
"allowedValues": [
95+
"eastus",
96+
"eastus2",
97+
"southcentralus",
98+
"southeastasia",
99+
"westcentralus",
100+
"westeurope",
101+
"westus2"
102+
],
103+
"metadata": {
104+
"description": "Specifies the location for all resources."
105+
}
106+
},
107+
"sku":{
108+
"type": "string",
109+
"defaultValue": "basic",
110+
"allowedValues": [
111+
"basic",
112+
"enterprise"
113+
],
114+
"metadata": {
115+
"description": "Specifies the sku, also referred to as 'edition' of the Azure Machine Learning workspace."
116+
}
117+
},
118+
"hbi_workspace":{
119+
"type": "string",
120+
"defaultValue": "false",
121+
"allowedValues": [
122+
"false",
123+
"true"
124+
],
125+
"metadata": {
126+
"description": "Specifies that the Azure Machine Learning workspace holds highly confidential data."
127+
}
128+
},
129+
"encryption_status":{
130+
"type": "string",
131+
"defaultValue": "Disabled",
132+
"allowedValues": [
133+
"Enabled",
134+
"Disabled"
135+
],
136+
"metadata": {
137+
"description": "Specifies if the Azure Machine Learning workspace should be encrypted with the customer managed key."
138+
}
139+
},
140+
"cmk_keyvault":{
141+
"type": "string",
142+
"metadata": {
143+
"description": "Specifies the customer managed keyvault Resource Manager ID."
144+
}
145+
},
146+
"resource_cmk_uri":{
147+
"type": "string",
148+
"metadata": {
149+
"description": "Specifies the customer managed keyvault key uri."
150+
}
151+
}
152+
},
153+
"variables": {
154+
"storageAccountName": "[concat('sa',uniqueString(resourceGroup().id))]",
155+
"storageAccountType": "Standard_LRS",
156+
"keyVaultName": "[concat('kv',uniqueString(resourceGroup().id))]",
157+
"tenantId": "[subscription().tenantId]",
158+
"applicationInsightsName": "[concat('ai',uniqueString(resourceGroup().id))]",
159+
"containerRegistryName": "[concat('cr',uniqueString(resourceGroup().id))]"
160+
},
161+
"resources": [
162+
{
163+
"type": "Microsoft.Storage/storageAccounts",
164+
"apiVersion": "2018-07-01",
165+
"name": "[variables('storageAccountName')]",
166+
"location": "[parameters('location')]",
167+
"sku": {
168+
"name": "[variables('storageAccountType')]"
169+
},
170+
"kind": "StorageV2",
171+
"properties": {
172+
"encryption": {
173+
"services": {
174+
"blob": {
175+
"enabled": true
176+
},
177+
"file": {
178+
"enabled": true
179+
}
180+
},
181+
"keySource": "Microsoft.Storage"
182+
},
183+
"supportsHttpsTrafficOnly": true
184+
}
185+
},
186+
{
187+
"type": "Microsoft.KeyVault/vaults",
188+
"apiVersion": "2018-02-14",
189+
"name": "[variables('keyVaultName')]",
190+
"location": "[parameters('location')]",
191+
"properties": {
192+
"tenantId": "[variables('tenantId')]",
193+
"sku": {
194+
"name": "standard",
195+
"family": "A"
196+
},
197+
"accessPolicies": []
198+
}
199+
},
200+
{
201+
"type": "Microsoft.Insights/components",
202+
"apiVersion": "2015-05-01",
203+
"name": "[variables('applicationInsightsName')]",
204+
"location": "[if(or(equals(parameters('location'),'eastus2'),equals(parameters('location'),'westcentralus')),'southcentralus',parameters('location'))]",
205+
"kind": "web",
206+
"properties": {
207+
"Application_Type": "web"
208+
}
209+
},
210+
{
211+
"type": "Microsoft.ContainerRegistry/registries",
212+
"apiVersion": "2017-10-01",
213+
"name": "[variables('containerRegistryName')]",
214+
"location": "[parameters('location')]",
215+
"sku": {
216+
"name": "Standard"
217+
},
218+
"properties": {
219+
"adminUserEnabled": true
220+
}
221+
},
222+
{
223+
"type": "Microsoft.MachineLearningServices/workspaces",
224+
"apiVersion": "2020-01-01",
225+
"name": "[parameters('workspaceName')]",
226+
"location": "[parameters('location')]",
227+
"dependsOn": [
228+
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
229+
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]",
230+
"[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]",
231+
"[resourceId('Microsoft.ContainerRegistry/registries', variables('containerRegistryName'))]"
232+
],
233+
"identity": {
234+
"type": "systemAssigned"
235+
},
236+
"sku": {
237+
"tier": "[parameters('sku')]",
238+
"name": "[parameters('sku')]"
239+
},
240+
"properties": {
241+
"friendlyName": "[parameters('workspaceName')]",
242+
"keyVault": "[resourceId('Microsoft.KeyVault/vaults',variables('keyVaultName'))]",
243+
"applicationInsights": "[resourceId('Microsoft.Insights/components',variables('applicationInsightsName'))]",
244+
"containerRegistry": "[resourceId('Microsoft.ContainerRegistry/registries',variables('containerRegistryName'))]",
245+
"storageAccount": "[resourceId('Microsoft.Storage/storageAccounts/',variables('storageAccountName'))]",
246+
"encryption": {
247+
"status": "[parameters('encryption_status')]",
248+
"keyVaultProperties": {
249+
"keyVaultArmId": "[parameters('cmk_keyvault')]",
250+
"keyIdentifier": "[parameters('resource_cmk_uri')]"
251+
}
252+
},
253+
"hbi_workspace": "[parameters('hbi_workspace')]"
254+
}
255+
}
256+
]
257+
}
258+
```
259+
260+
To get the ID of the Key Vault, and the key URI needed by this template, you can use the Azure CLI. The following command is an example of using the Azure CLI to get the Key Vault resource ID and URI:
261+
262+
```azurecli-interactive
263+
az keyvault show --name mykeyvault --resource-group myresourcegroup --query "[id, properties.vaultUri]"
264+
```
265+
266+
This command returns a value similar to the following text. The first value is the ID and the second is the URI:
267+
268+
```text
269+
[
270+
"/subscriptions/{subscription-guid}/resourceGroups/myresourcegroup/providers/Microsoft.KeyVault/vaults/mykeyvault",
271+
"https://mykeyvault.vault.azure.net/"
272+
]
273+
```
274+
71275
## Use the Azure portal
72276

73277
1. Follow the steps in [Deploy resources from custom template](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-template-deploy-portal#deploy-resources-from-custom-template). When you arrive at the __Edit template__ screen, paste in the template from this document.
@@ -93,7 +297,7 @@ new-azresourcegroupdeployment -name exampledeployment `
93297

94298
For more information, see [Deploy resources with Resource Manager templates and Azure PowerShell](../azure-resource-manager/templates/deploy-powershell.md) and [Deploy private Resource Manager template with SAS token and Azure PowerShell](../azure-resource-manager/templates/secure-template-with-sas-token.md).
95299

96-
## Use Azure CLI
300+
## Use the Azure CLI
97301

98302
This example assumes that you have saved the template to a file named `azuredeploy.json` in the current directory:
99303

@@ -193,7 +397,7 @@ To avoid this problem, we recommend one of the following approaches:
193397
}
194398
```
195399
196-
After these changes, you can specify the ID of the existing Key Vault resource when running the template. The template will then re-use the Key Vault by setting the `keyVault` property of the workspace to its ID.
400+
After these changes, you can specify the ID of the existing Key Vault resource when running the template. The template will then reuse the Key Vault by setting the `keyVault` property of the workspace to its ID.
197401
198402
To get the ID of the Key Vault, you can reference the output of the original template run or use the Azure CLI. The following command is an example of using the Azure CLI to get the Key Vault resource ID:
199403

0 commit comments

Comments
 (0)