az aks namespace update --annotations replaces existing annotations instead of updating incrementally
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
The az aks namespace update --annotations command replaces all existing annotations on a managed namespace with only the values provided via the --annotations parameter.
This behavior prevents users from adding or updating individual annotations without first retrieving and re-specifying the entire existing annotation set.
### Related command
az aks namespace update --annotations
### Errors
N/A
### Issue script & Debug output
#### Variables
RG=my-resource-group
CLUSTER=my-cluster-name
NS=my-namespace
#### Step 1: Set initial annotations
az aks namespace update -g $RG --cluster-name $CLUSTER -n $NS --annotations a=1 b=2 --debug
#### Step 2: Verify annotations
az aks namespace show -g $RG --cluster-name $CLUSTER -n $NS --debug
#### Step 3: Add a new annotation (expected: merge, actual: replace)
az aks namespace update -g $RG --cluster-name $CLUSTER -n $NS --annotations c=3 --debug
#### Step 4: Verify annotations again
az aks namespace show -g $RG --cluster-name $CLUSTER -n $NS --debug
#### Annotations after Step 4:
"annotations": {
"c": "3"
},
### Expected behavior
#### Expected Annotations after Step 4:
"annotations": {
"a": "1",
"b": "2",
"c": "3"
},
### Environment Summary
azure-cli 2.87.0
core 2.87.0
telemetry 1.1.0
Extensions:
resource-graph 2.1.1
Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0
Python location '/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/bin/python'
Config directory '/Users/sunehabose/.azure'
Extensions directory '/Users/sunehabose/.azure/cliextensions'
Python (Darwin) 3.13.13 (main, Apr 7 2026, 18:19:01) [Clang 21.0.0 (clang-2100.0.123.102)]
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.