Step-By-Step: Introduction to Azure Command Line Interface (CLI) with Azure Arm Templates
Tags: azure, azurecli, armtemplates
Published: 2019-03-20 19:48:00

---
title: Step-By-Step: Introduction to Azure Command Line Interface (CLI) with Azure Arm Templates
published: True
tags: Azure, Azure CLI, ARM Templates
canonical_url: https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/Step-By-Step-Introduction-to-Azure-Command-Line-Interface-CLI/ba-p/359138
---

Written By @JayDestro

Working with Azure Resource Manager Templates provides you with a way to codify your infrastructure using JSON!  In this tutorial we'll show you how to get started with using different parameters along side with your template.  

 

[From the Azure Resource Manager Overview:](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview/?WT.mc_id=armapache-youtube-jagord)

 

> Azure Resource Manager is the deployment and management service for Azure. It provides a consistent management layer that enables you to create, update, and delete resources in your Azure subscription. You can use its access control, auditing, and tagging features to secure and organize your resources after deployment.
> 
>  
> 
> When you take actions through the portal, PowerShell, Azure CLI, REST APIs, or client SDKs, the Azure Resource Manager API handles your request. Because all requests are handled through the same API, you see consistent results and capabilities in all the different tools. All capabilities that are available in the portal are also available through PowerShell, Azure CLI, REST APIs, and client SDKs. Functionality initially released through APIs will be represented in the portal within 180 days of initial release.
> 
> The following image shows how all the tools interact with the Azure Resource Manager API. The API passes requests to the Resource Manager service, which authenticates and authorizes the requests. Resource Manager then routes the requests to the appropriate service.
> 
>  

With Resource Manager, you can create a template (in JSON format) that defines the infrastructure and configuration of your Azure solution. By using a template, you can repeatedly deploy your solution throughout its lifecycle and have confidence your resources are deployed in a consistent state.

 

<li-video size="large" align="center" height="338" width="600" vid="https://youtu.be/T2tpEyN0aQw" uploading="false" thumbnail="" external="url"></li-video>

 

To follow along with this tutorial it's recommended you have:

 

- Azure Account
- Some Bash shell experience
- General understanding of scripting/programming

Important links you'll need to have:

 

[Parameters section of Azure Resource Manager templates](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-templates-parameters?WT.mc_id=armapache-youtube-jagord)

[Deploy resources with Resource Manager templates and Azure CLI](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-deploy-cli/?WT.mc_id=armapache-youtube-jagord)

[ubuntu-apache-test-page GitHub Repo](https://github.com/Azure/azure-quickstart-templates/tree/master/ubuntu-apache-test-page)

 

 

 

To create a resource group:

 

 

```
az group create -l centralus -n \<insert your preferred name here\>
```

 

 

Basic deploy of an ARM template:

 

 

```
az group deployment create --name \<your-deploy-name\> --resource-group \<your resource group name\> --template-file azuredeploy.json
```

 

 

Deploy with specified parameters:

 

 

```
az group deployment create --name \<your deployment group\> --resource-group=\<your resource group name\> --template-file azuredeploy.json --parameter location=eastus testPageTitle="demo jay" testPageBody="\<p\>This is a really cool test page.\</p\>" adminUsername=\<your preferred username\> adminPassword=\<your preferred password\> dnsNameForPublicIP=\<your preferred hostname\>
```

 

 

Have additional questions about this tutorial?  Feel free to leave a message below.