DEV Community

Cover image for Ctrl+Shift+A in Windows Terminal to launch Azure CLI authentication

Ctrl+Shift+A in Windows Terminal to launch Azure CLI authentication

James Cook
Over 10 years of career experience in IT, currently focusing on improving my cloud and coding skills. I have setup this blog to share my knowledge, experience and hopefully to inspire others.
Originally published at ・2 min read

I found logging into Azure via CLI a repetitive task but not a long one. I did however utilised Windows Terminal Actions to create key bindings to type in the login command.

Configuring settings.json

  1. Launch Windows Terminal;
  2. Select the down arrow next to the add tab option and select Settings; azloginterm3.png
  3. The settings.json file will open up with your default code editor. Within the file you need to add the below line of code:
    "actions": [
        { "command": { "action": "sendInput", "input": "az login\return" }, "keys": "ctrl+shift+a" }
Enter fullscreen mode Exit fullscreen mode

Add this code in a place appropriate, it should look something like this:
Once the code has been included in the file, save it and relaunch Windows Terminal (any errors, review and correct).

How to launch

Now your ready to sign in to Azure CLI using the key bindings, launch Windows Terminal and hold down the following keys:
Ctrl + Shift + A

Once you do this, the below will display on your terminal:

You will also have a web browser window appear asking you to login to Azure to authenticate.

What else can you do

You can amend the command line field so you can include some more information to include as part of the authentication. Find all sign in methods from Microsoft Azure CLI documentation. There is other ways to improve on this or to do something different but remember to consider security before implementing these, you do not want to reduce security to improve convenience.

Discussion (0)