Skip to content

Instantly share code, notes, and snippets.

@Agazoth
Created November 10, 2018 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Agazoth/667fe6b9f457c16a2db5bc12abac8d7f to your computer and use it in GitHub Desktop.
Save Agazoth/667fe6b9f457c16a2db5bc12abac8d7f to your computer and use it in GitHub Desktop.
Azure Blueprint definition and artifact
{
"kind": "template",
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountTypeFromBP": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_ZRS",
"Premium_LRS"
],
"metadata": {
"description": "Storage Account type"
}
},
"tagNameFromBP": {
"type": "string",
"defaultValue": "NotSet",
"metadata": {
"description": "Tag name from blueprint"
}
},
"tagValueFromBP": {
"type": "string",
"defaultValue": "NotSet",
"metadata": {
"description": "Tag value from blueprint"
}
}
},
"variables": {
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]"
},
"resources": [{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2016-01-01",
"tags": {
"[parameters('tagNameFromBP')]": "[parameters('tagValueFromBP')]"
},
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('storageAccountTypeFromBP')]"
},
"kind": "Storage",
"properties": {}
}],
"outputs": {
"storageAccountSku": {
"type": "string",
"value": "[variables('storageAccountName')]"
}
}
},
"resourceGroup": "storageRG",
"parameters": {
"storageAccountTypeFromBP": {
"value": "[parameters('storageAccountType')]"
},
"tagNameFromBP": {
"value": "[parameters('tagName')]"
},
"tagValueFromBP": {
"value": "[parameters('tagValue')]"
}
}
}
}
{
"properties": {
"targetScope": "subscription",
"resourceGroups": {
"storageRG": {
"name": "StorageAccount",
"location": "eastus2"
}
},
"parameters": {
"storageAccountType": {
"type": "string",
"value": "Standard_GRS"
},
"tagName": {
"type": "string",
"value": "CostCenter"
},
"tagValue": {
"type": "string",
"value": "ContosoIT"
},
"contributors": {
"type": "array",
"value": [
"7be2f100-3af5-4c15-bcb7-27ee43784a1f",
"38833b56-194d-420b-90ce-cff578296714"
]
},
"owners": {
"type": "array",
"value": [
"44254d2b-a0c7-405f-959c-f829ee31c2e7",
"316deb5f-7187-4512-9dd4-21e7798b0ef9"
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment