I'm trying to write a shellscript using azure cli, az cli gives warning such as one pasted below,
Command group 'backup' is in preview. It may be changed/removed in a future release.
I have tried to use 2 and 1 redirection ( 2> /dev/null & 1> /dev/null & > /dev/null 2>&1) but it still shows warning when az cli commmand is executed.
Edit here
I have tried the following ways of redirection
az backup arguments... 1> /dev/null
- just gave it a try out of curiosity but this suppresses the output and shows warning message.
az backup arguments... 2> /dev/null
- it gives both warning message and desired output
az backup arguments... > /dev/null 2>&1
- does not show desired output but shows warning message.
I only want output while warning or error message should be ignored/suppressed.
I'm using -
az backup container list --backup-management-type AzureIaasVM --resource-group ${RESOURCE_GROUP} --vault-name ${VAULT_NAME} --subscription ${SUBSCRIPTION} --query "[?contains(name, '${VM_NAME}')].[name]" -o tsv
Any help or suggestion would be greatly appreciated. Thanks