You've successfully subscribed to Nuvotex Blog
Great! Next, complete checkout for full access to Nuvotex Blog
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.

Using AzureCli with command completion on windows

If you're working with azure you're propably also working with AzureCli. This article shows how to get usable command completion on your client.

Daniel Nachtrub
Daniel Nachtrub

If you're working with azure you're propably also working with AzureCli or Azure Powershell. Depending on your personal preference you might prefere one of both.

I personally like to use the AzureCli despite i really like the concept of powershell where you're working with objects on the shell - which is much more powerful than handling text data.

So, when you're using AzureCli and missing command completion (like on azure shell) you might use the following options when working on windows.

Interactive mode

Microsoft provides interactive mode (az interactive) on AzureCli. Using this mode you may also use command completion.

While interactive mode works, it's not my recommendation (for now). You need to be quite patient as it's rather slow responding and feels overall not yet ready to use.

Azure Shell

Quite obvious - you might use the Azure Shell using your browser or Windows Terminal. This choice is handy if you need to do some small work. Working on larger topics Azure Shell is somehow annoying because of it's session timeouts and - just like interactive mode - it's not that fast.

Another point is that you cannot access your local filesystem using this method - working heavily on IaaS (like ARM templates) this is not really efficient.

WSL(2)

Having Windows Terminal and WSL(2) in place it's super easy to fire up a command line running on linux - like Ubuntu.

You can just install AzureCli on such an instance and get a quite responsive AzureCli which is fired up within seconds. You may also access your local filesystem.

What do you need?

  • Install WSL/WSL2
  • Get Ubuntu from Windows Store
  • Get Windows Terminal from Windows Store
  • Fire up Windows Terminal and Ubuntu
  • Install AzureCli on the Ubuntu terminal

That's it. Hope this helps getting your stuff done!

AzureLinux

Daniel Nachtrub

Just some guy working with computers.