Search code examples
azureazure-web-app-serviceazure-webapps

Azure publish completes, but the site shows next steps to deploy


I have an asp.net core 2.0 website built in VS19 that I am deploying to an Azure app service. The source code repo is in Azure Dev Ops, but I want to deploy directly from my local machine.

In Azure I created the Azure App Service and downloaded the 'Publish Profile' and imported it to VS2019 and executed the Publish. The output window shows that everything was deployed successfully.

enter image description here

However, when I navigate to the deployment url, I get this screen instead of my app.

enter image description here

What am I doing wrong? There isn't any error messages, so I can't really search.

EDIT: In startup.cs, my default route is in an Area. So I have the following defined:

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "areaRoute",
            template: "{area:exists}/{controller=Account}/{action=Login}");


        routes.MapAreaRoute(
            name: "default",
            areaName: "Home",
            template: "{controller=Account}/{action=Login}");

        //routes.MapRoute(
        //    name: "default",
        //    template: "{controller=Home}/{action=Index}/{id?}");
    });

Solution

  • This happens if you dont have the starting page above the hostingstart.html . Make sure you default page is listed in here and is above hostingstart.html so that will be picked by default.

    If you are wondering how to do

    On Windows OS:

    “App Services” blade > Select your “Web app”, click on “Configuration” and Default Documents "

    Linux OS:

    If the webApp has linux OS it wont have the default documents, you need to set the startup command as dotnet yourapp.dll under general settings

    enter image description here

    Also make sure to check "Remove additional files at destination button during republish" on Visual Studio. That will remove the files existing in the WebApp before upload the files.