Unlocking Azure’s Power: How to Create a Stellar Storage Account Using ARM Templates?

VivekR
3 min readAug 24, 2023
ARM Template Deployment for Storage Account Source:
Srija Anaparthy

In the realm of cloud computing, Azure Resource Manager (ARM) templates streamline the process of provisioning resources. This article dives into creating an Azure Storage Account using an ARM template, exploring various optional parameters to empower your resource provisioning process.

Creating an ARM Template for a Storage Account

Below is a structured ARM template that demonstrates how to create an Azure Storage Account along with a thorough explanation of each parameter.

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-04-01",
"name": "[parameters('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('skuName')]",
"tier": "[parameters('skuTier')]"
},
"kind": "[parameters('kind')]",
"properties": {
"accessTier": "[parameters('accessTier')]",
"supportsHttpsTrafficOnly": "[parameters('supportsHttpsTrafficOnly')]",
"allowBlobPublicAccess": "[parameters('allowBlobPublicAccess')]"
}
}
],
"parameters": {
"storageAccountName": {
"type": "string",
"metadata": {
"description": "Name of the storage account."
}
},
"location": {
"type": "string",
"metadata": {
"description": "Location for the storage account."
}
},
"skuName": {
"type": "string",
"metadata": {
"description": "SKU name for the storage account (Standard_LRS, Standard_GRS, Premium_LRS, etc.)."
}
},
"skuTier": {
"type": "string",
"metadata": {
"description": "SKU tier for the storage account (Standard, Premium)."
}
},
"kind": {
"type": "string",
"metadata": {
"description": "Kind of storage account (StorageV2, BlobStorage, Storage, etc.)."
}
},
"accessTier": {
"type": "string",
"defaultValue": "Hot",
"allowedValues": [
"Hot",
"Cool"
],
"metadata": {
"description": "Default access tier for blobs within the storage account (Hot or Cool)."
}
},
"supportsHttpsTrafficOnly": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Indicates if HTTPS-only traffic should be enabled."
}
},
"allowBlobPublicAccess": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "Specifies whether or not public access for blobs is allowed."
}
}
}
}

Demystifying the Parameters

  • name: This parameter specifies the unique name of your Azure Storage Account. It should be between 3 and 24 characters in length and consist of numbers and lowercase letters.
  • location: Choose an Azure region where your storage account will be provisioned. This influences data residency and performance. Options include East US, West Europe, and many more.
  • sku:
    - name: The SKU (Stock Keeping Unit) dictates the replication strategy. Choose from
    "Standard_LRS" (Locally Redundant Storage),
    "Standard_GRS" (Geo-Redundant Storage), or
    "Premium_LRS" (Premium Locally Redundant Storage).
    - tier: The SKU tier signifies the performance and features level. Opt for
    "Standard" for regular workloads or
    "Premium" for high-performance requirements.
  • kind: The storage account kind defines its capabilities. Options include:
    -StorageV2: General-purpose v2 account.
    - BlobStorage: Account optimized for blob storage.
    - Storage: General-purpose v1 account.
  • accessTier: This parameter determines the default access tier for blobs within the storage account:
    - Hot: Optimal for frequently accessed data.
    - Cool: Suitable for less frequently accessed data.
  • supportsHttpsTrafficOnly: Set this to true to enforce HTTPS-only communication with your storage account, enhancing security.
  • allowBlobPublicAccess: By default set to false, changing this to true allows public access to blobs within your storage account. Use this cautiously to avoid unintended exposure.

Example ARM Template with actual values

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-04-01",
"name": "myuniquestorage", // Replace with your desired storage account name
"location": "East US", // Replace with your desired Azure region
"sku": {
"name": "Standard_LRS", // Choose SKU: Standard_LRS, Standard_GRS, Premium_LRS
"tier": "Standard" // Choose tier: Standard or Premium
},
"kind": "StorageV2", // Choose kind: StorageV2, BlobStorage, Storage
"properties": {
"accessTier": "Hot", // Choose access tier: Hot or Cool
"supportsHttpsTrafficOnly": true,
"allowBlobPublicAccess": false
}
}
]
}

For more information, visit Azure docs for Storage Account creation using ARM template

By unraveling the intricacies of Azure Storage Account parameters in ARM templates, you’re now equipped to craft storage solutions tailored precisely to your needs. Whether you’re prioritizing performance, accessibility, or security, understanding and configuring these parameters empowers you to harness the full potential of Azure’s storage capabilities. Remember, customization begins with knowledge, and your mastery of these parameters opens the doors to a world of possibilities in the cloud.

If you found the article to be helpful, you can buy me a coffee here:
Buy Me A Coffee.

--

--

VivekR

Data Engineer, Big Data Enthusiast and Automation using Python