Azure / Azure/azure-cli

`az policy assignment delete` should support deletion by id

Open
#27,501 1 comment 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM Auto-Assign Azure CLI Team customer-reported feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**

`az policy assignment delete `

**Is your feature request related to a problem? Please describe.**

Most other az cli commands allow you to delete by name or id ([example](https://learn.microsoft.com/en-us/cli/azure/monitor/metrics/alert?view=azure-cli-latest#az-monitor-metrics-alert-delete())). It's unintuitive for this one command to require deletion by name. Policy assignment names are also different from the displayName so it's an extra layer of translation that is different than other resources.

**Describe the solution you'd like**

Add a `--id` option to the command that has the command use the [Policy Assignments - Delete By Id](https://learn.microsoft.com/en-us/rest/api/policy/policy-assignments/delete?tabs=HTTP) endpoint in the API.

**Describe alternatives you've considered**

Maybe a separate command if refactoring is not simple for some reason.

**Additional context**

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.