Published MVC App to Azure App Service but the default Azure App Service Page is still diplayed

VieuxBeaugars 1 Reputation point
2021-04-14T11:15:19.543+00:00

Hi all,

I am helping a friend publish is MVC C# web App to Azure App Service and after successfully publishing to Azure App Service using Visual Studio 2019 I still get the default App Service page. I have been trying everything for the past two days and can't figure out for the life of me what I am missing.

A few things to note is that since this is a MVC App there's no default page that I can add to the default document section in Azure App Service and removing hostingstart.html from the list results in "You do not have permission to view this directory or page"

Any help would be really appreciated.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,964 questions
{count} votes

2 answers

Sort by: Most helpful
  1. sadomovalex 3,626 Reputation points
    2021-04-14T14:42:56.867+00:00

    did you deploy all ASP.Net MVC files to bin folder together with other assemblies? In Azure there is no GAC so all dlls should be deployed to bin. E.g. for MVC5 these files are needed:
    Microsoft.Web.Infrastructure.dll
    System.Web.Helpers.dll
    System.Web.Mvc.dll
    System.Web.Razor.dll
    System.Web.WebPages.dll
    System.Web.WebPages.Deployment.dll
    System.Web.WebPages.Razor.dll

    Also check other steps in this article: Migrate your .NET web app or service to Azure App Service.


  2. Lex Li (Microsoft) 4,742 Reputation points Microsoft Employee
    2021-04-14T15:10:29.003+00:00

    The simplest is to allow your MVC app to handle / via routing,

    routes.MapRoute(
                "Default", // Route name
                "",        // URL with parameters
                new { controller = "Home", action = "Index"}  // Parameter defaults
            );
    

    https://stackoverflow.com/questions/1142003/set-homepage-in-asp-net-mvc