Deploying Resources to Azure using Azure Resource Manager Templates - Part #3
In the previous post, I had already explained the steps that are needed for deployment in Azure using an empty template. Let's explore further and see how we can deploy a storage account in Azure using ARM Templates.
Step 1: Create the template file
Open any text editor and create a template like the one given below. Save it as a JSON file with name StorageTemplate.json
What we are doing with this template is that we have defined two parameters named storageName and
And, under the resource section, we will use these parameters to set the name and the location properties for the storage account. Also, we will set the values for the resource type, kind and SKU
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.1", "parameters": { "storageName": { "type": "string" }, "storageLocation": { "type": "string" } }, "variables": {}, "resources": [ { "apiVersion": "2016-01-01", "type": "Microsoft.Storage/storageAccounts", "name": "[parameters('storageName')]", "location": "[parameters('storageLocation')]", "sku": { "name": "Standard_LRS" }, "kind": "Storage", "properties": { } } ], "outputs": {} }
Step 2: Deploy the template using Azure CLI
Open up Powershell/Command prompt and execute the following command. Make sure that Azure CLI is already installed in your machine and configured to access your Azure subscription
az group deployment create --name EmptyARMDeployment --resource-group TechRepResGrp --template-file .\storage-template.json --parameters storageName=storagedemoO365 storageLocation=SouthIndia
This command is very much similar to the one we used in the earlier post, the only difference is that we supplied the values for the parameters that will be used by the template to provision the storage account
No Comments
Connecting Azure Blob Storage account using Managed Identity
Posted 12/9/2022Securing Azure KeyVault connections using Managed Identity
Posted 11/26/2022Manage application settings with Azure KeyVault
Posted 11/9/2022Adding Serilog to Azure Functions created using .NET 5
Posted 4/3/2021Learn how to split log data into different tables using Serilog in ASP.NET Core
Posted 4/23/2020