githubのAzure Resource Manager テンプレート https://github.com/Azure/azure-quickstart-templatesは、ご存じだと思います。
自分の勉強もかねて、テンプレートをカスタマイズしてみたので、参考までに公開します。
もっと洗練された方法があればコメントもらえるとありがたいです。
カスタマイズした元ネタは、azure-quickstart-templates / 101-storage-account-create /です。続いて公開予定のVMテンプレートにてVariablesにコーディングしているので、githubのAzure Resource Manager テンプレートをカスタマイズしてみた - 仮想ネットワークに続き、載せます。
こちらは、
- "parameters"でストレージアカウント名を指定できるように追記し、"resources"の"name"でパラメーターをセットするように変更
くらいで大したカスタマイズではありません。
カスタマイズしたコードを下記に貼っておきます。
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_ZRS",
"Premium_LRS"
],
"metadata": {
"description": "Storage Account type"
}
},
"storageAccountName":{
"type":"string",
"defaultValue": "armstorageact01",
"metadata": {
"description": "Storage Account Name"
}
}
},
"variables": {
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'standardsa')]",
"apiVersion": "2015-06-15"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('storageAccountName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[parameters('storageAccountType')]"
}
}
]
}
0 件のコメント:
コメントを投稿