Deploy to Azure using an Empty Azure Resource Manager Templates - Part #2

In the earlier post, I went through the basic concepts and terminologies for deploying resources using the Azure Resource Manager(ARM) templates. Please refer it using this link for quick reference. In this post, I will show you how to perform a deployment using an empty ARM template.

Step 1: Create an empty template

Create an empty template like the one given below using any text editor. Save as a JSON file with any name you want. In my case, I named it as EmptyTemplate.json

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
  },
  "variables": {
  },
  "resources": [
  ],
  "outputs": {
  }
}

Step 2: Configure Azure CLI

I am going to use Azure CLI for doing the deployment. Before you start deploying, make sure that your local machine has got Azure CLI installed and configured correctly. Azure CLI is a cross-platform tool is available for download from here, which helps you to connect to your Azure subscription and execute various commands to manage and monitor it.

The best way to verify it's installed or not by executing the below command.

az --version

If everything is fine with your machine, we can move on and connect to an Azure subscription using,

az login

When this command is executed, it will give you a code which needs to be entered into a page using the URL provided in the message from the browser. Once you submit that, your request will be authenticated and will show the list of subscription(s) upon successful operation

Step 3: Create a resource group


As I mentioned in the earlier post, every resource must reside in a resource group in Azure. For that, let's create one

az group create --name TechRepResGrp --location "South India"

 

Step 4: Deploy using Empty Template

Now in the PowerShell window, go to the folder where you have saved the template file and execute the below command.

az group deployment create --name EmptyARMDeployment --resource-group TechRepResGrp --location "South India" --template-file EmptyTemplate.json

This will create a deployment with the mentioned name in the resource group provided in the command. You can verify it by going to the portal and see our's under the Deployment section.

Since we used an empty template it won't be creating any resources. So in the next post, I will guide you to provision various resources using ARM templates. 


No Comments

Add a Comment