Reputation: 1019
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.
The problem is that when I access the web app address, it still shows the Azure Empty State web app:
Any ideas what I am missing?
Upvotes: 1
Views: 796
Reputation: 5502
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:
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!
Upvotes: 2