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  Google Cloud Announces Plans For First Cloud Region In Thailand To Advance The Country’s Next Phase Of Economic Development

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
Data center. Servers.
View Post
  • Data
  • Platforms
  • Software

Intel Granulate Optimizes Databricks Data Management Operations

  • November 27, 2023
View Post
  • Multi-Cloud
  • Platforms

IBM And VMware Help Enterprises Adopt Generative AI With Watsonx On Premises

  • November 14, 2023
View Post
  • Platforms

Azure Sets A Scale Record In Large Language Model Training

  • November 13, 2023
Artificial Intelligence
View Post
  • Platforms

Will Generative AI In The Cloud Become Affordable?

  • November 12, 2023
View Post
  • Platforms
  • Technology

Come Build With Us: Microsoft And OpenAI Partnership Unveils New AI Opportunities

  • November 8, 2023
AWS Graviton
View Post
  • Cloud-Native
  • Computing
  • Platforms

SAP HANA Cloud Now Supports AWS Graviton

  • November 7, 2023
Cloud
View Post
  • Cloud-Native
  • Platforms

Microsoft Introduces Cloud-Native Application Platform

  • October 26, 2023
View Post
  • Engineering
  • Platforms
  • Technology

Rockwell Automation And Microsoft Expand Partnership To Leverage Generative AI Capabilities For Enhanced Productivity And Faster Time-To-Market

  • October 26, 2023

Stay Connected!
LATEST
  • Birthday Cake 1
    How ChatGPT Altered Our World in Just One Year
    • November 30, 2023
  • OpenAI 2
    Sam Altman Returns As CEO, OpenAI Has A New Initial Board
    • November 30, 2023
  • Web 3
    Mastering the Art of Load Testing for Web Applications
    • November 29, 2023
  • Data center. Servers. 4
    Intel Granulate Optimizes Databricks Data Management Operations
    • November 27, 2023
  • Ubuntu. Chiselled containers. 5
    Canonical Announces The General Availability Of Chiselled Ubuntu Containers
    • November 25, 2023
  • Cyber Monday Sale. Guzz. Ideals collection. 6
    Decode Workweek Style with guzz
    • November 23, 2023
  • Guzz. Black Friday Specials. 7
    Art Meets Algorithm In Our Exclusive Shirt Collection!
    • November 23, 2023
  • Presents. Gifts. 8
    25 Besties Bargain Bags Below $100 This Black Friday 2023
    • November 22, 2023
  • Electronics 9
    Top 10+1 You Can’t Do Without For The Holidays: Electronics Edition.
    • November 20, 2023
  • Microsoft. Windows 10
    Ousted Sam Altman To Lead New Microsoft AI Team
    • November 20, 2023
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 | Microsoft 1
    Oracle Cloud Infrastructure Utilized by Microsoft for Bing Conversational Search
    • November 7, 2023
  • Riyadh Air and IBM 2
    Riyadh Air And IBM Sign Collaboration Agreement To Establish Technology Foundation Of The Digitally Led Airline
    • November 6, 2023
  • Ingrasys 3
    Ingrasys Unveils Next-Gen AI And Cooling Solutions At Supercomputing 2023
    • November 15, 2023
  • Cloud 4
    DigitalOcean Currents Report Finds That Adoption Of AI/ML, And Investments In Cybersecurity And Multi-Cloud Strategies Are On The Rise At Small Businesses
    • November 9, 2023
  • Portrait of Rosalynn Carter, 1993 5
    Former First Lady Rosalynn Carter Passes Away at Age 96
    • November 19, 2023
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.