You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate Resources from generation to main (#26129)
* Move Resources to main
* Add change log
---------
Co-authored-by: azure-powershell-bot <[email protected]>
Co-authored-by: Lei jin <[email protected]>
The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet and stores it in the $ResourceGroup variable.
61
-
The second command gets the built-in policy definition for allowed locations by using the Get-AzPolicyDefinition cmdlet and stores it in the $Policy variable.
58
+
The first command creates a parameter file called _AllowedLocations.json_ in the local working directory.
59
+
The second command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet and stores it in the $ResourceGroup variable.
60
+
The third command gets the built-in policy definition for allowed locations by using the Get-AzPolicyDefinition cmdlet and stores it in the $Policy variable.
62
61
The final command assigns the policy in $Policy at the resource group identified by the **ResourceId** property of $ResourceGroup using the policy parameter file AllowedLocations.json from the local working directory.
63
62
64
63
### Example 5: Policy assignment with a system assigned managed identity
@@ -108,7 +107,31 @@ The first command gets the policy set definition named VirtualMachinePolicySet b
108
107
The second command creates an array of non-compliance messages. One general purpose message for the entire assignment and one message specific to a SKU restriction policy within the assigned policy set definition.
109
108
The final command assigns the policy set definition in $PolicySet to the subscription with two non-compliance messages that will be shown if a resource is denied by policy.
110
109
111
-
### Example 9: [Backcompat] Policy assignment at resource group level with policy parameter object
110
+
### Example 9: Policy assignment with resource selector
The first command gets the policy definition named VirtualMachinePolicy by using the Get-AzPolicyDefinition cmdlet and stores it in the $Policy variable.
118
+
The second command creates a resource selector object that will be used to specify the assignment should only apply to resources located in East US or East US 2 and stores it in the $ResourceSelector variable.
119
+
The final command assigns the policy definition in $Policy to the subscription with the resource selector specified by $ResourceSelector.
The first command gets the policy definition named VirtualMachinePolicy by using the Get-AzPolicyDefinition cmdlet and stores it in the $Policy variable.
130
+
The second command creates a location selector specifying East US or East US 2 locations and stores it in the $Selector variable.
131
+
The third command creates an override object that will be used to specify that the assigned definition should have a Disabled effect in the locations identified by the $Selector object and stores it in the $Override variable.
132
+
The final command assigns the policy definition in $Policy to the subscription with the override specified by $Override.
133
+
134
+
### Example 11: [Backcompat] Policy assignment at resource group level with policy parameter object
The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet and stores it in the $ResourceGroup variable.
149
-
The second command gets the built-in policy definition for allowed locations by using the Get-AzPolicyDefinition cmdlet and stores it in the $Policy variable.
169
+
The first command creates a parameter file called _AllowedLocations.json_ in the local working directory.
170
+
The second command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet and stores it in the $ResourceGroup variable.
171
+
The third command gets the built-in policy definition for allowed locations by using the Get-AzPolicyDefinition cmdlet and stores it in the $Policy variable.
150
172
The final command assigns the policy in $Policy at the resource group identified by the **ResourceId** property of $ResourceGroup using the policy parameter file AllowedLocations.json from the local working directory.
0 commit comments