skip to Main Content

Azure newbie –
I manually created an azure data lake gen 2 storage account. I clicked on the JSON View icon and was presented with a JSON string containing all the information about the storage account. Is it possible to use that JSON string as part of a script to create the storage account?

enter image description here

2

Answers


  1. According to this, the ARM template to create ADLS account should be in the following format:

    {
      "type": "Microsoft.DataLakeStore/accounts",
      "apiVersion": "2016-11-01",
      "name": "string",
      "location": "string",
      "tags": {
        "tagName1": "tagValue1",
        "tagName2": "tagValue2"
      },
      "identity": {
        "type": "SystemAssigned"
      },
      "properties": {
        "defaultGroup": "string",
        "encryptionConfig": {
          "keyVaultMetaInfo": {
            "encryptionKeyName": "string",
            "encryptionKeyVersion": "string",
            "keyVaultResourceId": "string"
          },
          "type": "string"
        },
        "encryptionState": "string",
        "firewallAllowAzureIps": "string",
        "firewallRules": [
          {
            "name": "string",
            "properties": {
              "endIpAddress": "string",
              "startIpAddress": "string"
            }
          }
        ],
        "firewallState": "string",
        "newTier": "string",
        "trustedIdProviders": [
          {
            "name": "string",
            "properties": {
              "idProvider": "string"
            }
          }
        ],
        "trustedIdProviderState": "string",
        "virtualNetworkRules": [
          {
            "name": "string",
            "properties": {
              "subnetId": "string"
            }
          }
        ]
      }
    }
    

    However, the JSON view of ADLS is not in the required format, so it is not possible to use an Azure ADLS JSON-View as part of a deployment script. Modify the JSON according to the above format, save it as a JSON file, and upload it to PowerShell as shown below:

    enter image description here

    Execute the following command to deploy the ADLS account:

    az deployment group create --resource-group "<resourceGroupName>" --template-file <fileName>.json
    

    This will deploy the ADLS account as shown below:

    enter image description here

    Login or Signup to reply.
  2. No, that is not the right JSON. Most resources have an "Export Template" options in the Azure Portal on the lefthand menu in section "Automation" (See the docs). This allows you to generate the ARM template that can be used in a deployment pipeline or by running az deployment or a powershell command as documented here.

    Example:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search