This walkthrough will show you how to build an ARM template for a simple Azure Storage account resource.
Created
July 23, 2019 12:49
-
-
Save jrudley/58210b06884e8281c5d4859fbdff6e85 to your computer and use it in GitHub Desktop.
Learning to build ARM templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"resources": [] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"resources": [ | |
{ | |
"name": "storpersondemo", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2019-04-01", | |
"sku": { | |
"name": "Standard_LRS" | |
}, | |
"kind": "StorageV2", | |
"location": "East US", | |
"properties": { | |
"supportsHttpsTrafficOnly": true | |
} | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"variables": { | |
"location": "East US", | |
"sku": "Standard_ZRS", | |
"name": "storpersonexample" | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('name')]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2019-04-01", | |
"sku": { | |
"name": "[variables('sku')]" | |
}, | |
"kind": "StorageV2", | |
"location": "[variables('location')]", | |
"properties": { | |
"supportsHttpsTrafficOnly": true | |
} | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"storagePrefix": { | |
"type": "string" | |
}, | |
"storageSKU": { | |
"type": "string", | |
"defaultValue": "Standard_GRS", | |
"allowedValues": [ | |
"Standard_LRS", | |
"Standard_ZRS", | |
"Standard_GRS" | |
] | |
} | |
}, | |
"variables": { | |
"location": "East US", | |
"name": "[concat(parameters('storagePrefix'), 'demothree')]" | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('name')]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2019-04-01", | |
"sku": { | |
"name": "[parameters('storageSKU')]" | |
}, | |
"kind": "StorageV2", | |
"location": "[variables('location')]", | |
"properties": { | |
"supportsHttpsTrafficOnly": true | |
} | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"storagePrefix": { | |
"type": "string" | |
}, | |
"storageSKU": { | |
"type": "string", | |
"defaultValue": "Standard_GRS", | |
"allowedValues": [ | |
"Standard_LRS", | |
"Standard_ZRS", | |
"Standard_GRS" | |
] | |
} | |
}, | |
"variables": { | |
"storageName": "[concat(parameters('storagePrefix'), uniqueString(resourceGroup().id))]" | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('storageName')]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2019-04-01", | |
"sku": { | |
"name": "[parameters('storageSKU')]" | |
}, | |
"kind": "StorageV2", | |
"location": "[resourceGroup().location]", | |
"properties": { | |
"supportsHttpsTrafficOnly": true | |
} | |
} | |
], | |
"outputs": { | |
"storageId": { | |
"type": "string", | |
"value": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageName'))]" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"storagePrefix": { | |
"type": "string" | |
}, | |
"storageSKU": { | |
"type": "string", | |
"defaultValue": "Standard_GRS", | |
"allowedValues": [ | |
"Standard_LRS", | |
"Standard_ZRS", | |
"Standard_GRS" | |
] | |
} | |
}, | |
"variables": { | |
"storageName": "[concat(parameters('storagePrefix'), uniqueString(resourceGroup().id))]" | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('storageName')]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2019-04-01", | |
"sku": { | |
"name": "[parameters('storageSKU')]" | |
}, | |
"kind": "StorageV2", | |
"location": "[resourceGroup().location]", | |
"properties": { | |
"supportsHttpsTrafficOnly": true | |
} | |
} | |
], | |
"outputs": { | |
"storageCredentials": { | |
"type": "object", | |
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2019-04-01')]" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"storagePrefix": { | |
"type": "string" | |
}, | |
"storageSKU": { | |
"type": "string", | |
"defaultValue": "Standard_GRS", | |
"allowedValues": [ | |
"Standard_LRS", | |
"Standard_ZRS", | |
"Standard_GRS" | |
] | |
} | |
}, | |
"variables": { | |
"storageName": "[concat(parameters('storagePrefix'), uniqueString(resourceGroup().id))]" | |
}, | |
"resources": [ | |
{ | |
"name": "[variables('storageName')]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2019-04-01", | |
"sku": { | |
"name": "[parameters('storageSKU')]" | |
}, | |
"kind": "StorageV2", | |
"location": "[resourceGroup().location]", | |
"properties": { | |
"supportsHttpsTrafficOnly": true | |
} | |
} | |
], | |
"outputs": { | |
"storageKey": { | |
"type": "string", | |
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2019-04-01').keys[0].value]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment