🔧 Programmierung 🕛 vor 6 Monaten 7 Min Lesezeit
0

Setting Up Visual Studio Code and Azure CLI on Windows Using PowerShell

↗ Quelle (dev.to)
🗣️ Stimme:

Setting up a development environment is one of the first steps when starting any technical project. However, the process can sometimes be confusing, especially when different tools, terminals, and command-line environments are involved.



As I began exploring cloud technologies and command-line tools, I needed to prepare my local environment to interact with Microsoft Azure. This meant installing a code editor, configuring a terminal environment, and setting up Azure CLI so that I could manage cloud resources directly from my computer.



In this article, I will walk through how I installed Visual Studio Code, opened and used the integrated PowerShell terminal, and installed Azure CLI to connect to Microsoft Azure. Along the way, I’ll demonstrate a few basic terminal commands and explain some small syntax details that can sometimes cause confusion when working in PowerShell.



If you're new to cloud tools or command-line environments, this guide will help you set up a simple and functional development environment on Windows.



Below is a clean walkthrough you can follow in your blog after the introduction.



1. Installing Visual Studio Code



To begin setting up the development environment, I installed Visual Studio Code, a popular and lightweight code editor used by developers. From your browser, search for, download and install Visual Studio Code depending on your operating system (I will be working with Windows).





2. Launching Visual Studio Code



Once the installation is complete, click Finish to open Visual Studio Code.

You can also launch it later by:




  • Clicking the Start Menu, searching for Visual Studio Code and open it.
    When the editor opens, you will see the main workspace interface.





4. Opening the Integrated Terminal

After creating and opening a working folder, the next step is to access the integrated terminal inside Visual Studio Code. The integrated terminal allows you to run command-line instructions without leaving the editor, making it easier to manage files and execute commands in one place.

Do not forget to close the Welcome message and the chat box page on the screen.

STEPS:




  • From the top menu bar, click Terminal then New Terminal.


  • A terminal panel will open at the bottom of the editor.

    By default on Windows systems, the terminal opens using Windows PowerShell.

    You should see something similar to:







  • Paste the command into the terminal in Visual Studio Code and press Enter to complete the setup.

    In my case, already have it installed.



    6. Log in to Azure

    Next, authenticate your CLI with Microsoft Azure.




    • Run: az login and sign in or select the Azure account you want to log into.





    In case you noticed, the Terminal shows PS C:\Users\Fadeyi Peter> instead of showing the folder we created earlier. To correct the Directory, Run cd "your folder name" for example: cd "Linux Servers". Then your Terminal shows it.





    8. Running Basic Commands in PowerShell

    After successfully signing in to Microsoft Azure using Azure CLI, it is helpful to run a few basic commands to understand how the terminal works.



    Since the integrated terminal in Visual Studio Code opens Windows PowerShell by default on Windows, we can begin by testing a few simple commands.




    • Display the Current Directory.
      Run pwd to see the current working directory.
      This command shows the folder where your terminal is currently operating.






    • Create a Test File.
      You can create a simple file using: New-Item test.txt and Run ls again and it should now display the file you just created.





    9. Defining Variables in PowerShell

    While experimenting with commands, I attempted to define variables within the PowerShell environment. However, I quickly ran into several errors because PowerShell requires a specific syntax when declaring variables.



    In PowerShell, variables must begin with the $ symbol.







    Creating a Resource Group with Azure CLI



    In this section, we will define variables and create a Resource Group using PowerShell with Azure CLI. This allows us to reuse values such as the resource group name and location when running commands.



    Later in the series, we will explore how to switch from PowerShell to Bash using Windows Subsystem for Linux and examine how command syntax and variable handling differ between these environments.



    STEPS



    i. Define your variables.

    You can define variables like this:




    CODE
    $RG = "Testing-09-rg"
    $LOCATION = "eastus"






    Write each variable and press enter, then define the next.



    iii. You can also run az group list --output table to see the resource group on Visual Studio code.





    Now you can create different Azure resource depending on your task.



    Delete Resource through the Visual Studio code

    As you can create a resource through the Visual Studio code, you can as well delete through it. Example, to delete the Resource group created, run az group delete --name $RG



    Azure will ask for confirmation: Are you sure you want to perform this operation? (y/n)




    • Enter yes or y to confirm deletion.


    • Run az group list --output table, you will see that it will not show the resource group again.






    Conclusion



    Setting up a development environment is an important first step when working with cloud platforms and command-line tools. In this guide, we walked through the process of installing Visual Studio Code, opening and using the integrated PowerShell terminal, and installing Azure CLI to connect to Microsoft Azure.



    Along the way, we explored a few basic PowerShell commands, learned how to navigate directories, create files, and verify our Azure account directly from the terminal. We also discovered how small syntax rules—such as the requirement to use the $ symbol when defining variables in PowerShell—can sometimes lead to errors if overlooked.



    Understanding these fundamentals makes it much easier to work with command-line tools and cloud resources. With this environment now set up, we are ready to move on to more advanced tasks such as automating cloud resource creation and exploring other shell environments like Bash.



    In the next article, we’ll explore how to switch from PowerShell to Bash using Windows Subsystem for Linux (WSL) and examine how variable syntax and command behavior differ between these two environments.

    Vollständiger Original-Artikel
    Den kompletten Beitrag mit allen Details direkt auf dev.to lesen.
    ↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Staatliche Hacker treiben laut Chainalysis einen Anstieg von 420 % bei Onchain-Malware voran
1 Quelle
Chinesische KI-Modelle verursachen Anstieg der auf der Blockchain platzierten Malware ...
1 Quelle
Millionen-Lösegeld nach Hacker-Angriff auf Revolut: Was Kunden jetzt wissen müssen
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Setting Up Visual Studio Code and Azure CLI on Windows Using PowerShell

Thematisch verwandte Begriffe: Setting, Visual, Studio, Code · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...