Azure Classroom Series – 13/Jul/2021

Structure and Syntax of ARM Templates

  • Refer Here for the official documentation
  • The skeleton
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "",
  "apiProfile": "",
  "parameters": {  },
  "variables": {  },
  "functions": [  ],
  "resources": [  ],
  "outputs": {  }
}
  • ARM Template Elements
    • $schema: Describes the version of template language. The version used depends on the scope of deployment and JsonEditior Preview
    • contentVersion: This represents the version of template. We can provide any value for this generally the following notation (x.x.x.x => 1.0.0.1) is recommended
    • apiProfile: An API version that servers collection of API versions for resource types
    • parameters: Values that are provided when deployment is executed
    • variables: Used and created within template to simplify template expressions
    • functions: User-defined functions that are available within the template
    • resources: Resource Types that are deployed or updated in Resource group or subscription
    • outputs: values are returned after deployment

Setting up Visual Studio code for ARM Templates

  • Install Azure Resource Manager tools extension Preview
  • This extension will help in authoring/developing arm templates

Activity 1: Create a Virtual Network

  • Lets try to create an ARM Template which will create a Virtual Network with 2 subnets

    • Virtual Network cidr range => 10.10.0.0/16 (10.10.0.0 – 10.10.255.255)
    • web subnet cidr range => 10.10.0.0/24 (10.10.0.0 – 10.10.0.255)
    • app subnet cidr rnage => 10.10.1.0/24 (10.10.1.0 – 10.10.1.255)
  • Manual Steps: Preview Preview Preview Preview Preview Preview Preview Preview

  • In this example we are creating a virtual network with two subnets. The main resource which we are creating is a virtual network

  • Writing ARM Template

    • Create a json file and create and empty template (arm!)
    • Virtual network resource documentation Refer Here
    • Refer Here for the tempalte created in the class
    • Steps:
    • Create-> Template Depoyment Preview Preview Preview Preview Preview Preview Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube