How to handle "Command is in preview..." response from Azure CLI

Using Azure CLI in a Powershell script the command az webapp vnet-integration add has a response of “This command is in preview … etc” which seems to be treated as an Error.

Is there a way to handle this particular response gracefully because running it through cli does work?

Error below:

NotSpecified: This command group is in preview. It may be changed/removed in a future release.

Hi Lee,

Thanks for getting in touch.

You can append 2> $null to your az command which will ignore messages written to the standard error stream from az. If the az command fails it should still fail the step as per normal.

I hope that helps.

Thank you,

Hi Henrik,

Thanks for getting back to me … I have the code as below but the same error remains.

az webapp vnet-integration add -g mygroup -n myapp --vnet myvnet --subnet mysubnet 2> $null

I was looking through the raw log for more information to provide you but there is nothing further. I will continue to research around that appended error handler because I have not come across it before.


I can see from this article that this should have worked. I am on the latest version of CLI (2.0.81) on the build machine.

Will comment this bit out for a moment. :grinning: