401 Site  Error on new Azure Win 2012 server. need help to identify problem

bmanmike39 used Ask the Experts™
I receiving the following error when I Try to view my web site on my Azure win 2012 server.  Note, I have one site running, and it works fine, and I am using the same IP for both. But I can't get the second one running.

I have done the following:
Given read, write permissions to the directory and  IIS_IUSER  and Network services.
set the headers and application pool and set the ports to 80.

The file are in the directory but will not show.  I have a simple index.html file but still get 404

Thanks for any help in advance.


401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

on the site in question in iis you have to change the authentication to 'anonymous Authentication' and authorization to 'allow all users'
remember each site must have one of the following items to be unique
ip address/port/host name

a 401 error (authentication failure) is not a 404 (not found error)
btanExec Consultant
Distinguished Expert 2018

Can check that NTLM is done as priority e.g.
1.) Open iis and select the website that is causing the 401
2.) Open the "Authentication" property under the "IIS" header
3.) Click the "Windows Authentication" item and click "Providers"
4.) Have NTLM above the Negotiate .

Next, if you have the anonymous access to use specific credentials in the applicationHost.config file of IIS. Then configure the application pool running the virtual directory to use the same credentials configured for anonymous access e.g. in the virtual directory, open up the Authentication, and edit the Anonymous access credentials accordingly. That include full rights to IUSR as mentioned by David


I had already done this. I was finally able to get it to work.  I think it was that there was no web config file in the directory. but i was using an html file, not a aspx file. On IIS is a webconfig file necessary regardless of file type?
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Top Expert 2016

the initial setting is the apphost.config a web.config inherits the apphost.config settings and can be used to customize the web site settings.


So when I setup a new site on the server, does the root have to have a webconfig file in it, Or will this produce an error?
Top Expert 2016

no as long as it can use the settings in the apphost.configthis is what controlles the apphost.config
Exec Consultant
Distinguished Expert 2018
if you are using asp.net, as a whole it is as below
-at server level, you have Machine.config
-at IIS level, you have ApplicationHost.config
-at Root Web level, you have Web.config (stored in the same directory as the Machine.config. At run time, this file is merged second from the top in the configuration hierarchy.)
-at Web site level, you have Web.config (for a specific Web site contains settings that apply to the Web site and inherit downward)
-at ASP.NET application root directory level, you have Web.config (for specific ASP.NET application is located in the root directory of the application and contains settings that apply to the Web application and inherit downward)
-at ASP.NET application subdirectory level, you have web.config  (for an application subdirectory contains settings that apply to this subdirectory and inherit downward)

May be worth working as ASPX instead of html.You can have Web.config. It must contain only entries for configuration items that override the settings in the Machine.config file.  In that specific folder, can have the web.config and comment authorization/allow for your specific users (as testing)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial