Azure Classroomnotes 20/Oct/2022

JSON

  • Is data represenation language, used in data transport/representation between client and servers. It is also used for configuration purposes.
  • It is collection of name value pairs. There are three categories of data
    • simple/scalar
    • plural/list
    • dictionary/object

ARM Templates

  • While creating ARM Templates the JSON structure is defined by Azure
  • The template syntax/structure Refer Here
  • Structure
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "",
  "apiProfile": "",
  "parameters": {  },
  "variables": {  },
  "functions": [  ],
  "resources": [  ],
  "outputs": {  }
}
  • Minimal ARM template (only required values)
{
    "$schema": "",
    "contentVersion": "",
    "resources": []
}
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "0.0.1",
    "resources": []
}
  • Refer Here for understanding resources.
  • Resource structure:
{
    "type": "",
    "apiVersion": "",
    "properties": {

    },
    "arguments": ""
}
  • To find out resource structure Refer Here
    Preview
  • Refer Here for arm template syntax for resource group.
  • Configure visual studio code: Refer Here
  • Install ARM Tools extension
    Preview

Hello-ARM Template (First template)

  • Create a new folder and open with vscode
  • Create a new file template.json with the following content
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "0.0.1",
    "resources": []
}
  • Now lets try to add an virtual network. Refer Here
  • Refer Here for resource format
  • Refer Here
  • Refer Here for the template created.
  • Now create a resource group and click on create and select the template deployment
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
    Preview
  • Now delete the resource group to clean up

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner