DEV Community

Cover image for Master Azure Development: Linking Cloud Shell with VS Code on Windows Made Easy
Oluwatobiloba Akinbobola
Oluwatobiloba Akinbobola

Posted on

Master Azure Development: Linking Cloud Shell with VS Code on Windows Made Easy

INTRODUCTION

If you are using Azure Cloud Shell and wish to combine it with VS Code on Windows, you may run into problems where the az command is not recognized in the Visual Studio Code (VS Code) terminal. Here's how to fix this problem step-by-step.
Step 1: Install Azure CLI

  1. Download the Azure CLI ZIP file from the official Azure CLI Releases page.
  2. Extract the ZIP file to a directory, e.g., C:\Users\<YourUsername>\AzureCLI.

Step 2: Add Azure CLI to PATH
To make the az command available in your terminal, you need to add the Azure CLI bin directory to your system's PATH.

Temporary Solution (Current Session Only)

  1. Open the terminal in VS Code (Ctrl+`).
  2. Run the following command to temporarily add the Azure CLI path to the PATH variable: $env:Path += ";C:\Users\<YourUsername>\AzureCLI\bin"
  3. Test the az command: az --version

Terminal Image

Permanent Solution

  1. Open PowerShell.
  2. Run the following command to add the Azure CLI path to your user PATH permanently: [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Users\<YourUsername>\AzureCLI\bin", "User")
  3. Restart VS Code and test the az command: az --version

Step 3: Verify the PATH in VS Code

  1. Open the integrated terminal in VS Code (Ctrl+`).
  2. Run the following command to check the PATH variable: $env:Path Ensure C:\Users\<YourUsername>\AzureCLI\bin is included.

Step 4: Troubleshooting
If the az command still doesn’t work:

  1. Ensure the bin folder contains the az.cmd or az.exe file.
  2. Restart your computer to apply all changes.
  3. Consider using the Azure CLI MSI installer for a hassle-free installation: Install Azure CLI.

CONCLUSTION

You can use the az command with ease and successfully link Azure Cloud Shell with Visual Studio Code on Windows by following these steps. This article guarantees that you can effectively manage your Azure resources from within Visual Studio Code, regardless of whether you opt for a temporary or permanent solution.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay