-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for policy at ManagementGroup level (#1754)
* Add support for policy at ManagementGroup level * Add "x-ms-parameter-location": "method" for ManagementGroupId parameter
- Loading branch information
1 parent
1a9d396
commit 3022628
Showing
5 changed files
with
566 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...ation/2017-06-01-preview/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "subid", | ||
"managementGroupId": "mgid", | ||
"policySetDefinitionName": "costManagement", | ||
"api-version": "2017-06-01-preview", | ||
"parameters": { | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/subscriptions/subId/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"listOfAllowedSKUs": { | ||
"value": [ | ||
"Standard_GRS", | ||
"Standard_LRS" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "costManagement", | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"listOfAllowedSKUs": { | ||
"value": [ | ||
"Standard_GRS", | ||
"Standard_LRS" | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
} | ||
}, | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "costManagement", | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"listOfAllowedSKUs": { | ||
"value": [ | ||
"Standard_GRS", | ||
"Standard_LRS" | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
} | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...ft.Authorization/2017-06-01-preview/examples/getPolicySetDefinitionAtManagementGroup.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "subid", | ||
"managementGroupId": "mgid", | ||
"policySetDefinitionName": "costManagement", | ||
"api-version": "2017-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "costManagement", | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"parameters": { | ||
"allowedLocations": { | ||
"type": "array", | ||
"metadata": { | ||
"description": "Regions that resources can be deployed to", | ||
"displayName": "Valid Regions" | ||
} | ||
} | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"listOfAllowedSKUs": { | ||
"value": [ | ||
"Standard_GRS", | ||
"Standard_LRS" | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/vmSkus" | ||
}, | ||
{ | ||
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/policyDefinitionId", | ||
"parameters": { | ||
"listOfAllowedLocations": { | ||
"value": "[parameters('allowedLocations')]" | ||
} | ||
} | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
} | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
....Authorization/2017-06-01-preview/examples/listPolicySetDefinitionsByManagementGroup.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "subid", | ||
"managementGroupId": "mgid", | ||
"api-version": "2017-06-01-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/costManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "costManagement", | ||
"properties": { | ||
"displayName": "VM and Storage Cost Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Cost Management" | ||
}, | ||
"parameters": { | ||
"allowedLocations": { | ||
"type": "array", | ||
"metadata": { | ||
"description": "Regions that resources can be deployed to", | ||
"displayName": "Valid Regions" | ||
} | ||
} | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/storageSkus", | ||
"parameters": { | ||
"locations": { | ||
"value": "[parameters('allowedLocations')]" | ||
} | ||
} | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
}, | ||
{ | ||
"id": "/providers/Microsoft.Management/managementgroups/mgid/providers/Microsoft.Authorization/policySetDefinitions/skuManagement", | ||
"type": "Microsoft.Authorization/policySetDefinitions", | ||
"name": "skuManagement", | ||
"properties": { | ||
"displayName": "VM Sku Management", | ||
"description": "Policies required to minimize the risk of accidental cost overruns", | ||
"metadata": { | ||
"category": "Sku Management" | ||
}, | ||
"policyDefinitions": [ | ||
{ | ||
"policyDefinitionId": "/subscriptions/subid/providers/Microsoft.Authorization/policyDefinitions/vmSkus" | ||
} | ||
], | ||
"policyType": "Custom" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.