M365Con 2027 – free online conference · 11–22 Jan 2027 · 120 sessions m365con.net

Blog · Mirko Peters

Azure Policy governance for Azure Virtual Desktop

Partner · Neutral partner: Nerdio

By · · Updated

Azure Policy governs the resources around Azure Virtual Desktop, such as host pools, workspaces and private endpoints, with audit, deny, modify and deploy-if-not-exists effects. This guide compares them and sets out a staged rollout.

Azure Policy governs Azure Virtual Desktop at the Azure resource level: it audits, blocks or changes properties of host pools, workspaces, private endpoints and private DNS zones, deploys diagnostic settings, and reports compliance across subscriptions. It does not manage what runs inside a user session. The sections below list the AVD definitions Microsoft ships, compare the effects, and give a staged rollout.

Key points

  • Microsoft lists 11 built-in Desktop Virtualization policy definitions for public network access, Private Link, private endpoints and private DNS zones; Monitoring ones add diagnostic settings.
  • Audit only reports. Deny blocks a create or update request. Modify and DeployIfNotExists need a managed identity on the assignment and a remediation task for existing resources.
  • Roll out in stages: test on a small scope with enforcement mode DoNotEnforce, remediate existing resources, then widen the scope. The seven Configure definitions have no audit effect.
  • Use exclusions (notScopes) to skip evaluation permanently for a broad scope; use an exemption with expiresOn for a time-bound case that stays visible as Exempt in compliance reports.
  • Azure Policy works on the Azure control plane. For settings inside the session host OS, Learn points to machine configuration; check its supported OS table against your image.

What Azure Policy does and where it stops

Learn describes Azure Policy as a service that evaluates resources and actions in Azure by comparing their properties to business rules written in JSON, called policy definitions. Several definitions can be grouped into an initiative (also called a policySet).

Evaluation happens when a resource is created or updated in a scope with an assignment, when a scope gets a new assignment, when an assigned policy or initiative is updated, and in a standard cycle once every 24 hours. Learn adds that Azure Policy keeps resource state compliant "without concern for who made the change or who has permission to make a change". Although a policy can be assigned at the management group level, only resources at the subscription or resource group level are evaluated.

For AVD this means the policy works on Azure resources such as host pools, workspaces and the virtual machines behind session hosts. Settings inside Windows belong to other tools. Learn's machine configuration overview describes "audit or configure operating system settings as code" through Azure Policy, with three enforcement modes per policy assignment (Audit, Apply and Monitor, Apply and Autocorrect). Its supported-OS table lists Windows Client "10 - 11" and Windows Server "2012 - 2025"; confirm that your multi-session image is covered.

The built-in AVD definitions

Learn's built-in policy list has a Desktop Virtualization section with 11 definitions, all at version 1.0.0. The effects follow four patterns, shown in the table.

Definition (Learn name)Effects
Azure Virtual Desktop hostpools should disable public network accessAudit, Deny, Disabled
Azure Virtual Desktop hostpools should disable public network access only on session hostsAudit, Deny, Disabled
Azure Virtual Desktop workspaces should disable public network accessAudit, Deny, Disabled
Azure Virtual Desktop service should use private linkAudit, Disabled
Configure Azure Virtual Desktop hostpools to disable public network accessModify, Disabled
Configure Azure Virtual Desktop hostpools to disable public network access only for session hostsModify, Disabled
Configure Azure Virtual Desktop workspaces to disable public network accessModify, Disabled
Configure Azure Virtual Desktop hostpools with private endpointsDeployIfNotExists, Disabled
Configure Azure Virtual Desktop workspaces with private endpointsDeployIfNotExists, Disabled
Configure Azure Virtual Desktop hostpool resources to use private DNS zonesDeployIfNotExists, Disabled
Configure Azure Virtual Desktop workspace resources to use private DNS zonesDeployIfNotExists, Disabled

All 11 in that section point at Private Link and network exposure. Separately, Learn's Azure Monitor article lists built-in policies that create diagnostic settings by category group for host pools, workspaces, application groups and scaling plans, with Log Analytics, event hub or storage destinations. Background: Azure Private Link.

How the network policies relate to the AVD settings

Learn's Private Link setup article gives the host pool setting under Networking, Public access, three choices: enable public access from all networks; enable public access for end users and use private access for session hosts; disable public access and use private access. Workspaces have two. Our reading, from the definition names: the "only on session hosts" definitions correspond to the middle choice, and the plain "disable public network access" definitions to the third. Learn does not state this mapping.

  • Learn says that if you configure the workspace used for initial feed discovery to allow only private access, the setting is ignored. Our reading: assign the workspace definitions in audit first and see how that workspace is reported.
  • The Private Link setup article says only the Azure PowerShell cmdlets that support Private Link are in preview (Az.DesktopVirtualization 5.0.0-preview).
  • The AVD security baseline (control NS-2, based on an older benchmark version) says AVD does not require, nor recommend, Private Link for RDP unless you have a specific need. Our reading: enforce the Private Link definitions only where that need exists.

Choosing the effect

EffectWhat it does (per Learn)Fits in AVD whenWatch out for
AuditCreates a warning event in the Activity log for a non-compliant resource and does not stop the requestYou want a baseline of current host pools and workspacesNothing is blocked or fixed
DenyStops the create or update requestA rule is settled, for example a mandatory tag on new resourcesCan block your own pipelines and portal deployments if they do not meet the rule
ModifyAdds, updates or removes properties or tags on create or update; existing resources are fixed through a remediation taskAdding a missing tag, or changing the public access settingLearn says to restart the RDAgentBootLoader service on each session host (or restart the hosts) whenever you change a host pool's network configuration
DeployIfNotExistsRuns a template deployment after the resource provider returns a success code, if the related resource is missing; existing resources need a remediation taskCreating private endpoints or private DNS zone linksNeeds a managed identity with roles; the template runs under that identity

The evaluation order on a create or update request is: disabled, append and modify, deny, audit, manual, auditIfNotExists, then denyAction. deployIfNotExists and auditIfNotExists run after the resource provider returns a success code.

Roll out a policy in six steps

Learn's article on evaluating the impact of a new policy definition lists five steps: define the policy tightly, test it, audit new or updated resource requests, deploy it, and monitor. The list below adapts them and treats remediation as its own step.

  1. Define the policy tightly. Learn says a definition should focus on the resources and properties you need to evaluate, and that you should consider how it affects resources used by other services. The optional nonComplianceMessages property adds a custom explanation to the default error (Resource Manager mode definitions only).
  2. Test on existing resources without enforcement. Learn suggests a limited subset such as a test resource group. Set enforcement mode to DoNotEnforce. Learn says it evaluates compliance without enforcing the effect or writing deny entries to the Activity log. The seven Configure definitions have no audit effect (Modify or DeployIfNotExists, plus Disabled). Our reading: DoNotEnforce is one way to test them. Learn also names the Azure Policy VS Code extension's on-demand evaluation scan, and recommends the ARM template what-if for deployIfNotExists definitions. Learn adds that remediation tasks for deployIfNotExists can be started even under DoNotEnforce, so such a task still changes resources.
  3. Remediate existing resources. Learn describes this as a chance to remediate non-compliant resources before full implementation, manually or by remediation task for modify and deployIfNotExists.
  4. Audit new and updated resources. Learn says: if the definition supports effect parameterization, use audit or auditIfNotExists, then create or update matching resources and check that the effect fires. Our reading: because DoNotEnforce writes no Activity log entries, this step needs enforcement mode Default. If you change the definition, start the validation over.
  5. Deploy to a subset, then widen. Learn recommends assigning first to a subset such as a resource group, optionally narrowed by location or resource type with resourceSelectors, then widening the selectors or replacing the assignment at a broader scope, until the full intended scope is covered. Our reading: move from audit to deny stage by stage as well.
  6. Monitor. Learn recommends continuous compliance monitoring with Azure Monitor alerts.

The managed identity for modify and deployIfNotExists

Learn says an assignment with a modify or deployIfNotExists effect must have an identity with the minimum Azure RBAC role required to remediate. In the portal, Azure Policy grants the listed roles when the assignment starts; with an SDK you grant them yourself. An assignment can have only one managed identity, and one remediation task handles one modify or deployIfNotExists policy at a time. For a management group assignment, create the task from the Remediation or Compliance page after evaluation.

Exclusions and exemptions

Both keep a resource out of a policy, but they behave differently in reports.

Exclusion (notScopes)Exemption
Where it is setOn the assignment objectA separate Resource Manager object on the resource or hierarchy
In compliance reportsNot evaluated or countedShown as Exempt, with a substate
Typical use per LearnPermanent bypass for a broad scope such as a test environmentTime-bound or specific cases that should still be tracked
ExpiryNoneOptional expiresOn; the object is kept but no longer honored

Learn defines two exemption categories: Waiver (non-compliance is temporarily accepted) and Mitigated (the intent is met another way). An exemption names a policy assignment, and for an initiative assignment optionally individual definitions by policyDefinitionReferenceId. Creating one needs the Microsoft.Authorization/policyExemptions/write operation plus the exempt/Action verb on the target assignment.

Example: a legacy host pool still allows public access while a Private Link migration runs. Give it a waiver exemption with expiresOn set to the end of the migration window. Reports show the pool as Exempt, and the exemption lapses by itself.

Tags and cost allocation

Learn's tag policy article lists 17 built-in tag policies, among them "Inherit a tag from the resource group if missing" (modify) and "Require a tag and its value on resources" (deny). Learn's tag support list marks host pools, workspaces, application groups, scaling plans and app attach packages as supporting tags and showing them in the cost report; the hostpools/sessionhosts resource type does not. Learn's AVD tagging article says that when you add session hosts in the portal you must enter the tags manually each time. Our reading: an inherit-tag policy can close that gap. Tag schemes and cost reporting are covered in the article on a tagging strategy for AVD cost allocation.

When something is blocked

A deny returns 403 (Forbidden), which the portal shows as a deployment status prevented by the policy assignment. Learn's RequestDisallowedByPolicy article says the error message, Azure CLI, Azure PowerShell and the activity log show the error code, policy assignment and policy definition. The name of each is the last segment of its id. Use az policy assignment show --name <assignment> --resource-group <rg> and az policy definition show --name <definition> (or Get-AzPolicyAssignment and Get-AzPolicyDefinition) to read the rule, then adjust the deployment.

Sources

Follow the showApple PodcastsSpotify

FAQ

Does Azure Policy change settings inside the Windows session?

Not through the AVD built-in definitions on Learn, which target Azure resources such as host pools, workspaces, private endpoints and private DNS zones, or deploy diagnostic settings. For operating system settings, Learn describes machine configuration, which can audit or configure OS settings as code through Azure Policy. Check that your session host operating system is in its supported table first.

Will a deny policy stop my existing session hosts?

Not by itself. Learn says that during evaluation of existing resources, resources that match a deny definition are marked as non-compliant. Deny acts on create or update requests, which are returned as 403 (Forbidden). Our reading: a later update to a non-compliant host pool or workspace, including one made by automation, can therefore be blocked, so test with audit first.

How do I find out which policy blocked an Azure Virtual Desktop deployment?

Learn's RequestDisallowedByPolicy article says the error shows the policy assignment and policy definition. The name of each is the last segment of its id, and az policy assignment show and az policy definition show return the details. Learn's AVD troubleshooting article separately points to the deployment operations and, if those show no errors, to the activity log.

Entities in this article

Topics of this article:

Azure Virtual Desktop – Cloud platform by Microsoft Azure Policy – Part of Microsoft Azure

Related articles

More articles on Azure Virtual Desktop:

RSS