DevOps Basics: Deploy an Azure Resource Manager template with Visual Studio Team Services

Play DevOps Basics: Deploy an Azure Resource Manager template with Visual Studio Team Services
Sign in to queue


When you are using Azure, you are consuming resources. For example, when you want to deploy one virtual machine, in fact you also need one storage account to store the virtual hard disk on it, one network interface to have an internal IP, etc... It's the concept of Azure Resource Manager (ARM).

Azure Resource Manager is like a lego box, and you can build your environments on it.

So now, imagine you are developing an application, a website or a simple script, and the result of this development will be deployed on Azure or you simply want to test it on a brand new environment. The concept will be to prepare your destination on Azure : a WebApp + SQL or a Virtual Machine, etc...

In this mindset, you don't want to manually recreate everytime your environment through the portal, right ?

One of the concepts about DevOps is automatization. When you're using Azure and want automate your resources deployment, the best practices will be to use an ARM Template with all your Azure resources already configured : VM Size, DNS name, IP, etc... To do that you need to create a JSON file.

This concept's name is : Insfrastructure as Code (IaC).

The best way to train yourself on ARM and see how it looks like, is to clone the Azure Quickstart Templates : and read this previous article : DevOps Basics: Infrastructure as Code – ARM Templates

After this quick introduction, let's see how to automatically deploy an ARM template on an Azure Subscription. Like I said, in a development flow, at high level we have : CODE + TEST + DEPLOY

I'll use this basic ARM template :

I'll use Visual Studio Team Services (VSTS) as a repository. I'll create a project, push my template, and automatically deploy the content of this template on an Azure Subscription. Also, every time I will update this template, I will also want to update my resources on Azure.


Read more here on CANITPRO.NET


Azure, VSTS, devops



Download this episode

The Discussion

  • User profile image

    How can we protect/hide the password? Storing it in code in cleartext is not great practice!

  • User profile image

    @Charles: we can store the password in azure keyvault,

    New-AzureRmKeyVault -VaultName '<name>' -ResourceGroupName '<resource group name>' -Location '<location>'

    $Secret = ConvertTo-SecureString -String '<password>' -AsPlainText -Force

    $secretvalue = Set-AzureKeyVaultSecret -VaultName '<name>' -Name '<secret name>' -SecretValue $Secret

    Set-AzureRmKeyVaultAccessPolicy -VaultName <valut name> -EnabledForTemplateDeployment


    "sqlServerPrimaryAdminPassword": {
    "reference": {
    "keyVault": {
    "id": "<reference ID path>"
    "secretName": "<secret name>"

Add Your 2 Cents