aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • DevOps
  • Platforms

How To Provision Using Azure Resource Manager (ARM) Templates

  • root
  • January 8, 2020
  • 4 minute read

Overview

Azure Resource Manager or ARM templates is one of the ways for deploying or creating resources in Azure. It is an Infrastructure as a code solution that uses the JavaScript Object Notation (JSON) to define the target deployment of resources. It is similar to Google Cloud Platform’s Deployment Manager which uses YAML and Amazon Web Service Ansible which is also in YAML format.

This guide shows how to create and run ARM templates through the Azure portal.


Partner with aster.cloud
for your next big idea.
Let us know here.



From our partners:

CITI.IO :: Business. Institutions. Society. Global Political Economy.
CYBERPOGO.COM :: For the Arts, Sciences, and Technology.
DADAHACKS.COM :: Parenting For The Rest Of Us.
ZEDISTA.COM :: Entertainment. Sports. Culture. Escape.
TAKUMAKU.COM :: For The Hearth And Home.
ASTER.CLOUD :: From The Cloud And Beyond.
LIWAIWAI.COM :: Intelligence, Inside and Outside.
GLOBALCLOUDPLATFORMS.COM :: For The World's Computing Needs.
FIREGULAMAN.COM :: For The Fire In The Belly Of The Coder.
ASTERCASTER.COM :: Supra Astra. Beyond The Stars.
BARTDAY.COM :: Prosperity For Everyone.

Prerequisites

  • Credential access to the Azure Portal
  • Sufficient access or role for provisioning a Virtual Machine. In this demo, a VM will be provisioned, but your access needs might change depending on the resource you will create.

 

01. Login through the Azure portal at https://portal.azure.com/

 

02. On the top bar, search for “Deploy a custom template”

 

 

03. Select the “Build your own template in the editor” option.

 

04. The template editor will be shown. You can either paste the following template into the editor or save the following template in a local file and upload it using the “Load file” option.

 

The following template provision


{

    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "location": {
            "type": "string"
        },

        "networkInterfaceName": {
            "type": "string"
        },

        "networkSecurityGroupName": {
            "type": "string"
        },

        "networkSecurityGroupRules": {
            "type": "array"
        },

        "subnetName": {
            "type": "string"
        },

        "virtualNetworkName": {
            "type": "string"
        },

        "addressPrefixes": {
            "type": "array"
        },

        "subnets": {
            "type": "array"
        },

        "publicIpAddressName": {
            "type": "string"
        },

        "publicIpAddressType": {
            "type": "string"
        },

        "publicIpAddressSku": {
            "type": "string"
        },

        "virtualMachineName": {
            "type": "string"
        },

        "virtualMachineRG": {
            "type": "string"
        },

        "osDiskType": {
            "type": "string"
        },

        "virtualMachineSize": {
            "type": "string"
        },

        "adminUsername": {
            "type": "string"
        },

        "adminPublicKey": {
            "type": "secureString"
        },

        "diagnosticsStorageAccountName": {
            "type": "string"
        },

        "diagnosticsStorageAccountId": {
            "type": "string"
        },

        "diagnosticsStorageAccountType": {
            "type": "string"
        },

        "diagnosticsStorageAccountKind": {
            "type": "string"
        }
    },

    "variables": {
        "nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",

        "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",

        "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"
    },

    "resources": [
        {
            "name": "[parameters('networkInterfaceName')]",
            "type": "Microsoft.Network/networkInterfaces",
            "apiVersion": "2019-07-01",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
                "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
                "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
            ],

            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig1",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef')]"
                            },
                            "privateIPAllocationMethod": "Dynamic",
                            "publicIpAddress": {
                                "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
                            }
                        }
                    }
                ],

                "networkSecurityGroup": {
                    "id": "[variables('nsgId')]"
                }
            }
        },

        {
            "name": "[parameters('networkSecurityGroupName')]",
            "type": "Microsoft.Network/networkSecurityGroups",
            "apiVersion": "2019-02-01",
            "location": "[parameters('location')]",
            "properties": {
                "securityRules": "[parameters('networkSecurityGroupRules')]"
            }
        },

        {
            "name": "[parameters('virtualNetworkName')]",
            "type": "Microsoft.Network/virtualNetworks",
            "apiVersion": "2019-04-01",
            "location": "[parameters('location')]",
            "properties": {
                "addressSpace": {
                    "addressPrefixes": "[parameters('addressPrefixes')]"
                },
                "subnets": "[parameters('subnets')]"
            }
        },

        {
            "name": "[parameters('publicIpAddressName')]",
            "type": "Microsoft.Network/publicIpAddresses",
            "apiVersion": "2019-02-01",
            "location": "[parameters('location')]",
            "properties": {
                "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
            },

            "sku": {
                "name": "[parameters('publicIpAddressSku')]"
            }
        },

        {
            "name": "[parameters('virtualMachineName')]",
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2019-07-01",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
                "[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
            ],
            "properties": {
                "hardwareProfile": {
                    "vmSize": "[parameters('virtualMachineSize')]"
                },

                "storageProfile": {
                    "osDisk": {
                        "createOption": "fromImage",
                        "managedDisk": {
                            "storageAccountType": "[parameters('osDiskType')]"
                        }
                    },

                    "imageReference": {
                        "publisher": "Canonical",
                        "offer": "UbuntuServer",
                        "sku": "18.04-LTS",
                        "version": "latest"
                    }
                },

                "networkProfile": {
                    "networkInterfaces": [
                        {
                            "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
                        }
                    ]
                },

                "osProfile": {
                    "computerName": "[parameters('virtualMachineName')]",
                    "adminUsername": "[parameters('adminUsername')]",
                    "linuxConfiguration": {
                        "disablePasswordAuthentication": true,
                        "ssh": {
                            "publicKeys": [
                                {
                                    "path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]",
                                    "keyData": "[parameters('adminPublicKey')]"
                                }
                            ]
                        }
                    }
                },

                "diagnosticsProfile": {
                    "bootDiagnostics": {
                        "enabled": true,
                        "storageUri": "[concat('https://', parameters('diagnosticsStorageAccountName'), '.blob.core.windows.net/')]"
                    }
                }
            }
        },

        {
            "name": "[parameters('diagnosticsStorageAccountName')]",
            "type": "Microsoft.Storage/storageAccounts",
            "apiVersion": "2019-06-01",
            "location": "[parameters('location')]",
            "properties": {},
            "kind": "[parameters('diagnosticsStorageAccountKind')]",
            "sku": {
                "name": "[parameters('diagnosticsStorageAccountType')]"
            }
        }
    ],

    "outputs": {
        "adminUsername": {
            "type": "string",
            "value": "[parameters('adminUsername')]"
        }
    }
}

 

Read More  How To Provision A Resource Group, Virtual Network And Virtual Machine In Azure

Paste the code or upload the template file. Then select the “Save” button.

 

05. A new page will be shown with the JSON template loaded as form field. You must now specify the required parameters.

 

Or you can click on the “Edit parameters” to load a JSON file parameters. Use the following JSON as parameters.

 

Set the parameters as below. Then click on the “Save” button.


{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",

    "parameters": {
        "location": {
            "value": "southeastasia"
        },

        "networkInterfaceName": {
            "value": "vm-zo-geek-001328"
        },

        "networkSecurityGroupName": {
            "value": "vm-zo-geek-001-nsg"
        },

        "networkSecurityGroupRules": {
            "value": [
                {
                    "name": "SSH",
                    "properties": {
                        "priority": 300,
                        "protocol": "TCP",
                        "access": "Allow",
                        "direction": "Inbound",
                        "sourceAddressPrefix": "*",
                        "sourcePortRange": "*",
                        "destinationAddressPrefix": "*",
                        "destinationPortRange": "22"
                    }
                }
            ]
        },

        "subnetName": {
            "value": "default"
        },

        "virtualNetworkName": {
            "value": "rg-development-vnet"
        },

        "addressPrefixes": {
            "value": [
                "10.0.0.0/24"
            ]
        },

        "subnets": {
            "value": [
                {
                    "name": "default",
                    "properties": {
                        "addressPrefix": "10.0.0.0/24"
                    }
                }
            ]
        },

        "publicIpAddressName": {
            "value": "vm-zo-geek-001-ip"
        },

        "publicIpAddressType": {
            "value": "Dynamic"
        },

        "publicIpAddressSku": {
            "value": "Basic"
        },

        "virtualMachineName": {
            "value": "vm-zo-geek-001"
        },

        "virtualMachineRG": {
            "value": "rg-development"
        },

        "osDiskType": {
            "value": "Standard_LRS"
        },

        "virtualMachineSize": {
            "value": "Standard_D2s_v3"
        },

        "adminUsername": {
            "value": "devops"
        },

        "adminPublicKey": {
            "value": null
        },

        "diagnosticsStorageAccountName": {
            "value": "rgdevelopmentdiag428"
        },

        "diagnosticsStorageAccountId": {
            "value": "Microsoft.Storage/storageAccounts/rgdevelopmentdiag428"
        },

        "diagnosticsStorageAccountType": {
            "value": "Standard_LRS"
        },

        "diagnosticsStorageAccountKind": {
            "value": "Storage"
        }
    }
}

 

 

06. The parameters will now be loaded in the template, with the form field text boxes filled.

 

07. In this example, being an Ubuntu OS, a Public Key is needed for accessing the server. You can create an RSA key from the following link or any tool that creates the SSH key.

 

08. Accept the Terms and Conditions by selecting the checkbox. Then click on the “Purchase” button.

 

09. Wait until the resources, in this case, a Virtual Machine and its required resources (Virtual Network, IP Address, Storage Account and others) are created.

 

 

10. View the Virtual Machine resource. You can also view the other resources created by viewing the Resource Group.


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Our humans need coffee too! Your support is highly appreciated, thank you!

root

Related Topics
  • Azure
  • Azure Resource Manager
  • Templates
You May Also Like
Google Cloud and Smart Communications
View Post
  • Platforms
  • Technology

Smart Communications, Inc. Dials into Google Cloud AI to Help Personalize Digital Services for Filipinos

  • October 25, 2024
View Post
  • Platforms
  • Public Cloud

Empowering builders with the new AWS Asia Pacific (Malaysia) Region

  • August 30, 2024
Red Hat and Globe Telecoms
View Post
  • Platforms
  • Technology

Globe Collaborates with Red Hat Open Innovation Labs to Modernize IT Infrastructure for Greater Agility and Scalability

  • August 19, 2024
Huawei Cloud Cairo Region Goes Live
View Post
  • Cloud-Native
  • Computing
  • Platforms

Huawei Cloud Goes Live in Egypt

  • May 24, 2024
Asteroid
View Post
  • Computing
  • Platforms
  • Technology

Asteroid Institute And Google Cloud Identify 27,500 New Asteroids, Revolutionizing Minor Planet Discovery With Cloud Technology

  • April 30, 2024
IBM
View Post
  • Hybrid Cloud
  • Platforms

IBM To Acquire HashiCorp, Inc. Creating A Comprehensive End-to-End Hybrid Cloud Platform

  • April 24, 2024
View Post
  • Platforms
  • Technology

Canonical Delivers Secure, Compliant Cloud Solutions for Google Distributed Cloud

  • April 9, 2024
Redis logo
View Post
  • Platforms
  • Software

Redis Moves To Source-Available Licenses

  • April 2, 2024

Stay Connected!
LATEST
  • 1
    Pulsant targets partner diversity with new IaaS solution
    • May 23, 2025
  • 2
    Growing AI workloads are causing hybrid cloud headaches
    • May 23, 2025
  • Gemma 3n 3
    Announcing Gemma 3n preview: powerful, efficient, mobile-first AI
    • May 22, 2025
  • 4
    Google is getting serious on cloud sovereignty
    • May 22, 2025
  • oracle-ibm 5
    Google Cloud and Philips Collaborate to Drive Consumer Marketing Innovation and Transform Digital Asset Management with AI
    • May 20, 2025
  • 6
    Hybrid cloud is complicated – Red Hat’s new AI assistant wants to solve that
    • May 20, 2025
  • notta-ai-header 7
    Notta vs Fireflies: Which AI Transcription Tool Deserves Your Attention in 2025?
    • May 16, 2025
  • 8
    Cloud adoption isn’t all it’s cut out to be as enterprises report growing dissatisfaction
    • May 15, 2025
  • college-of-cardinals-2025 9
    The Definitive Who’s Who of the 2025 Papal Conclave
    • May 7, 2025
  • conclave-poster-black-smoke 10
    The World Is Revalidating Itself
    • May 6, 2025
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • oracle-ibm 1
    IBM and Oracle Expand Partnership to Advance Agentic AI and Hybrid Cloud
    • May 6, 2025
  • 2
    Conclave: How A New Pope Is Chosen
    • April 25, 2025
  • Getting things done makes her feel amazing 3
    Nurturing Minds in the Digital Revolution
    • April 25, 2025
  • 4
    Canonical Releases Ubuntu 25.04 Plucky Puffin
    • April 17, 2025
  • 5
    United States Army Enterprise Cloud Management Agency Expands its Oracle Defense Cloud Services
    • April 15, 2025
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.