Search code examples
azurenetworkingcloudazure-virtual-networkazure-nsg

How to expose HTTP port on azure VM


I am trying to expose port 7445 on my azure VM for HTTP (not HTTPS) requests, I have added an inbound rule for this port still cant access it. Can any one have idea what I am doing wrong? below is the screen shot of my inbound port rule

I have tried with different priorities also, I am trying to access the spring boot api running on this VM through POSTMAN

enter image description here enter image description here


Solution

  • Yes, you can expose port 7445 as HTTP endpoint.

    Actually you will have to keep the port open for TCP and then run a HTTP server on that port. The server will then handle all the HTTP traffic on that port.

    First open the Inbound Traffic for the port from INBOUND PORT RULES from Network Interface of the VM in Azure Portal, then you need to check if your VM is using any sort of firewall internally. If there is any firewall it needs to allow traffic on that port. To manage a simple firewall in your VM you can use UFW