Azure / Azure/azure-cli

Command `az keyvault create` should not allow setting enable-purge-protection to false

Open
#28,586 2 comments 0 reactions 1 assignee Claimed by @evelyn-ys View on GitHub
act-identity-squad Auto-Assign Auto-Resolve Azure CLI Team KeyVault question Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

Running command:
`az keyvault create -g rg --name kv --location l **--enable-purge-protection false**`
return:
```
ERROR: (BadRequest) The property "enablePurgeProtection" cannot be set to false. Enabling the purge protection for a vault is an irreversible action.
Code: BadRequest
Message: The property "enablePurgeProtection" cannot be set to false. Enabling the purge protection for a vault is an irreversible action.

```
However, using cli v2.58.0 the argument description staes Allowed values are false and true
image

### Related command

az keyvault create

### Errors

The property "enablePurgeProtection" cannot be set to false. Enabling the purge protection for a vault is an irreversible action.

### Issue script & Debug output

2024-03-19T15:46:44.4796920Z 2024-03-19 15:46:44 [INFO] Started executing command az keyvault create -g g --name kvclitemp20240319154639 --location southcentralus --enable-purge-protection false
2024-03-19T15:46:51.0022688Z 2024-03-19 15:46:50 [INFO] Result: 1
2024-03-19T15:46:51.0023943Z 2024-03-19 15:46:50 [ERROR] WARNING: We will enable rbac authorization by default in the near future, please manually specify --enable-rbac-authorization if you want to overwrite the default value.
2024-03-19T15:46:51.0024724Z
2024-03-19T15:46:51.0025203Z ERROR: (BadRequest) The property "enablePurgeProtection" cannot be set to false. Enabling the purge protection for a vault is an irreversible action.
2024-03-19T15:46:51.0025536Z
2024-03-19T15:46:51.0025815Z Code: BadRequest
2024-03-19T15:46:51.0026027Z
2024-03-19T15:46:51.0026398Z Message: The property "enablePurgeProtection" cannot be set to false. Enabling the purge protection for a vault is an irreversible action.

### Expected behavior

Should have created key vault with purge protection not enabled
or
Remove false as an allowed value

### Environment Summary

azure-cli 2.58.0

core 2.58.0
telemetry 1.1.0

Extensions:
account 0.2.5

Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\nasc\.azure\cliextensions'

Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:13:08) [MSC v.1937 32 bit (Intel)]

### Additional context

_No response_

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.