Azure / Azure/azure-cli

`key vault create` no longer idempotent since #18520

Open
#19,165 9 comments 7 reactions 1 assignee Claimed by @evelyn-ys View on GitHub
act-identity-squad idempotence KeyVault Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62

**Describe the bug**

The command `key vault create` is no longer idempotent since #18520

**To Reproduce**

Simply create a new Key Vault using the `key vault create` command, and then re-run the command multiple times.

Each subsequent run will result in an error stating:

`The specified vault: {vault_name} already exists`

**Expected behavior**

All commands in the AZ CLI should be idempotent, as per:
https://docs.microsoft.com/en-us/azure/architecture/microservices/design/api-design#idempotent-operations

**Environment summary**

```shell
{
"azure-cli": "2.27.0",
"azure-cli-core": "2.27.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"account": "0.2.1",
"spring-cloud": "2.7.0"
}
}
```

**Additional context**

I'd really like to understand what the rationale was for breaking the idempotent operation for this command rather than fixing the root cause issue (i.e. why are access policies reset when running this command)?

This has broken all scripts which has a dependency on idempotent operations on the creation of a Key Vault and will now require additional logic which goes against the design principles of AZ CLI as quoted above.

Please consider reverting this behaviour and fixing the underlying issue(s) instead of breaking the AZ CLI design principles.

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.