Create an Azure Storage Account using ARM Template

2020年03月01日

In Azure, you could create new resources by generating an Azure Resource Manager (ARM) template based upon existing resource settings. Optionally, you can adjust the template before using it to launch new resources.

Step 1. Manually deploy a storage account in a resource group, e.g. scsaredeploy34.

Step 2. Go the resource group that hosts that storage account.

Click "Deployments" in the "Settings" section. Select the deployment name. Click "Template", and then "Add to library".


Content of this template:

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "location": {
            "type": "String"
        },
        "storageAccountName": {
            "type": "String"
        },
        "accountType": {
            "type": "String"
        },
        "kind": {
            "type": "String"
        },
        "accessTier": {
            "type": "String"
        },
        "minimumTlsVersion": {
            "type": "String"
        },
        "supportsHttpsTrafficOnly": {
            "type": "Bool"
        },
        "allowBlobPublicAccess": {
            "type": "Bool"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Storage/storageAccounts",
            "apiVersion": "2019-06-01",
            "name": "[parameters('storageAccountName')]",
            "location": "[parameters('location')]",
            "dependsOn": [],
            "tags": {},
            "sku": {
                "name": "[parameters('accountType')]"
            },
            "kind": "[parameters('kind')]",
            "properties": {
                "accessTier": "[parameters('accessTier')]",
                "minimumTlsVersion": "[parameters('minimumTlsVersion')]",
                "supportsHttpsTrafficOnly": "[parameters('supportsHttpsTrafficOnly')]",
                "allowBlobPublicAccess": "[parameters('allowBlobPublicAccess')]"
            }
        }
    ],
    "outputs": {}
}

This will save the deployment directly as a template.


Go to Templates. Click the template name, e.g. sctemplate34 in this case. Click Deploy.




No need to create an Automation Account to achieve this goal.


References

For a series of example inputs to create a storage account, refer to:
Edit and deploy the template

SkuName

Category: Azure Tags: public

Upvote


Downvote