Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

[Feature]: Add support for ResourceSelectors and Overrides for *-policyAssignment #25829

Closed mortenlerudjordet closed 1 month ago

mortenlerudjordet commented 2 months ago

Description of the new feature

The api has support for ResourceSelectors and Overrides in assignments https://learn.microsoft.com/en-us/rest/api/policy/policy-assignments/create?view=rest-policy-2023-04-01&tabs=HTTP

Would like to see this added to *-policyAssignment as this is available on a GA api, but not in the az-functions for assignments.

Proposed implementation details (optional)

No response

microsoft-github-policy-service[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aperezcloud, @kenieva.

mortenlerudjordet commented 2 months ago

Another confusing naming in the object recieved from Get-AzpolicyAssignment is that here the object parameter is named ResourceSelector and Override, but if one wants to use the API to create a new assignment the same parameters have an S at the end. So ResourceSelectors and Overrides.

This also reflects in the substructure of ResourceSelectors, where the parameter returned from the function is selector, but the api refers to it as selectors.

https://learn.microsoft.com/en-us/azure/templates/microsoft.authorization/2024-04-01/policyassignments?pivots=deployment-language-arm-template

Would be nice if the functions follow the api naming convention.

mortenlerudjordet commented 2 months ago

The same problem exists with Get-AzPolicyExemption

image

mortenlerudjordet commented 1 month ago

Added in Az.Resources 7.5.0