Azure-cli: Error when executing 'az webapp config access-restriction set'

Created on 10 Jun 2020  Â·  10Comments  Â·  Source: Azure/azure-cli

When I run the command az webapp config access-restriction set --resource-group <resource group> --name <name appservice> --use-same-restrictions-for-scm-site false

It will execute the command with the expected result, but it also gives an error/warning

az : Command group 'webapp config access-restriction' is in preview. It may be changed/removed in a future release.
At line:1 char:12
+  $output = az webapp config access-restriction set --resource-group " ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Command group '...future release.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I want to run it in a pipeline, but due the error/warning the pipelines fails.
I see it on Azure CLI versions 2.2.x, 2.7.0 & 2.5.1

How can I prevent the warning/error to occur ?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Service Attention Web Apps

Most helpful comment

With the option --only-show-errors it works nicely. Thank again.

All 10 comments

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

webapp

@sven73a can you give us more details on the error/warning you are referring to here? CLI shouldn't error out if the command hasn't failed - more details here will help us root cause this better.

All information is in the opening post. There is no much more to tell. Please let me know what more you want to know.

@sven73a adding the rather under-documented --only-show-errors global param to the command seem to make it play ball with pipelines. It requires a fairly new version of the CLI

@sven73a the command throws an error only something has actually failed on our end - & an error should be reported and not ignored by the pipeline as well. with regards to warning its possible that the in preview message of this command is being interpreted as a warning as a pipeline for that what @sedvardsen recommended above is the best option, to suppress warning messages. Hope this helps. Thanks!

OK. thnx for the work-around I will try it tomorrow. But for mine understanding is the warning/error for this particular command a bug in the command or is it by design?

Looks like it is an issue for several preview-methods at least - i.e all methods that throws a warning no matter what

With the option --only-show-errors it works nicely. Thank again.

@sven73a, glad to know it work for you. The --only-show-errors option was introduced in https://github.com/Azure/azure-cli/pull/12544, and has been documented at CLI configuration values and environment variables. There is also a corresponding config option [core] only_show_errors controlling this behavior.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

williexu picture williexu  Â·  3Comments

amarzavery picture amarzavery  Â·  3Comments

williexu picture williexu  Â·  3Comments

derekbekoe picture derekbekoe  Â·  3Comments

Kannaj picture Kannaj  Â·  3Comments