Node js application hosting on azure vm windows

ReCloudS 80 Reputation points
2024-01-18T12:16:37.2666667+00:00

Hi I am trying to host the nodejs application on azure windows vm and I am able to run the application using pm2 start node.js after cloning the code and going to the particular directory/app folder and it was deployed successfully using cmd and now I want to access this publicly where it is working local host:7064 but not working directly for local host and I want to make this publicly accessible how can I do this ? I have configured the DNS name Aswell example.southindia.cloudapp.azure.com but it not accessible and also I opened the ports for vm 3369, 80 and 443 and 7064 Aswell but when am trying to access the website using dns name configured name or with public IP am not able to access the website and getting check your firewall settings and proxy settings , do I need to make any changes inside the Azure VM or in the azure portal ?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
Windows for business Windows Client for IT Pros Networking Network connectivity and file sharing
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,487 Reputation points Moderator
    2024-01-19T18:41:15.5266667+00:00

    Hello Satya Rekapalli

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Thanks for sharing the details, for make your Node.js application publicly accessible on your Azure Windows VM, you need to ensure a few things:

    • Verify that your Azure VM's Network Security Group allows inbound traffic on the ports your application is using (e.g., 3369, 80, 443, and 7064).

    Use this link (https://ping.eu/port-chk/) on the VM public IP and see if the ports are open or not.

    • Make sure that the Windows Firewall on your VM allows traffic on the necessary ports. Check the Advanced settings under Windows Defender Firewall in System and Security.
    • Ensure that your Node.js application is configured to listen on the correct IP address and port. In your Node.js application, make sure you are listening on 0.0.0.0 or your VM's public IP address, not just localhost.
    • Just cross check if you are using the correct public IP address or DNS name to access your application. Cross check DNS resolution if happening to the correct IP.
    • You also need to make sure that your local machine's firewall allows outbound traffic on the ports you are using to access the Azure VM.

    After making these changes, try accessing your application again. If you are still facing issues, check the logs of your Node.js application, Windows Server, or any other relevant logs to identify potential problems

    Hope this helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.