Azure / Azure/azure-powershell
[Feature]: Allow New-AzPolicySetDefinition to read a template from github and deploy it
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description of the new feature
Today, the commandlet expects a part of the json of a Policy Set Definition. It should be possible to deploy the full json, as it can be viewed in the Azure Portal or downloaded from github (example: https://github.com/Azure/Enterprise-Scale/blob/main/src/resources/Microsoft.Authorization/policySetDefinitions/Deploy-Private-DNS-Zones.json). The REST api expects a full json as well.
Today (commandlet help):

Suggestion (taken from the REST API https://learn.microsoft.com/en-us/rest/api/policy/policy-set-definitions/create-or-update?view=rest-policy-2023-04-01&tabs=HTTP&tryIt=true&source=docs#code-try-0):

### Proposed implementation details (optional)
Add a new parameter to the commandlet like "-RawPolicyDefinition" that allows the full json to be specified, just like you can download it from github or the Azure portal (Initiative Definition -> JSON) and then deploy it through the REST API today.

Contributor guide
Assessment
This issue has not been assessed yet.