DEV Community

Cover image for How to create an Azure Virtual Machine, using Azure CLI through Windows PowerShell.
Bernard Chika Uwaezuoke
Bernard Chika Uwaezuoke

Posted on • Edited on

How to create an Azure Virtual Machine, using Azure CLI through Windows PowerShell.

STEP 1: SIGN INTO YOUR AZURE ACCOUNT

  • Open Windows PowerShell Wait for the Shell Prompt to display, then enter the following command: az login

Image description

This command will open a new tab in your browser, displaying email addresses to sign into your Azure account, select accordingly and click.

Image description

This message will display on the browser tab.

Image description

At the same instance, the PowerShell will display your Azure account details, indicating you have signed into your account and ready to provision resources.

Image description

STEP 2: CREATE THE RESOURCE GROUP

Type the following command in your PowerShell:
az group create --name **Group Name** --location eastus

for this very project, below is the exact command.
az group create --name Don-RG --location eastus

With this, you can go to your Azure account portal to view the created resource group.

Image description

STEP 3: CREATE THE VIRTUAL MACHINE

  • Go to the Windows PowerShell and type this command: az vm create --name **vm name** --resource-group **resource group name** --image **image name** --admin-username **username** --generate-ssh-keys hit enter.

Image description

  • Go to the Azure portal to view the resource you created.

Image description

  • Click on the VM to view the Overview page.

Image description

Here you can see the IP address, Operating system, Resource group, Virtual network/subnet and other details of the Virtual machine you created.

Neon image

Serverless Postgres in 300ms (❗️)

10 free databases with autoscaling, scale-to-zero, and read replicas. Start building without infrastructure headaches. No credit card needed.

Try for Free →

Top comments (0)

Jetbrains image

Don’t Become a Data Breach Headline

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. Is your CI/CD protected? Check out these nine practical tips to keep your CI/CD secure—without adding friction.

Learn more

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay