How to Install and Use Azure CLI in Visual Studio Code

How to Install and Use Azure CLI in Visual Studio Code

ยท

2 min read

Introduction

In this guide, we will walk through the steps on how to install and use the Azure Command-Line Interface (CLI) in Visual Studio Code. Azure CLI allows you to interact with Microsoft Azure services directly from the command line, and integrating it into Visual Studio Code streamlines your development workflow. Follow along to learn how to set up and leverage Azure CLI seamlessly within the Visual Studio Code environment.

Installation Steps

1. Download and Install Visual Studio Code

Ensure that you have Visual Studio Code installed on your computer. You can download the latest version from the official Visual Studio Code website (https://code.visualstudio.com/).

2. Create an Azure Account

You need an active Azure account to access Azure services. If you don't have one, you can create a free account on the Azure website (https://azure.microsoft.com/en-us/free/).

3. Install Azure CLI on your Device

Install the Azure Command-Line Interface (CLI) on your machine. You can download the installer for your operating system from the official Azure CLI website (https://docs.microsoft.com/en-us/cli/azure/install-azure-cli).

4. Azure CLI Extension for Visual Studio Code

Install the Azure CLI extension for Visual Studio Code. You can do this directly from the Visual Studio Code marketplace by searching for "Azure CLI" in the Extensions view (Ctrl+Shift+X) and clicking install.

5. Now you can work with Azure CLI Tools in Visual Studio Code

Open the Terminal in VS code, type in command "az login" to sign in to your Azure account and establish a connection.

This action will open the Azure sign-in page in your default web browser.

Then sign in and start using Azure CLI commands in the terminal to manage Azure services, such as listing resource groups (az group list) or creating a virtual machine (az vm create).

By completing these steps, you're ready to leverage Azure CLI tools within Visual Studio Code, allowing you to seamlessly interact with Azure services directly from your development environment.

ย