Deployment using the Azure CLI

The Azure CLI stands for command-line interface and helps to interface and automate resources in Azure across operating systems and programming languages. The Azure CLI must be installed before using it to deploy templates. To install the Azure CLI, please follow the steps at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli.

Once the Azure CLI is installed, open the command prompt in Windows and run the following command:

Az login

This command generates a unique code that should be used with the URL provided by the same command. Clicking on Continue will prompt for your credentials. After successful authentication, you will see the following screen:

The command prompt will display all subscriptions the user is assigned.

Execute the following command on the command prompt to create a new Resource group named CLIDeployment in the West Europe location:

az group create --name CLIDeployment --location "West Europe"

The command runs as follows:

Execute the following command to deploy our previously-authored template to the newly-created resource group:

az group deployment create --name CLIDeploy1 --resource-group CLIDeployment --template-file C:\Users\rites\source\repos\MyFirstTemplate\MyFirstTemplate\azuredeploy.json --parameters storageAccountName=unique824798

This should deploy the template and results in the following successful execution: