nAs you have reached here and reading through this post, it makes me assume that you are facing the same issue which I did and are looking for solution after trying multiple workarounds for the error i.e. Error 403: Forbidden whenever any MVC application is deployed on Azure Virtual Machine.
n
nBased on the error title, it appears that this must have to do something with permissions to some resource in IIS but that is not the thing here and I came to know this only after spending significant amount of efforts behind this. Lesson learnt– Error message could be misleading.
n
nInitial investigation lead me to multiple solutions and looking at the answer’s help count on different sites it appeared that mentioned solutions were working for other people, but why not for me?
n
nAs mentioned, there are multiple links you will get describing resolutions which worked for number of people below are few such links
n
n
n
nBased on the error title, it appears that this must have to do something with permissions to some resource in IIS but that is not the thing here and I came to know this only after spending significant amount of efforts behind this. Lesson learnt– Error message could be misleading.
n
nInitial investigation lead me to multiple solutions and looking at the answer’s help count on different sites it appeared that mentioned solutions were working for other people, but why not for me?
n
nAs mentioned, there are multiple links you will get describing resolutions which worked for number of people below are few such links
n
n
- n
- 403 Forbidden when running an ASP.NET MVC 4 application on Azure
- 403 forbidden after publishing asp.net MVC
n
n
n
n
n
nWhat worked for me?
n
n
n
nAfter trying all the possible solutions mentioned in the links I was still getting same error. Here is the thing which worked for me
n
n
n
nI was simply missing few IIS settings which I did not do while enabling IIS role on my Azure VM (Note that I am using Windows Server 2012 R2)
n
n
n
nAll I needed to do is,
n
n
n
nOpen Server Manager on VM hosting my MVC web application
n
n
n
nClick on Add roles and feature
n
n
n
n
n
n
n
n
n
n
nReach to the screen for selecting the role on this server and make sure you have enabled below two features along with other required features to enable IIS role.
n
n
n
n
n
n
n
n
nNote that, I managed to solve this by enabling below checkboxes (as shown above)
n
n
- n
- ASP.NET 4.5
- .NET Extensibility 4.5
n
n
n
n
nAnd after completing the installation, the 403 Forbidden error was gone.
n
n