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 https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Also can run

sudo apt-get update && sudo apt-get install --only-upgrade -y azure-cli

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.

No alt text provided for this image

Set the default location and Resource Group

Most of the Azure CLI commands needs Resource Group and Location as 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.

Eric van Wijk

Azure Pipelines Product ?? at Microsoft

5 年

I use a package manager (apt-get, brew, chocolatey) to keep tools such as azure-cli up to date

Maheshkumar R

Enable Cloud transformation journey | Cloud Solution Architect | Cloud Native, Infra, Apps, K8s and OSS

5 年

Thanks Wriju. tried $ az interactive for the first time. Very useful !!

Amar Prusty

Independent IT Advisor Consultant Architect / Speaker / Wellness Enthusiast / Sustainability Enthusiast / Automotive Enthusiast / Cyclist / 2 Decades Experience / 35K+ Connections & Followers

5 年

Nice Meeting you in BITPRO Meetup,Thanks for the nice Tech presentation

要查看或添加评论,请登录

Wriju Ghosh的更多文章

社区洞察

其他会员也浏览了