I am not able to connect from local bash or Azure CLI (portal & local) to newly spinned up Ubuntu "Private" IP VM on Azure
Verified port 22 open for SSH from "Any" with higher priority and no other NSG rules blocking it
I understand this is because my local system is not part of VNET that VM is on, though I connect using enterprise VPN
Only option I see is to use Azure Bastion service( charged separately) with standard tier, native client support; and then add extension on local Azure CLI ( az network bastion ssh)
Azure Bastion protects your virtual machines by providing lightweight, browser-based connectivity without the need to expose them through public IP addresses. Deploying will automatically create a Bastion host on a subnet in your virtual network.
- What could be other options to connect to Private VM
- How to access web application host:port deployed on same VM
2
Answers
Finally adding inbount NAT rule for ssh 22 and another NAT rule with custom port for my application, solved my connection issue Thank you @Venkat for details earlier
There are several other options to connect to a private VM in Azure,
Azure VPN Gateway: You can connect on-premises network to the Azure VNET where the VM resides using Azure VPN Gateway, enabling access to the VM via its private IP address without public IP, you can use a point-to-site or site to site VPN connection to connect your local system directly to the
Azure VNET
Azure ExpressRoute: The Azure VNET that is hosting the virtual machine can also be connected to your on-premises network via a dedicated connection using Azure ExpressRoute, which allows access via the private IP address of the virtual machine.
Azure Bastion: The bastion service offers secure RDP/SSH access to VMs from the Azure portal, removing the need for public IPs or VPN connections
To use the private IP address of a VM to access a web application on that VM, you can create an Azure public load balancer. This will allow you to reach the application on the VM through the load balancer’s public IP address, You can do this by following these steps.
Public IP
address for the load balancer.For more details refer the SO link for configuring application on windows VM using
Azure Load Balancer
.