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.
However, when I navigate to the deployment url, I get this screen instead of my app.
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?}");
});
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
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.