ErrorCode: 500; Error: Internal Server Error

After deploying the installable cloud app to IIS, you received the following error when accessing the application.

ERROR [xxxxx] Failed to download the config file http://x.x.x.x:yyyy/appname/apprun.json; ErrorCode: 500; Error: Internal Server Error. 

Cause:

  1. The .NET Core Hosting Bundle is not installed on the IIS server.

    Solution:

    Download and install the .NET Core Hosting Bundle to the IIS server.

    The version of hosting bundle should match with the version of .NET framework used by Web APIs.

  2. The IIS_IUSRS group does not have the appropriate permissions for the files or the directories of IIS.

    Solution:

    Follow instructions in this web page.

  3. The IIS web site is occupied.

    Solution:

    Please double check and make sure the IIS web site is not being used by any other program.

If the above solution does not solve the issue, you should verify that IIS itself is working normally. For example, you can access the IIS default web site, if the IIS welcome page can display, it indicates IIS is working; if the welcome page cannot display, you should refer to the IIS troubleshooting guide to fix the error first, for example, refer to the following Microsoft documentation for more information about the 500.19 error: https://docs.microsoft.com/troubleshoot/developer/webapps/iis/health-diagnostic-performance/http-error-500-19-webpage.