Russell Smith specializes in the management and security of Microsoft-based IT systems. In addition to blogging about Windows and Active Directory for the Petri IT Knowledgebase, Russell is a Contributing Editor at CDW’s Biztech Magazine. Russell has more than 15 years of experience in IT, has written a book on Windows security, co-authored one for Microsoft’s Official Academic Course (MOAC) series and has delivered several courses for Pluralsight.

Connect to Azure Cloud Shell in Windows Terminal Preview

This month, Microsoft issued a significant update to the preview version of Windows Terminal, the new console application for Windows 10. Announced at Build in Seattle at the beginning of May 2019, Windows Terminal will eventually replace the console that’s currently built-in to Windows 10. Microsoft has reached the end of the road with the current console because while it has seen some minor improvements over the last couple of years, new features can’t be added without breaking backwards compatibility. So, Microsoft took the decision to start from scratch and develop a new terminal.

In a post on Microsoft’s Windows Command Line Tools For Developers blog, Kayla Cinnamon announced that the latest build includes a connector for Azure Cloud Shell. Azure Cloud Shell is a browser-based command-line console hosted in the cloud that gives you access to Azure files and projects via Bash and PowerShell. Windows Terminal 0.3 lets you add an Azure Cloud Shell profile and connect to Azure directly from the terminal window.

Azure Cloud Shell Connector

If you are installing Windows Terminal from the Microsoft Store for the first time, you will see the option to connect to Azure from the dropdown menu next to the new tab button on the title bar. If you are upgrading from an earlier release of Windows Terminal, you’ll need to add the Azure Cloud Shell Connector profile to your settings file.

Connect to Azure Cloud Shell in Windows Terminal Preview (Image Credit: Russell Smith)

To add the Azure Cloud Shell Connector profile to your settings, follow the instructions below.

  • Open Windows Terminal and press CTRL+, (the control key and comma at the same time). This will open the json file.
  • Scroll down to the “profiles” : section of the file and add the following profile to the file.

  • Close and save json.
  • Now you will see Azure Cloud Shell in the dropdown menu in Windows Terminal.
Connect to Azure Cloud Shell in Windows Terminal Preview (Image Credit: Russell Smith)

When opening a new Azure Cloud Shell session in Windows Terminal for the first time, you’ll need to follow a web-based connection process. Just follow the instructions provided in the terminal window. It involves going to https://microsoft.com/devicelogin and entering a code provided in the terminal.

Connect to Azure Cloud Shell in Windows Terminal Preview (Image Credit: Russell Smith)

Once you’ve entered the code, you’ll be prompted to sign in to your Azure subscription in the browser. After sign-in, you’ll be redirected back to Windows Terminal where you might be required to choose a tenant ID to use before getting access to Azure Cloud Shell.

Connect to Azure Cloud Shell in Windows Terminal Preview (Image Credit: Russell Smith)

Bash is Default Azure Cloud Shell

The terminal session defaults to Bash. Changing to PowerShell is as simple as typing pwsh and pressing ENTER. But I found that switching to PowerShell is buggy in this release. Hopefully in a future version, Microsoft will allow you to configure the default shell in the settings file (profiles.json).

The Azure Cloud Shell Connector is the most interesting feature in this preview version of Windows Terminal. But there are some other major improvements, including the ability to drag the terminal window from anywhere on the title bar, a better dropdown button layout, accessibility improvements, and new background options. For a full list of changes, check out Microsoft’s blog post here.

BECOME A PETRI MEMBER:

Don't have a login but want to join the conversation? Sign up for a Petri Account

Register