Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

az aks enable-addons --addons ingress-appgw not idempotent #18349

Open markdebruijne opened 3 years ago

markdebruijne commented 3 years ago

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

Describe the bug Repeating the command below should not returning an error

        $aksIngressControllerOutput = az aks enable-addons `
            --appgw-id $agwic.id `
            --resource-group $resourceGroupName `
            --name $aksClusterName `
            --addons ingress-appgw `

Error that I receive

ERROR: The ingress-appgw addon is already enabled for this managed cluster.
To change ingress-appgw configuration, run "az aks disable-addons -a ingress-appgw -n <clustername> -g rg-name" before enabling it again.

source (probably outdated, but maybe still applicable): https://github.com/Azure/azure-cli-extensions/blob/master/src/aks-preview/azext_aks_preview/custom.py#L3380

To Reproduce Repeat the above command multiple times

Expected behavior From the CLI command design guidelines

‘create’ commands should be idempotent and should return the resource that was created.

Environment summary

azure-cli                         2.22.1 *

core                              2.22.1 *
telemetry                          1.0.6

Extensions:
application-insights              0.1.13
azure-devops                      0.18.0

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

Python (Windows) 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]

Additional context n/a

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm.

Issue Details
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62 **Describe the bug** Repeating the command below should not returning an error ``` $aksIngressControllerOutput = az aks enable-addons ` --appgw-id $agwic.id ` --resource-group $resourceGroupName ` --name $aksClusterName ` --addons ingress-appgw ` ``` Error that I receive ``` ERROR: The ingress-appgw addon is already enabled for this managed cluster. To change ingress-appgw configuration, run "az aks disable-addons -a ingress-appgw -n -g rg-name" before enabling it again. ``` source (probably outdated, but maybe still applicable): https://github.com/Azure/azure-cli-extensions/blob/master/src/aks-preview/azext_aks_preview/custom.py#L3380 **To Reproduce** Repeat the above command multiple times **Expected behavior** From the CLI command design guidelines > ‘create’ commands should be idempotent and should return the resource that was created. **Environment summary** ``` azure-cli 2.22.1 * core 2.22.1 * telemetry 1.0.6 Extensions: application-insights 0.1.13 azure-devops 0.18.0 Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\\.azure\cliextensions' Python (Windows) 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] ``` **Additional context** n/a
Author: markdebruijne
Assignees: -
Labels: `AKS`, `Service Attention`
Milestone: -
yonzhan commented 3 years ago

route to service team

Volatus commented 3 years ago

@markdebruijne What output do you expect to see?