An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
Hello Mihiran Priyankara
We understand that you want the application hosted on the Azure Linux Virtual Machine (cfgea.xxx.cloudapp.azure.com) to be accessible only when users connect through an Azure VPN, and not directly from the public internet.
To achieve this, we suggest configuring Network Security Group (NSG) rules to restrict inbound traffic to the Virtual Machine. The NSG should allow access only from the VPN client address pool (such as 192.xx.0.0/24), which is assigned to users once they connect to the VPN.
Create a inbound NSG rule with the lowest priority in the source section add your VPN client address range (192.x.0.0/24). Set the source port to *, and for the destination, you can specify your VM's private IP. If you want the VPN address range to access all resources in the VNET, set the destination to any. Choose TCP as the protocol and set the destination port according to your requirements.
With these settings, only users connected through the Azure VPN will be able to access the application, while direct access from the public internet will be blocked. For additional security, you could also remove the public IP address from the Virtual Machine and use its private IP address over the VPN connection, which would prevent any public exposure of the application.
Check the below document for more understanding:
Azure network security groups overview
Create, change, or delete a network security group
I hope the above answer helps you! Please let us know if you have any further questions.
Please don't forget to "upvote" where the information provided will help you, this can be beneficial to other members of the community.
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.