Search code examples
azureasp.net-mvc-5web-deploymentvirtual-directoryhttp-status-code-500

Internal Error on Virtual Directory Deployment


I have an application that I need to deploy at the root of my Azure site as well as a Virtual directory - hls. Virtual Directory Path
It is the same project that needs to be deployed to both the locations. The only difference is the database connection string that I change from the web.config file. Besides this, the entire MVC application is the same.

I followed the deployment from here with the following publish setting. Publish settings

After deployment, I even looked into kudu and found the folder and the respective contents within.Kudu screenshot
But even so, I am unable to understand why the page returns an Internal Server Error (Error 500).

Note: The same application deployed at the root works fine.


Solution

  • The problem was not with one of the things mentioned above, but because of a conflict in the web.config file. I didn't realize this at first, but the web.config file works as an inheritance. Some elements in the root application's web.config were also present in the child application.

    In my case it was a rewrite element which converted the URLs from http to https.

    Solved it by merely commenting it in the child web.config