Deploy to Azure with using the ARM template blueprint

Azure Resource Manager (ARM) allows users to deploy applications to Azure using declarative JSON templates. In the DevOps as Code CLI, you can use the Basic ARM Template to run blueprints on platforms hosted on Azure, by creating ARM templates. This can greatly simplify the process of provisioning resources from Deploy and Release in an Azure environment.

This tutorial will enable you to use the Azure ARM template to deploy a resource group VM in Azure. The blueprint will generate an ARM JSON template and a set of YAML files defining the deployment model and then allow you to run a release in Release which triggers the resource group creation in Deploy.

Before you get started

The following resources will help to get started with Azure blueprints:

Familiarize yourself with Azure template structure and syntax.

Make sure your Azure account is correctly configured, with at least the following elements:

  • Azure CLI
  • Subscription ID
  • Service principal, with a Tenant ID, Client ID, and Client secret value

For more information on obtaining these values, see the microservice-ecommerce blueprint.

Note: Ensure that you have the AZ CLI and you are signed in.

Minimum Required versions

This blueprint version requires at least the below versions of the specified tools to work properly.

Release: Version 9.0.0 Deploy: Version 9.0.0 XL CLI: Version 9.0.0

Information required

This blueprint will ask for the following information:

  • Subscription ID
  • Client ID
  • Client secret
  • Tenant ID
  • Resource group to create
  • An Azure region to create the resource group (e.g. westus)
  • Name of the Azure app. This will also be used as the name of the Release and Deploy CIs.
  • Name of the template file to create (e.g. ../arm/template.json)
  • Username and password for the admin account

This can be entered into an answers file and passed using the -a flag in the blueprint command.

Run the blueprint

To use this blueprint, run xl blueprint in an empty directory and select azure/basic-arm-template from the list. Fill in the answers and run the blueprint.

The blueprint will generate:

  • A batch of YAML templates which will create the necessary configuration items in Release and Deploy.
  • An ARM template which can be deployed from your Release and Deploy instances. This will create the resource group you defined when it is run.

Deploy the ARM template

Log into Release. You will see a new design template with the name of the Azure app. Create and run a new release from the template.

When the release is finished, log into your Azure account. You will see the Resource Group which you created from the template.