Author : MD TAREQ HASSAN | Updated : 2020/11/10
Using RDP
Prerequisites for RDP:
- The NIC msut have a public IP address
- Creating Public IP address
- Associate public IP address to NIC and make it primary if needed
- NSG must allow RPD post 3389 (See: Adding Inbound rule for RDP)
- Configuaring existing NIC (which does not have Public IP and it’s NSG does not allow RDP 3389)
- Create new Public IP address and NSG (new NSG should allow RDP 3389)
- Resource group > select NIC
- Settings: IP Configuration > ‘+ Add’ > add newly created Public IP (make it primary if needed)
- Settings: Network Security Group > Select newly created NSG (mentioned that newly created NSG allows RDP 3389)
- Notes:
- Allowing RDP while creating VM is the fastest way to connect
- Attaching public IP , NIC & NSG after VM creation caused a problem in my case -> Public IP was not showing up in VM and ended up re-creating VM
Procedure to connect to VM using RDP:
- Go to resource group: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group where the virtual machine belongs
- Check that the virtual machine is running
- Connect > RDP > Download RDP file
- Open RDP file > More > use another account > use id and password (set when created VM)
- “Yes” for certificate
- Should be connected to remote VM
Using Bastion
- Bastion is PaaS for securly connecting to VMs from inside Azure portal
- When using Bastion, VMs will be connected and controlled via browser
Creating bastion
- Create a public IP for Bastion
- Create Bastion while creating vNet (assign the public IP to Bastion)
Connecting to VM using Bastion
- Go to Azure portal > resource groups
- Select target VM > connect > select Bastion (check that browser is not blocking popup)
- User id & password > connect
- A new window will open & you can control VM
Connecting to Linux VM
- Go to resource group: https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroups
- Select resource group where the virtual machine belongs
- Check that the virtual machine is running
- Connect > SSH > Copy command
- Open terminal (CMD/Git Bash/Cmder) > paste command and press enter
- Note: during Linux VM creation, SSH public key was set and therefore password is not needed to connect