Quickstart: Create a Windows Virtual Machine in Azure
This quickstart guides you through creating a Windows virtual machine (VM) in Azure using the Azure portal. A virtual machine is an on-demand and flexible computing resource that provides the capabilities of a physical computer.
Tip: You can also create a VM using the Azure CLI or Azure PowerShell.
Prerequisites
Before you begin, you need an Azure subscription. If you don't have one, create a free account before you start.
Sign in to Azure
Sign in to the Azure portal with your Azure account.
Create a Virtual Machine
1. Navigate to Virtual Machines
In the Azure portal, search for and select Virtual machines.
2. Create a Virtual Machine
On the Virtual machines page, select Create and then choose Virtual machine.
3. Configure Basic Settings
On the Create a virtual machine page, go to the Basics tab:
- Subscription: Select your Azure subscription.
- Resource group: Create a new resource group or select an existing one. Resource groups organize related Azure resources.
- Virtual machine name: Enter a unique name for your VM, e.g., myWinVM.
- Region: Choose the Azure region closest to you or your users.
- Availability options: For this quickstart, you can leave this as No infrastructure redundancy required.
- Security type: Select Standard.
- Image: Select Windows Server 2022 Datacenter: Azure Edition or another Windows Server image.
- Size: Choose a VM size, e.g., Standard B2s (2 vCPUs, 4 GiB memory).
- Administrator account:
                        - Username: Enter a username for the administrator account, e.g., azureuser.
- Password: Enter a strong password and confirm it.
 
- Username: Enter a username for the administrator account, e.g., 
- Inbound port rules: Select Allow selected ports and then select RDP (3389) from the dropdown. This allows you to connect to the VM using Remote Desktop Protocol.
Click Next: Disks >.
4. Configure Disks
On the Disks tab:
- OS disk type: Select Premium SSD for better performance.
- You can leave the other disk settings as default for this quickstart.
Click Next: Networking >.
5. Configure Networking
On the Networking tab:
- Virtual network: A new virtual network will be created by default.
- Subnet: A subnet will be created within the virtual network.
- Public IP: A new public IP address will be created.
- NIC network security group: Select Basic.
- Public inbound ports: Ensure RDP (3389) is selected.
Click Next: Management >.
6. Configure Management (Optional)
You can review the management settings and adjust them if needed. For this quickstart, the defaults are fine. Click Next: Advanced >.
7. Configure Advanced Settings (Optional)
Review advanced settings such as extensions, custom data, and availability options. Click Next: Tags >.
8. Add Tags (Optional)
Tags are name/value pairs that enable you to categorize resources. Click Next: Review + create >.
9. Review and Create
On the Review + create tab, Azure will validate your configuration. Once validation passes, review the settings and click Create.
Connect to the Virtual Machine
Once the deployment is complete, navigate to your virtual machine resource.
1. Get the Public IP Address
On the VM's overview page, find and copy the Public IP address.
2. Connect using RDP
Open a Remote Desktop Connection client (e.g., `mstsc.exe` on Windows).
- Enter the Public IP address of your VM.
- Click Connect.
- When prompted for credentials, select More choices, then Use a different account.
- Enter the username and password you created earlier (e.g., azureuserand your password).
- You may see a certificate warning; click Yes to connect.
Clean up resources
When you are finished with the VM, you can delete the resource group to remove the VM and all its related resources. Navigate to the resource group you created, click Delete resource group, and follow the prompts.
Next Steps: Explore configuring disks, networking, and installing applications on your Windows VM.