Know about Windows virtual machine and Template Library

  1. Home
  2. Know about Windows virtual machine and Template Library

This tutorial will help you to learn how to create a Windows virtual machine by using an Azure Resource Manager template and Azure PowerShell from the Azure Cloud shell. The template used in this article creates a new virtual network with a single subnet and a single virtual machine running Windows Server.

Create a virtual machine

Creating an Azure virtual machine usually includes two steps:

  • Firstly, Create a resource group. An Azure resource group is a logical container into which Azure resources are deployed and managed. A resource group must be created before a virtual machine.
  • Lastly, Create a virtual machine.

What are ARM templates?

  • Many teams have adopted agile development approaches as a result of the transition to the cloud.
  • These groups iterate often. As they must be able to deploy their solutions to the cloud on a regular basis and have confidence in their infrastructure.
  • Thirdly, the distinction between operations and development has vanished since infrastructure has become a part of the iterative process. Teams must use a single methodology to manage infrastructure and application code.
  • You may automate deployments and leverage the infrastructure as code methodology to overcome these difficulties. The infrastructure that needs to be installed is defined in code. Your infrastructure code is incorporated into your project.
  • Further, infrastructure code, like application code, is stored in a source repository and versioned. The code may be executed by anybody on your team, and comparable environments can be deployed.
  • Use Azure Resource Manager (ARM) templates to deploy infrastructure as code for your Azure solutions.

Why choose ARM templates?

Consider the following advantages of using templates:

  • Declarative syntax
  • Repeatable results
  • Orchestration
  • Modular files
  • Extensibility etc.
Know about Windows virtual machine and Template Library
Image Source – Microsoft

Template file

You may use template expressions to expand JSON’s capabilities within your template. The functions supplied by Resource Manager are used in these phrases.

The template has the following sections:

  • Firstly, Parameters – Provide values during deployment that allow the same template to be used with different environments.
  • Secondly, Variables – Define values that are reused in your templates. They can be constructed from parameter values.
  • Thirdly, User-defined functions – Create customized functions that simplify your template.
  • Subsequently, Resources – Specify the resources to deploy.
  • Lastly, Outputs – Return values from the deployed resources.

Template design

It’s totally up to you and how you want to manage your solution how you establish templates and resource groups. You may, for example, deploy your three-tier application to a single resource group using a single template.

three tier template
Image Source – Microsoft

You don’t have to specify your complete architecture in one template, though. It’s often a good idea to break down your deployment needs into a set of targeted, purpose-specific templates. You may also simply reuse these templates for a variety of solutions. To deploy a solution, you must first construct a master template that connects all of the necessary templates. The graphic below illustrates how to install a three-tier solution using a parent template with three nested templates.

nested tier template Know about Windows virtual machine and Template Library
Image Source – Microsoft

Also, If you envision your tiers having separate lifecycles, you can deploy your three tiers to separate resource groups. Notice the resources can still be linked to resources in other resource groups.

tier template
Image Source – Microsoft
free practice test for AZ- 303

Go back to home page

Reference documentation – Create a Windows virtual machine from a Resource Manager template

What are ARM templates?

Menu