Azure / Azure/azure-powershell

[Feature]: Allow New-AzPolicySetDefinition to read a template from github and deploy it

Open
#25,508 1 comment 2 reactions 0 assignees View on GitHub
customer-reported feature-request Policy Service Attention
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):
![image](https://github.com/Azure/azure-powershell/assets/16253984/aaa1c92d-2c90-4a4a-83f2-3ca61adf8a52)

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):
![image](https://github.com/Azure/azure-powershell/assets/16253984/c60d3998-cd92-45a9-bb99-710a26ab9c3e)

### 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.
![image](https://github.com/Azure/azure-powershell/assets/16253984/59003ce9-0755-4678-ad67-d8ea773bf927)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.