Skip to content

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

@nasc17

Description

@nasc17

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

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamKeyVaultaz keyvaultSimilar-Issueact-identity-squadquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions