This project deploys a complete Azure Virtual Desktop environment using a modular architecture following Azure best practices. The infrastructure is organized into logical modules for better maintainability, reusability, and management.
| Document | Description |
|---|---|
| ARCHITECTURE.md | Detailed architecture overview and module design |
| DEPLOYMENT-OPTIONS.md | Comparison of deployment methods (ARM vs Terraform) |
| NEW-FEATURES.md | Latest features and enhancements |
| DEPLOY-WIZARD-GUIDE.md | Step-by-step Azure Portal deployment wizard guide |
| INTEGRATION-GUIDE.md | Integration with existing Azure environments |
| EXAMPLE-ALL-FEATURES.md | Example configuration with all features enabled |
| RECOMMENDATIONS.md | Best practices and recommendations |
Click the Deploy to Azure button above to launch the deployment wizard in Azure Portal. The wizard will guide you through:
# Clone this repository (or copy the files to your local directory)
cd azure-avd-terraform-accelerator
# Copy the example variables file
cp terraform.tfvars.example terraform.tfvars
Edit terraform.tfvars with your specific values:
resource_prefix = "mycompany-avd"
location = "East US"
environment = "prod"
# Update with your corporate network CIDR
corporate_network_cidr = "203.0.113.0/24"
# Customize session host configuration
session_host_count = 5
vm_sku_size = "Standard_D4s_v5"
# Configure tags for your organization
tags = {
Owner = "IT Department"
CostCenter = "12345"
Application = "Azure Virtual Desktop"
Project = "AVD Migration"
}
# Initialize Terraform
terraform init
# Review the planned changes
terraform plan
# Deploy the infrastructure
terraform apply
The deployment typically takes 15-20 minutes to complete.
After successful deployment:
# Get the application group name from outputs
APP_GROUP_NAME=$(terraform output -raw avd_application_group_name)
# Assign users (replace with actual user principal names)
az role assignment create \
--role "Desktop Virtualization User" \
--assignee "user@yourdomain.com" \
--scope "/subscriptions/$(az account show --query id -o tsv)/resourceGroups/$(terraform output -raw resource_group_name)/providers/Microsoft.DesktopVirtualization/applicationGroups/$APP_GROUP_NAME"
ARM Template vs Terraform: This repo supports two deployment paths. The Deploy to Azure button uses the ARM template (
azuredeploy.json) for a guided portal experienceβideal for quick evaluations or teams that prefer a UI. Terraform (main.tf+ modules) provides full control, modularity, and CI/CD integrationβrecommended for production environments. See DEPLOYMENT-OPTIONS.md for a detailed comparison.
The deployment creates the following resources:
Before deploying this AVD environment, ensure you have:
az login to authenticateaz provider register --namespace Microsoft.DesktopVirtualization
az provider register --namespace Microsoft.Storage
az provider register --namespace Microsoft.KeyVault
az provider register --namespace Microsoft.OperationalInsights
az provider register --namespace Microsoft.Compute
az provider register --namespace Microsoft.Network
azure-avd-terraform-accelerator/
βββ main.tf # Root Terraform configuration
βββ variables.tf # Core variable definitions
βββ variables_new_modules.tf # Variables for extended modules
βββ outputs.tf # Output definitions
βββ versions.tf # Provider and Terraform version constraints
βββ terraform.tfvars.example # Example variables file
βββ terraform-all-features.tfvars.example # Example with all features enabled
βββ azuredeploy.json # ARM template for Azure Portal deployment
βββ createUiDefinition.json # Azure Portal deployment wizard UI
βββ deploy.sh # Deployment helper script
βββ modules/
β βββ avd/ # AVD host pool, app group, workspace
β βββ backup/ # Azure Backup vault and policies
β βββ compute/ # Session host VMs and extensions
β βββ image_gallery/ # Azure Compute Gallery and image definitions
β βββ monitoring/ # Log Analytics, diagnostics, alerts
β βββ networking/ # VNet, subnet, NSG configuration
β βββ policy/ # Azure Policy assignments
β βββ security/ # Key Vault, encryption, identity
β βββ storage/ # FSLogix profile storage
βββ README.md # This file
The networking module supports both creating new infrastructure and using existing VNets/subnets:
# terraform.tfvars
use_existing_vnet = false
create_new_subnet = true
vnet_address_space = ["10.0.0.0/16"]
subnet_address_prefixes = ["10.0.1.0/24"]
# terraform.tfvars
use_existing_vnet = true
existing_vnet_name = "my-company-vnet"
existing_vnet_resource_group = "network-rg"
create_new_subnet = true
subnet_address_prefixes = ["10.0.5.0/24"] # Available range in existing VNet
# terraform.tfvars
use_existing_vnet = true
existing_vnet_name = "my-company-vnet"
existing_vnet_resource_group = "network-rg"
create_new_subnet = false
existing_subnet_name = "avd-subnet"
The deployment supports two identity join methods for session hosts:
# terraform.tfvars
domain_join_option = "AzureAD"
Benefits:
Requirements:
Best For:
# terraform.tfvars
domain_join_option = "DomainServices"
domain_fqdn = "contoso.com"
domain_join_username = "domainadmin"
domain_join_password = "SecurePassword123!" # Store in Key Vault or use env variable
domain_ou_path = "OU=AVD,DC=contoso,DC=com" # Optional
Benefits:
Requirements:
Network Configuration for Domain Join:
# Ensure network connectivity to domain controllers
use_existing_vnet = true
existing_vnet_name = "hub-vnet" # VNet with DC connectivity
existing_vnet_resource_group = "network-rg"
create_new_subnet = false
existing_subnet_name = "avd-subnet"
# Update DNS settings on the VNet to point to domain controllers
# az network vnet update --name hub-vnet --resource-group network-rg --dns-servers 10.0.0.4 10.0.0.5
Best For:
The deployment supports various session host configurations:
| Variable | Description | Default | Options |
|---|---|---|---|
session_host_count |
Number of session hosts | 2 | 1-100 |
vm_sku_size |
VM size for session hosts | Standard_D4s_v5 | D-series, E-series, F-series |
host_pool_type |
Host pool type | Pooled | Pooled, Personal |
host_pool_load_balancer_type |
Load balancing method | BreadthFirst | BreadthFirst, DepthFirst |
| Variable | Description | Default |
|---|---|---|
vnet_address_space |
Virtual network address space | [β10.0.0.0/16β] |
subnet_address_prefixes |
AVD subnet address prefixes | [β10.0.1.0/24β] |
corporate_network_cidr |
Corporate network CIDR for NSG | β0.0.0.0/0β |
| Variable | Description | Default |
|---|---|---|
fslogix_storage_quota_gb |
FSLogix file share quota | 1024 GB |
The deployment automatically configures:
Set up alerts for:
auto_shutdown_time variable# Check deployment status
terraform show
# View outputs
terraform output
# Refresh state
terraform refresh
# Validate configuration
terraform validate
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Note: This deployment creates Azure resources that incur costs. Make sure to review the pricing for each service and monitor your Azure spending. Use the auto-shutdown feature for development environments to minimize costs.