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

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

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 Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,305 questions
{count} votes

2 answers

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

    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. answered 2021-04-14T15:10:29.003+00:00
    Lex Li (Microsoft) 3,201 Reputation points

    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