Getting Started with Azure CLI, WSL 2, Windows Terminal

linuxThe Azure CLI is foundational to getting started in Azure, Windows Subsystem for Linux (WSL) is an optional feature of Windows 10 that allows you to run Linux on Windows, and the Windows Terminal. For those of us who spend time in Microsoft Teams, Microsoft Office and want to work with Visual Studio Code, it is the perfect combination.

Install WSL 2

WSL 2 is a new version that works well with Windows 10. You can access all of Docker. You get a full Linux footprint. Linux binaries use system calls to perform functions such as accessing files, requesting memory, creating processes, and more.And the updated version provides good access to the Windows file system.

The documentation provides for Windows Subsystem for Linux Installation Guide for Windows 10. You may need to update your Windows to install WSL2. Once it is installed, you get one or mor Linux distros from the Windows Store.

ubuntu

You can pick your flavor of Linux from the store. I learned Ubuntu, so you will see a lot of Bash script in this blog. You can select your version. Once you start the app, you will provide a user name and password.

And if you forget your password, you can reset it from PowerShell. Then to start it, you open up PowerShell or a command line and type in wsl.

Ubuntu 20.04 LTS comes with:

  • git. Use git --version to get the version
  • Docker. Use docker version for the version.
  • Python 3. Get the version using python --version

You can install:

  • Updates to the OS: sudo apt update && sudo apt upgrade Ubuntu will ask for your password.
  • Azure CLI: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

To get back to PowerShell or the command line, type exit.

You can easily set the version of any WSL distro to be using WSL 2 with the command: wsl.exe --set-version 2.

WSL Futures

In upcoming versions of WSL,  you will be able to simply install WSL by entering: wsl.exe --install in your command-line. Adding CUDA and/or GPU Compute support. Linux GUI apps on your desktop seamlessly alongside your Windows apps.

Windows Terminal

When you are on Windows, you want a powerful way to run your commands. Now comes the release version of Windows Terminal.

terminalGet Windows Terminal from the Windows Store. You can run Command Prompt, PowerShell, and WSL all at the same time in separate tabs. The biggest and best feature that I use is having multiple tabs.

You can run PowerShell side by side with Bash on WSL in separate sessions. Just start a new tab which starts you in PowerShell. Then if you want wsl, type wsl. If you want the command prompt, type cmd.

terminal-screen
The Windows Terminal uses a GPU accelerated DirectWrite/DirectX-based text rendering engine. This new text rendering engine will display text characters, glyphs, and symbols present within fonts on your PC, including CJK ideograms, emoji, powerline symbols, icons, programming ligatures, etc.

You can start Windows Terminal from PowerShell or your command line. Type wt.

You can save your tab settings in profiles and lets you split the screen. For example:


wt p "Command Prompt" `; split-pane p "Windows PowerShell" `; split-pane H wsl.exe

In this article, you have seen how to set up PowerShell, command line, and WSL and then provide views into your code. You have also seen how to install Azure CLI into WSL.

References


Leave a Reply