-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathFull_Create_VM.txt
33 lines (21 loc) · 1.15 KB
/
Full_Create_VM.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
az login
az account show
az account list --all --output table
az account set --subscription "MSDN Platforms"
# Create a resource group.
az group create --name twrg10 --location westeurope
# Create a virtual network.
az network vnet create --resource-group twrg10 --name myVnet --subnet-name mySubnet
# Create a public IP address.
az network public-ip create --resource-group twrg10 --name myPublicIP
# Create a network security group.
az network nsg create --resource-group twrg10 --name myNetworkSecurityGroup
# Create a virtual network card and associate with public IP address and NSG.
az network nic create --resource-group twrg10 --name myNic --vnet-name myVnet --subnet mySubnet --network-security-group myNetworkSecurityGroup --public-ip-address myPublicIP
# Create a virtual machine.
az vm create --resource-group twrg10 --name myVM --location westeurope --nics myNic --image win2016datacenter --admin-username azureuser --admin-password "P@ssw0rd1234!!"
# Open port 3389 to allow RDP traffic to host.
az vm open-port --port 3389 --resource-group twrg10 --name myVM
#Clean Up
az group delete --name twrg10 --yes
az logout