azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

The api-version '2022-03-01' is invalid error when running az webapp commands on web app

Open GintarasBatura opened this issue 3 years ago • 5 comments

Related command az webapp config show --name someappservice -g /subscriptions/xxxxxxxxxxxxxx/resourceGroups/rrrrrrrr--subscription yyyyyy az webapp config appsettings list--name someappservice -g /subscriptions/xxxxxxxxxxxxxx/resourceGroups/rrrrrrrr--subscription yyyyyy

Describe the bug Here is the result: (InvalidApiVersionParameter) The api-version '2022-03-01' is invalid. The supported versions are '2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'. Code: InvalidApiVersionParameter

To Reproduce Run those commands on a web app that is deployed using "type": "Microsoft.Web/sites", "apiVersion": "2022-03-01", ...

Expected behavior As per https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest

Environment summary This happens in AzDO pipelines using task AzureCLI@2 and on a local machine using az version { "azure-cli": "2.43.0", "azure-cli-core": "2.43.0", "azure-cli-telemetry": "1.0.8", "extensions": { "azure-devops": "0.25.0" } }

GintarasBatura avatar Jan 12 '23 17:01 GintarasBatura

route to CXP team

yonzhan avatar Jan 12 '23 23:01 yonzhan

I'm experiencing this within Azure Portal CLI and in my deployment scripts.

curt-w avatar Jan 13 '23 15:01 curt-w

@curt-w Instead of passing the whole resourcegroup id (-g /subscriptions/xxxxxxxxxxxxxx/resourceGroups/rrrrrrrr--subscription) you need to only pass the resource group to the cmdlet like below -

az webapp config show --name {web app name} -g rrrrrrrr --subscription ss

SaurabhSharma-MSFT avatar Jan 17 '23 05:01 SaurabhSharma-MSFT

Hi @GintarasBatura. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

ghost avatar Jan 17 '23 05:01 ghost

Indeed, using the name of the resource group instead of the full id fixes the problem for all of these az commands. Thanks for the assistance. So the next question is, could you fix that misleading error message?

GintarasBatura avatar Jan 18 '23 20:01 GintarasBatura

Hi @GintarasBatura, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

ghost avatar Jan 25 '23 22:01 ghost