Table of Contents
Currently, we have a Virtual Machine, and we have installed a web service on it. We can visit the website locally in the VM.
But when we trying to connect to the site using the public IP of the VM. The connection could not establish.
By default, when the VM is created. All ports are closed except TCP/3389 for Remote Desktop Service. So we need enable the ports manually.
Azure network security group
You can use a network security group to filter inbound and outbound network traffic to and from Azure resources in an Azure virtual network.
Network security groups contain security rules that filter network traffic by IP address, port, and protocol. When a network security group is associated with a subnet, security rules are applied to resources deployed in that subnet.
1. Login into the Azure portal.
2. Navigate to your VM section. Then select the Networking under Settings section of the VM.
3. Select Inbound port rules from the Settings section then click Add inbound port rule.
4. For example, we’ll create a security rule that allows ports 80 and 443 to the web server.
5. Once you’ve completed, review the rules you created. Your list should look like the list in the following example.
Now, to confirm that you can access the web server from the internet, open an internet browser on your computer and browse to http://<public-ip-address>