In this post, I will show you how to deploy an Azure AKS cluster with Azure Resource Manager (ARM) template.
History
Since AKS is an ever-evolving product and service, there are a few ARM templates for it, and I have to say that the first releases were a bit hard to deploy because you had to specify a service principal account details and SSH key to get the deployment going.
With the below template, AKS is using a managed identity account and also using a Virtual Machine Scale Set (VMSS) which also reduces the template configuration and doesn’t require and SSH key.
Template
For this deployment, I’m using the following template:
https://github.com/Azure/azure-quickstart-templates/tree/master/101-aks-vmss-systemassigned-identity
Go ahead and clone the entire repo and copy following files to a folder.
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2020/11/image-12.png)
Deploy Template
By default the temple will name the cluster with a random name, so you would like to use a specific name edit the two values in the parameters file. You can see them below.
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2020/11/image-13.png)
To deploy the temple login to azure and set the subscription (if you have only one you don’t worry about the subscription command).
az login
az account set --subscription pay-as-you-go
To create a resource group run the following command:
az group create --name AKS-RG02 --location "West US"
The final command will start the deployment and it is shown below:
az deployment group create --name deploy001 --resource-group AKS-RG2 --template-file .\azuredeploy.json --parameters .\azuredeploy.parameters.json --verbose
After a few minutes, the AKS cluster will appear in Azure. To get started with ARM please visit this post.