Skip to content

Commit f86ab80

Browse files
author
Maddie Clayton
authored
Merge branch 'release-2018-11-20' into policyLocHelp
2 parents 30d9e7b + dc60bc8 commit f86ab80

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/ResourceManager/Resources/Commands.Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Current Release
2121
* Update help documentation for resource identity related parameters in `New-AzureRmPolicyAssignment` and `Set-AzureRmPolicyAssignment`
22+
* Add an example for New-AzureRmPolicyDefinition that uses -Metadata
2223
* Fix to allow case preservation in Tag keys in NetStandard: #7678 #7703
2324

2425
## Version 6.7.1

src/ResourceManager/Resources/Commands.Resources/help/New-AzureRmPolicyDefinition.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ PS C:\> New-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -ManagementGroupN
8888
This command creates a policy definition named VMPolicyDefinition in management group Dept42.
8989
The command specifies the policy as a string in valid JSON format.
9090

91+
### Example 4: Create a policy definition inline with metadata
92+
```
93+
PS C:\> New-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -Metadata '{"Category":"Virtual Machine"}' -Policy '{"if":{"source":"action","equals":"Microsoft.Compute/virtualMachines/write"},"then":{"effect":"deny"}}'
94+
95+
96+
Name : VMPolicyDefinition
97+
ResourceId : /subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Authorization/policyDefinitions/VMPolicyDefinition
98+
ResourceName : VMPolicyDefinition
99+
ResourceType : Microsoft.Authorization/policyDefinitions
100+
SubscriptionId : 11111111-1111-1111-1111-111111111111
101+
Properties : @{displayName=VMPolicyDefinition; policyType=Custom; mode=All; metadata=; policyRule=}
102+
PolicyDefinitionId : /subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Authorization/policyDefinitions/VMPolicyDefinition
103+
```
104+
105+
This command creates a policy definition named VMPolicyDefinition with metadata indicating its category is "Virtual Machine".
106+
The command specifies the policy as a string in valid JSON format.
107+
91108
## PARAMETERS
92109

93110
### -ApiVersion

0 commit comments

Comments
 (0)