Skip to content

Commit

Permalink
Merge branch 'release-2018-11-20' into policyLocHelp
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddie Clayton authored Nov 14, 2018
2 parents 30d9e7b + dc60bc8 commit f86ab80
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->
## Current Release
* Update help documentation for resource identity related parameters in `New-AzureRmPolicyAssignment` and `Set-AzureRmPolicyAssignment`
* Add an example for New-AzureRmPolicyDefinition that uses -Metadata
* Fix to allow case preservation in Tag keys in NetStandard: #7678 #7703

## Version 6.7.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ PS C:\> New-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -ManagementGroupN
This command creates a policy definition named VMPolicyDefinition in management group Dept42.
The command specifies the policy as a string in valid JSON format.

### Example 4: Create a policy definition inline with metadata
```
PS C:\> New-AzureRmPolicyDefinition -Name 'VMPolicyDefinition' -Metadata '{"Category":"Virtual Machine"}' -Policy '{"if":{"source":"action","equals":"Microsoft.Compute/virtualMachines/write"},"then":{"effect":"deny"}}'
Name : VMPolicyDefinition
ResourceId : /subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Authorization/policyDefinitions/VMPolicyDefinition
ResourceName : VMPolicyDefinition
ResourceType : Microsoft.Authorization/policyDefinitions
SubscriptionId : 11111111-1111-1111-1111-111111111111
Properties : @{displayName=VMPolicyDefinition; policyType=Custom; mode=All; metadata=; policyRule=}
PolicyDefinitionId : /subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Authorization/policyDefinitions/VMPolicyDefinition
```

This command creates a policy definition named VMPolicyDefinition with metadata indicating its category is "Virtual Machine".
The command specifies the policy as a string in valid JSON format.

## PARAMETERS

### -ApiVersion
Expand Down

0 comments on commit f86ab80

Please sign in to comment.