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.
Applies to: ✔️ Linux VMs ✔️ Windows VMs
This article steps through using the Azure portal to create highly resilient virtual machines in availability zones. Azure availability zones are physically separate locations within each Azure region that are tolerant to local failures. Use availability zones to protect your applications and data against unlikely datacenter failures.
To use availability zones, create your virtual machines in a supported Azure region.
Sign in to the Azure portal.
Click Create a resource > Compute > Virtual machine.
In the Virtual machines page, select Create and then Virtual machine. The Create a virtual machine page opens.
In the Basics tab, under Project details, make sure the correct subscription is selected and then choose a resource group or create a new one.
Under Instance details, type a name for the Virtual machine name.
For Availability options, leave the default of Availability zone.
For Availability zone, the drop-down defaults to Zone 1.
Complete the rest of the page as usual. If you want to create a load balancer, go to the Networking tab > Load Balancing > Load balancing options. You can choose either an Azure load balancer or an Application gateway.
For an Azure load balancer:
- You can select an existing load balancer.
- To create a new load balancer, for Load balancer name type a load balancer name.
- Select the Type of load balancer, either Public or Internal.
- Select the Protocol, either TCP or UDP.
- You can leave the default Port and Backend port, or change them if needed. The backend port you select will be opened up on the Network Security Group (NSG) of the VM.
- When you're done, select Create.
For an Application Gateway:
- Select an existing application gateway.
- To create a new gateway, type the name for the application gateway. The Application Gateway can load balance multiple applications. Consider naming the Application Gateway according to the workloads you wish to load balance, rather than specific to the virtual machine name.
- In Routing rule, type a rule name. The rule name should describe the workload you are load balancing.
- For HTTP load balancing, you can leave the defaults and then select Create. For HTTPS load balancing, you have two options:
- Upload a certificate and add the password (application gateway manages certificate storage). For certificate name, type a friendly name for the certificate.
- Use a key vault (application gateway will pull a defined certificate from a defined key vault). Select your Managed identity, Key Vault, and Certificate.
Important
After the VMs and application gateway are deployed, log in to the VMs to ensure that either the application gateway certificate is uploaded onto the VMs or the domain name of the VM certificate matches with the domain name of the application gateway.
Note
A separate subnet will be defined for Application Gateway upon creation. For more information, see Application Gateway infrastructure configuration.
Leave the remaining defaults and then select the Review + create button at the bottom of the page.
On the Create a virtual machine page, you can see the details about the VM you are about to create. When you're ready, select Create.
If you are creating a Linux VM and the Generate new key pair window opens, select Download private key and create resource. Your key file will download as myKey.pem.
When the deployment is finished, select Go to resource.
Next steps
In this article, you learned how to create a VM in an availability zone. Learn more about availability for Azure VMs.