You are currently viewing How To Create An Azure Virtual Machine Using PowerShell

How To Create An Azure Virtual Machine Using PowerShell

How To Create An Azure Virtual Machine Using PowerShell

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In this blog post, we will discuss how to create an Azure Virtual Machine using PowerShell.

What Is PowerShell:

PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language.

What is Azure Virtual Machine:

Azure Virtual Machine or Azure VM is the compute service offered by Azure to host your virtual servers in Azure cloud. Azure Virtual Machine is basically a virtual server running on Azure datacenter. Like in AWS you use EC2 instance or in GCP you use Google Compute Engine Instance, in Azure, you will use Azure VM instance if you need to create and manage your own server on Azure cloud.

Prerequisites:

  • One system with PowerShell for Azure installed and configured.

You can follow the below blog post if you haven’t installed and configured PowerShell for Azure yet.

https://cloudaffaire.com/how-to-install-and-configure-powershell-for-azure/

How To Create An Azure Virtual Machine Using PowerShell:

Step 1: Select the Azure location of your choice where you will deploy your Azure VM. For this demo, I am using southeastasia location.

Step 2: Create a resource group.

Step 3: Create a virtual network.

Step 4: Create a public IP address.

Step 5: Create a network security group.

Step 6: Create a virtual network card with the public IP address and network security group.

Step 7: Define a username with a blank password for your Azure VM.

Step 8: Create SSH key’s for your Azure VM.

Step 9: Define your Azure VM configuration. For this demo, I have used a CentOS image for my OS.

Step 10: Create your Azure VM.

Step 11: Get the public IP address of your Azure VM.

Step 12: Connect to your Azure VM.

Step 13: Cleanup

Hope you have enjoyed this blog post. Please refer below Azure documentation for more details

https://docs.microsoft.com/en-us/powershell/module/?view=azps-4.8.0

https://docs.microsoft.com/en-us/azure/virtual-machines/

 

Leave a Reply