Partager via


Azure CLI – some tips

Keep your Azure CLI always update.

This is recommended to use Cloud Shell because all the versions of runtime and libraries are updated. But this is not persistent and does not allow you to keep it idle for a longer time. If it goes off then you will not find the history any more. That’s why you want to have Bash installed locally. Now it can go outdated very quickly. It’s your responsibility to keep it updated. Follow the installation instruction and this will handle the update as well.

Use interactive mode

Azure CLI gives you an interactive more by typing

$ az interactive

This comes with instant help and statement completion with a bit of color to the screen.

clip_image002

Set the default location and Resource Group

Most of the Azure CLI commands needs Resource Group and Location and its default parameter values. Azure CLI allows you to set it in a session,

$ az configure --defaults group=<name>

$ az configure –defaults location=<location>

If you do above then in your session you don’t need to pass them as explicit parameters. Makes the screen clean and less characters you need to type.