Trouble running angular app on the azure vm public ip address

NDARUHUYE Yves 20 Reputation points
2024-04-03T09:29:21+00:00

i have issue withe azure vm public ip,

im running ng serve --host ip but it throws error saying that the ip is not available what is the issue

Error: listen EADDRNOTAVAIL: address not available ip

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
{count} votes

Accepted answer
  1. TP 124.7K Reputation points Volunteer Moderator
    2024-04-03T11:49:29.0633333+00:00

    Hi,

    You cannot use the VM's public IP in your ng serve because it [the Public IP] isn't known inside of the VM. This is normal and expected. Instead, you can use 0.0.0.0, similar to below:

    ng serve --host 0.0.0.0
    

    Additionally, in order for your app to be reachable via public Internet you need to A) make sure incoming port 4200 is allowed in the VM's firewall and B) make sure you've allowed port 4200 incoming in your NSG (it appears you have already done this)

    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.