## Terraform on Azure - How to find a suitable Windows 11 Virtual Machine SKU for Terraform using Azure CLI

azure cloud terraform azurecli virtualmachine iac sku microsoft hashicorp devops

This post is about to explain how to find a proper Windows 11 SKU for a Terraform configuration file

## 1. Introduction

Would you like to create a Windows 11 Azure virtual machine using Terraform and need to get a proper SKU, which fits among others to your location? I’d like to show you how to do that in this post.

## 2. Login to your Azure subscription

First, authenticate with Azure, by conducting the login command. Open e.g.: a PowerShell command prompt and type:

    az login


A browser session should be opened, in which your Azure account credentials are requested. After entering them, you have completed the authentication.

## 3. Find a proper SKU

You would like to find an SKU that fits your location, which can be inserted in your Terraform configuration:

    source_image_reference {
publisher = "MicrosoftWindowsDesktop"
offer     = "?"
sku       = "?"
version   = "latest"
}


Let’s assume you’d like to search for proper SKUs for the location “westeurope”. For that, use the following command:

    az vm image list --offer windows-11 --location westeurope --all


You should get the following as a result:

I’ll pick the following SKU:

It will be inserted in my Terraform configuration:

    source_image_reference {
publisher = "MicrosoftWindowsDesktop"
offer     = "windows-11"
sku       = "win11-21h2-avd"
version   = "latest"
}


Finally, applying the Terraform configuration using that SKU will result in a Windows 11 virtual machine. The virtual machine, which can be seen below, has the following attributes:

• “West Europe” as location
• “windows-11” as offer
• “win11-21h2-avd” as sku

## References

learn.microsoft.com - az vm image

learn.microsoft.com - How to deploy Windows 11 on Azure