Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this quickstart, you learn how to deploy a virtual machine (VM) in an Extended Zone using Azure CLI.
An Azure Resource Manager template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax. You describe your intended deployment without writing the sequence of programming commands to create the deployment.
You can also complete this quickstart using the Azure portal.
If you don't have an Azure subscription, create a free account before you begin.
Prerequisites
An Azure account with an active subscription.
Access to an Extended Zone. For more information, see Request access to an Azure Extended Zone.
Azure Cloud Shell or Azure CLI.
The steps in this article run the Azure CLI commands interactively in Azure Cloud Shell. To run the commands in the Cloud Shell, select Open Cloud Shell at the upper-right corner of a code block. Select Copy to copy the code, and paste it into Cloud Shell to run it. You can also run the Cloud Shell from within the Azure portal.
You can also install Azure CLI locally to run the commands. This article requires the Azure CLI version 2.26 or higher. Run az --version command to find the installed version. If you run Azure CLI locally, sign in to Azure using the az login command.
Review the structure
The structure for deploying a VM image in an Extended Zones using Azure CLI is similar to that of deploying a VM image in an Azure region. The main difference is that you need to specify the Extended Zone variable edge-zone and its corresponding parent region in the location variable.
Create a resource group using the az group create command.
az group create --name 'myResourceGroup' --location '<location>'Note
Each Azure Extended Zone site is associated with an Azure region. Based on the Azure Extended Zone location where the resource needs to be deployed, select the appropriate region value for the
locationparameter.Deploy the desired vm image. For this example, we're using the Windows Server 2022 Datacenter image, to be deployed in the Perth Extended Zone.
az vm create --resource-group myResourceGroup --name myVMName --image Win2022Datacenter --size Standard_DS4_v2 --edge-zone perth --location australiaeast
Clean up resources
When no longer needed, delete myResourceGroup resource group and all of the resources it contains using the az group delete command.
az group delete --name myResourceGroup