Three new optional modules have been added to enhance your AVD deployment with enterprise-grade capabilities:
Protect your session hosts with automated backup and recovery capabilities.
Features:
Enable with:
enable_backup = true
Manage golden images for consistent, fast session host deployments.
Features:
Enable with:
enable_image_gallery = true
Enforce compliance, security, and operational standards automatically.
Features:
Enable with:
enable_policies = true
All new modules are disabled by default. Your existing deployments continue to work exactly as before.
# Copy the new variables from the separate file
cat variables_new_modules.tf >> variables.tf
# Copy the all-features example
cp terraform-all-features.tfvars.example terraform.tfvars
# Edit with your values
nano terraform.tfvars
# In terraform.tfvars
enable_backup = true # Add backup protection
enable_image_gallery = true # Add golden images
enable_policies = true # Add governance
terraform init
terraform plan
terraform apply
modules/
βββ backup/
β βββ main.tf # Azure Backup resources
β βββ variables.tf # Backup configuration options
β βββ outputs.tf # Vault and policy IDs
βββ image_gallery/
β βββ main.tf # Shared Image Gallery resources
β βββ variables.tf # Image definitions configuration
β βββ outputs.tf # Gallery and image IDs
βββ policy/
βββ main.tf # Azure Policy assignments
βββ variables.tf # Policy configuration options
βββ outputs.tf # Policy assignment IDs
RECOMMENDATIONS.md - Comprehensive best practices guideEXAMPLE-ALL-FEATURES.md - Quick start guideterraform-all-features.tfvars.example - Complete configuration examplevariables_new_modules.tf - Variable definitions for new modulesNEW-FEATURES.md - This filemain.tf - Added 3 new module calls (conditionally enabled)enable_backup = true)Resources Created:
Cost: ~$10-30/VM/month (varies by retention and region)
When to Enable:
enable_image_gallery = true)Resources Created:
Cost: ~$5/month
When to Enable:
enable_policies = true)Resources Created:
Cost: Free
When to Enable:
enable_backup = true
backup_frequency = "Daily" # Daily or Weekly
backup_time = "02:00" # 24-hour format
backup_timezone = "UTC"
backup_daily_retention_count = 30 # 7-9999 days
backup_weekly_retention_count = 12 # 0-5163 weeks
backup_monthly_retention_count = 12 # 0-1188 months
backup_yearly_retention_count = 5 # 0-99 years
enable_image_gallery = true
create_win11_image_definition = true
create_win10_image_definition = false
image_builder_principal_id = "" # Optional: Service Principal for CI/CD
enable_policies = true
policy_require_environment_tag = true
policy_allowed_vm_sizes = ["Standard_D2s_v5", "Standard_D4s_v5", ...]
policy_deploy_antimalware = true
policy_audit_disk_encryption = true
policy_enable_vm_diagnostics = true
If you have an existing deployment:
Understand all best practices and decide which features you need.
Add new variables to your existing variables.tf:
cat variables_new_modules.tf >> variables.tf
Add feature flags to your terraform.tfvars:
# Start with backup (safest, most valuable)
enable_backup = true
# Add image gallery later
enable_image_gallery = false
# Add policies last
enable_policies = false
terraform plan # Review changes
terraform apply # Apply to dev/test environment
RECOMMENDATIONS.mdterraform-all-features.tfvars.exampleEXAMPLE-ALL-FEATURES.mdmodules/ directoryβ 100% backward compatible - All new features are disabled by default.
Your existing deployments will continue to work without any changes. The new modules are only created if you explicitly enable them.
RECOMMENDATIONS.md for full best practicesterraform-all-features.tfvars.exampleCheck the documentation files or review the module source code in modules/ directory. All modules are fully commented and include validation rules.
Happy deploying! π