Loading, please wait...

A to Z Full Forms and Acronyms

Deploying various type of storage(s) inside Azure Storage account using ARM template

Jul 27, 2020 Azure storage, 9322 Views
Deploying various type of storage(s) inside Azure Storage account using ARM template

Deploying various type of storage(s) inside Azure Storage account using ARM template

 

Azure Storage is one of the cloud computing PaaS (Platform as a Service) services provided by the Microsoft Azure team. It provides cloud storage that is highly available, secure, durable, scalable, and redundant. It is massively scalable and elastic. It can store and process hundreds of terabytes of data or you can store the small amounts of data required for a small business website.

Recently one of my colleagues has asked me they want to deploy all storage options using a single ARM template such as

  • Blob/Containers
  • File shares
  • Tables
  • Queues

In order to achieve, I have written below ARM template to achieve this,

############################################

{
“$schema”: “https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
“contentVersion”: “1.0.0.0”,
“parameters”: {
“storageAccountName”: {
“type”: “string”,
“metadata”: {
“description”: “Specifies the name of the Azure Storage account.”
}
},


“queue”: {
“type”: “string”,
“defaultValue”: “queue”,
“metadata”: {
“description”: “Specifies the name of the Azure Storage account.”
}
},

“containerName”: {
“type”: “string”,
“defaultValue”: “logs”,
“metadata”: {
“description”: “Specifies the name of the blob container.”
}
},

“fileshare”: {
“type”: “string”,
“defaultValue”: “fileshare”,
“metadata”: {
“description”: “Specifies the name of the blob container.”
}
},

“tables”: {
“type”: “string”,
“defaultValue”: “logs”,
“metadata”: {
“description”: “Specifies the name of the blob container.”
}
},


“location”: {
“type”: “string”,
“defaultValue”: “[resourceGroup().location]”,
“metadata”: {
“description”: “Specifies the location in which the Azure Storage resources should be deployed.”
}
}
},
“resources”: [
{
“type”: “Microsoft.Storage/storageAccounts”,
“apiVersion”: “2019–06–01”,
“name”: “[parameters(‘storageAccountName’)]”,
“location”: “[parameters(‘location’)]”,
“sku”: {
“name”: “Standard_LRS”,
“tier”: “Standard”
},
“kind”: “StorageV2”,
“properties”: {
“accessTier”: “Hot”
},
“resources”: [
{
“type”: “blobServices/containers”,
“apiVersion”: “2019–06–01”,
“name”: “[concat(‘default/’, parameters(‘containerName’))]”,
“dependsOn”: [
“[parameters(‘storageAccountName’)]”
]
},

{
“type”: “queueServices/Queues”,
“apiVersion”: “2019–06–01”,
“name”: “[concat(‘default/’, parameters(‘queue’))]”,
“dependsOn”: [
“[parameters(‘storageAccountName’)]”
]
},


{
“type”: “fileServices/shares”,
“apiVersion”: “2019–06–01”,
“name”: “[concat(‘default/’, parameters(‘fileshare’))]”,
“dependsOn”: [
“[parameters(‘storageAccountName’)]”
]
},

{
“type”: “tableServices/tables”,
“apiVersion”: “2019–06–01”,
“name”: “[concat(‘default/’, parameters(‘tables’))]”,
“dependsOn”: [
“[parameters(‘storageAccountName’)]”
]
}


]
}


]
}

############################################

Image for post

If I go back to my Azure Portal → Look for the new storage account

Image for post

Now Individually if I have to check Container then it will show below screen.

Image for post

 

Image for post

Image for post

 

Image for post

Meanwhile, you can enhance this bit more using storage with https, and selecting different storage SKU options.

A to Z Full Forms and Acronyms