Contents tagged with ARM Templates

  • 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 storageLocation for accepting the name of the resource as well as the location where it needs to be provisioned

    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": {}
    }