After configuring IIS on azure vm, I tried to browse website outside of VM, it is not accessible throwing HTTP error 401

Mohammad Bin Qasim Niaz 6 Reputation points
2022-01-15T12:11:11.71+00:00

After configuring IIS on azure vm, I browsed default website locall and it is accessible. But when I tried to browse website outside of VM, it is not accessible throwinh HTTP error 401. I have read a lot of articles but those were old. I don't find any latest solution for VM with 2019 datacenter and latest IIS. I created a VM in amazon and without any issue it started working as VM got ready. I have spent more than 3 days to find solution.

Inbound rule for HTTP 80 is configured in NSG.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,870 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Mohammad Bin Qasim Niaz 6 Reputation points
    2022-01-18T15:10:10.91+00:00

    Hello @Prrudram-MSFT ,

    I had created an inbound rule in Windows Defender Firewall, but it had not worked.

    I just deleted vm and created new one which worked on new VM.

    1 person found this answer helpful.

  2. Ravi Kanth Koppala 3,231 Reputation points Microsoft Employee
    2022-01-15T15:01:19.897+00:00

    @Mohammad Bin Qasim Niaz ,
    I can reproduce the error and able to fix the issue. I created a windows 2019 data center SKU with default values (and public IP). Then, when I tried to log into the machine, the IIS feature was not enabled by default, and I installed the feature. When I access the default website, I can browse the default IIS website.
    165350-img1.png

    I am not able to access the website from the outside. To make it work, I did open port 80 for HTTP access to the website via the internet. To do this, follow the below steps:

    1. Click on your VM in the Azure portal.
    2. Click on Network Interfaces > The IP address tab > Network Security groups > Click on the NSG that is available there.
    3. On the tab that appears click on Inbound Security rules > Add > Click on the Service dropdown and select http > Click on OK.

    After these changes, I can browse the website from the outside.
    165361-img2.png

    I understand you did the same steps. Can you please confirm if a public IP is configured for the VM?

    ----------

    (If the reply was helpful, please don't forget to upvote and accept as an answer, thank you)
    Ravi Kanth


  3. Mohammad Bin Qasim Niaz 6 Reputation points
    2022-01-15T16:54:48.88+00:00

    @RaviKanth-5629

    Thanks for your prompt response.

    I have done whatever you have pointed here. But when I browsed website publically, I get below error.

    This page isn’t working

    If the problem continues, contact the site owner.

    HTTP ERROR 401

    I don't understand what and where I should do changes to browse website publically. I have made public IP static.

    0 comments No comments

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.