Azure / Azure/azure-cli-extensions
The idempotency for "az aks create" command is broken
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### Related command
az aks create
### Extension name
aks-preview
### Description of the issue
The "az aks create" command idempotency worked perfectly until last week when [this pull request](https://github.com/Azure/azure-cli-extensions/pull/5999) was merged. Since this time the 2nd, 3rd, etc. run for "az aks create" always gives the error: `The cluster 'NAME' under resource group 'NAME' already exists. Please use command 'az aks update' to update the existing cluster ...`
**Background**:
Almost all "az create/set"commands are idempotent. This is because idempotency greatly simplifies scripting: i.e. if some big Azure resource-creating script fails you can rerun and it will skip existing resources and continue to create the remaining ones:
> "This is a very useful property in many situations, as it means that an operation can be repeated or retried as often as necessary without causing unintended effects. With non-idempotent operations, the algorithm may have to keep track of whether the operation was already performed or not." - [Idempotence, Wikipedia](https://en.wikipedia.org/wiki/Idempotence)
In fact, there were a lot of idempotency fixes for other az commands like "az keyvault create", "az bot create", etc. - you can search for the word "idempotent" in [Azure CLI release notes](https://learn.microsoft.com/en-us/cli/azure/release-notes-azure-cli).
-----
azure-cli - 2.46.0
k8s-extension - 1.4.0
aks-preview - 0.5.133
Contributor guide
Assessment
This issue has not been assessed yet.