Blog Post

KQL Series – some DevOps things: Provisioning using ARM templates (dedicated to Scott)

,

I was talking to an ex-client earlier this week and he saw the drafts of my blog posts around DevOps infra-as-code spinning up Azure Data Explorer and he said – but what about ARM templates…..

Now this is a trigger. I do not like ARM templates.
But…

Some things pay the mortgage and back when we worked together I spun up their whole platform using ARM (this was before bicep was a thing).
So here it is for you Scott… you lover of ARM (and a good red wine).

Here are the steps to provision an Azure Data Explorer cluster using an ARM template.

Prerequisites:

  • An Azure subscription
  • Basic knowledge of Azure Resource Manager templates
  • Being a lover of JSON (just kidding – I have to write this…)

Step 1: Create the ARM Template The first step is to create the ARM template. The template defines the resources that will be provisioned in Azure. We’ll create a simple template that provisions an Azure Data Explorer cluster.

Here’s an example ARM template that provisions an Azure Data Explorer cluster:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.Kusto/clusters",
      "apiVersion": "2021-04-01-preview",
      "name": "[variables('adxClusterName')]",
      "location": "[variables('location')]",
      "sku": {
        "name": "Standard_L16s",
        "tier": "Standard"
      },
      "properties": {
        "enableDiskEncryption": false,
        "dataRetentionTime": "365.00:00:00",
        "trustedExternalTenants": []
      }
    }
  ],
  "variables": {
    "adxClusterName": "adx-cluster",
    "location": "[resourceGroup().location]"
  }
}

This template provisions an Azure Data Explorer cluster with the name “adx-cluster” and the SKU “Standard_L16s” in the same location as the resource group.

Step 2: Deploy the ARM Template
To deploy the ARM template, we’ll use the Azure Portal. Navigate to the resource group where you want to provision the Azure Data Explorer cluster and click on “Deploy a custom template”.

Select the “Build your own template in the editor” option and paste the ARM template code into the editor. Click “Save” and then “Review + Create”.

Review the template parameters and click “Create” to deploy the Azure Data Explorer cluster.

Step 3: Verify the Deployment
After the deployment is complete, you can verify that the Azure Data Explorer cluster was provisioned successfully. You can check the status of the cluster in the Azure Portal or use the Azure CLI to run the following command:

az kusto cluster show --name adx-cluster --resource-group MyResourceGroup

This command will return information about the Azure Data Explorer cluster, including the status and SKU.

So there you have it – yes ARM templates are “relatively” easy, but they can be horrid..
Use bicep as a first go to or my favourite – terraform.

Either way – just use infrastructure as code to do any provisioning – OK??!!

(Also Scott – when I am in Seattle next – you own me a lot of red wine)

Yip.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating