nerdexam
Microsoft

AZ-500 · Question #450

Drag and Drop Question You have an Azure subscription that contains a resource group named RG1 and an Azure policy named Policy1. You need to assign Policy1 to RG1. How should you complete the…

The correct answer is Get-AzPolicyDefinition; New-AzPolicyAssignment. To assign an Azure Policy to a resource group using PowerShell, you first use Get-AzPolicyDefinition to retrieve the policy definition object (Policy1), which gives you the policy's details needed for assignment. Then you use New-AzPolicyAssignment to create the actual…

Submitted by katya_ua· Mar 6, 2026Manage Azure identities and governance - specifically implementing and managing Azure Policy using PowerShell cmdlets (AZ-104 / AZ-900 governance domain)

Question

Drag and Drop Question You have an Azure subscription that contains a resource group named RG1 and an Azure policy named Policy1. You need to assign Policy1 to RG1. How should you complete the script? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:

Answer Area

Drag items

Get-AzPolicyAssignmentGet-AzPolicyDefinitionGet-AzPolicySetDefinitionNew-AzPolicyAssignmentNew-AzPolicyDefinition

Correct arrangement

  • Get-AzPolicyDefinition
  • New-AzPolicyAssignment

Explanation

To assign an Azure Policy to a resource group using PowerShell, you first use Get-AzPolicyDefinition to retrieve the policy definition object (Policy1), which gives you the policy's details needed for assignment. Then you use New-AzPolicyAssignment to create the actual assignment of that policy to the scope of RG1, specifying the policy definition and the resource group's resource ID as the scope. This two-step approach - retrieve the definition, then create the assignment - is the standard PowerShell workflow for Azure Policy assignments.

Topics

#Azure Policy#PowerShell#Resource Governance#Policy Assignment

Community Discussion

No community discussion yet for this question.

Full AZ-500 Practice