How to open a port on Azure Virtual Machine (2022-datacenter-azure-edition-hotpatch) except 80 & 3389.

Billy 20 Reputation points
2024-08-24T01:45:35.6933333+00:00

I cannot open any port in Azure Virtual Machine (2022-datacenter-azure-edition-hotpatch) except 80 & 3389. For example, to enable port 8500, I have done the required steps as below

  1. I have added port 8500 to NSG User's image
  2. On my VM, PS C:\Users\aiqaVM2024core> netstat -ant|findstr 8500

TCP 127.0.0.1:8500 0.0.0.0:0 LISTENING InHost

  1. Added inbound 8500 port in windows defender firewall correctly.
  2. From my pc run cmd: Test-NetConnection -ComputerName VM_IP -Port 8500

WARNING: TCP connect to (VM_IP : 8500) failed

SourceAddress : 192.168.0.11

PingSucceeded : True

PingReplyDetails (RTT) : 30 ms

TcpTestSucceeded : False

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,051 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 125.9K Reputation points Volunteer Moderator
    2024-08-24T02:42:48.29+00:00

    Hi,

    You need the server to listen on 0.0.0.0 or the private IP. Right now it is listening on loopback adapter (127.0.0.1), which isn't reachable from remote PCs.

    For example, when you do netstat it would show local address as 0.0.0.0:8500

    You need to reconfigure the application/service that is listening on TCP 8500 to bind to 0.0.0.0 instead.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.