There are different ways to provision a VM
- Through Azure Portal
- Through Powershell
- Through Azure CLI
- Through Azure SDK
- Create Resource Group
- Create a Virtual network.
- Create a Virtual NIC.
- Create VM
- Connect to VM.
- Install Additional Softwares (optional)
Since AZ 204 is developer certification, skipping the exercises using the azure portal.
Refer https://docs.microsoft.com/en-us/azure/virtual-machines/windows/quick-create-portal if needed.
Step 1: Login to Azure
Connect-AzAccount
Step 2: Create a resource Group
New-AzResourceGroup
-Name "az204StudyRg" `
-Location "CentralUS"
Step 3: Create new VM
New-AzVm
-ResourceGroupName "az204StudyRg" `
-Name "studyVm" `
-Location "CentralUS" `
-VirtualNetworkName "studyVNet" `
-SecurityGroupName "studyNSG" `
-PublicIpAddressName "studyPubIp" `
-OpenPorts 80,3389
Step 1: Login to Azure
Step 2: Create a resource Group
az group create \
--name az204StudyRg \
--location centralus
Step 3: Create new VM
az vm create \
--resource-group az204StudyRg \
--name studyVm \
--image UbuntuLTS
Tip: Check out Mindmap for powershell or Azure CLI for quick review
Complete code for task can be found in solution CreateVm.sln
under source
directory