A complete template

We have now covered all of the essential elements needed when creating a template. The following code shows a template including parameters, variables, resources, and outputs. This code is available in the chapter-3 - listing1.txt file in the accompanying chapter code:

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"customTags": {
"type": "object",
"defaultValue": {
"Dept": "Technology",
"Environment": "Production"
}
},
"storageAccountName": { "type": "string" },
"storageAccountType": {"type": "string"}
},
"variables": {
},
"resources": [
{
"apiVersion": "2018-02-01",
"name": "[parameters('storageAccountName')]",
"location": "[resourceGroup().location]",
"type": "Microsoft.Storage/storageAccounts",
"tags": "[parameters('customTags')]",
"sku": {
"name": "[parameters('storageAccountType')]"
},
"kind": "Storage",
"properties": {
"encryption": {
"services": {
"blob": {
"enabled": true
},
"file": null
},
"keySource": "Microsoft.Storage"
}
}
}
],
"outputs": {
"storage": {
"type": "object",
"value": "[reference(parameters('storageAccountName'))]"
}
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.247