Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 847 Bytes

File metadata and controls

54 lines (39 loc) · 847 Bytes

Resource Group & VM Creation

Azure Login

az login

Azure Resource Group Creation

az group create --name $RESOURCE_GROUP_NAME --location centralindia

VM Creation

Command :
az vm create  --resource-group $RESOURCE_GROUP_NAME \
			  --name $vm_name \
			  --image UbuntuLTS \
			  --output json \
			  --verbose \
			  --authentication-type all\
			  --generate-ssh-keys\
			  --admin-password Abc@12345xyz\
			  --query 'publicIpAddress' -o json

Return value : 
`PUBLIC_IP_ADDRESS`

Port

az vm open-port --port 80 \
				--resource-group $RESOURCE_GROUP_NAME \
				--name $vm_name \
				--priority 600

SSH Password Setup Using SSH

sshpass -f pass ssh -o StrictHostKeyChecking=no $USERNAME@$IP "sudo apt-get update; sudo apt-get install sshpass"