1
votes

I'm trying to publish my .Net Core 2.2 Web app to a Linux environment.

I already created the Web App with a ServicePlan with Linux. I downloaded the publish profile and published it successfully.

I published it over FTP profile.

enter image description here

The problem is that when I access the web app address, it still shows the Azure Empty State web app:

enter image description here

Any ideas what I am missing?

1
It's been a long time since I messed with this, but I seem to call Azure drops like an index.html file in the root of a new Azure site. Perhaps you need to remove that file? When you publish, is there an option to remove existing files? - mason
@mason Yes, there's an option to do that. I will try and let you know. Thank you! - perozzo
@mason Just checked the option and the behavior continues. Do you have any more ideas? - perozzo

1 Answers

2
votes

I tried to repro your scenario and could see the same behavior.

There is a way one can configure Default documents for App Services, however, this is valid only for App Services on Windows and not Linux.

For Linux apps, the implementation would be based as per the runtime stack selected.

For .Net Core Razor pages specifically, the AddPageRoute() method can help in defining the route as described in this blog post:

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc().AddRazorPagesOptions(options =>
    {
        //"/Home/welcome" is the page we want to land at
        //The empty string signifies the root URL   

        options.Conventions.AddPageRoute("/Home/welcome", "");
    });

    services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}

That said, this worked only when published locally but not when published to the Azure App Service for Linux, which is not what one would expect.

I will check this with our internal Teams and get back to you. Thanks for bringing this to our attention!

UPDATE:

You could configure the Startup Command for your App Service. For .Net Core, it would look something like dotnet <myapp>.dll. This should definitely work. You can configure this setting here:

Startup Command Configuration

Note that you might have to delete all existing files prior to publish (from your Publish profile > Settings > File Publish Options > enable "Delete all existing files prior to publish" > Save) to see your changes.

Hope this helps!