Azure / Azure/azure-cli

az policy assignment update does not remove notScope if empty

Open
#25,355 1 comment 1 reaction 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

## Describe the bug
Today I wanted to modify one policy assignment removing all notScopes. I have one notScope left and I want to remove it. When I use argument --not-scope with empty value "" then nothing happens, no error appears but also no change appears. NotScope is not deleted.

**Command Name**
`az policy assignment update`

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- `az policy assignment update -n {} --scope {} --not-scope ""`

## Expected Behavior
When I use empty value ("") of argument (--not-scope), all notScopes are deleted

## Environment Summary
```
Linux-5.4.0-1101-azure-x86_64-with-glibc2.35 (Cloud Shell), CBL-Mariner/Linux
Python 3.9.14
Installer: RPM

azure-cli 2.44.1

Extensions:
change-analysis 0.1.0
ai-examples 0.2.5
ml 2.12.1
ssh 1.1.3

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
```
## 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.