First thing is to enable logging on your app service; see https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs to enable those logs. This will give you a better idea of what the runtime exception is. .NET Core bootstrapped project will have the following snippet in the ConfigureServices
method in the Startup
class.
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
Adding ASPNETCORE_ENVIRONMENT set to Development will show the developer style exception page rather than this one. However, it's not advised to leave this setting permanently as it can display sensitive information. With regards to your Swagger, make sure you've added UseSwaggerUI()
middleware to your ConfigureServices method as well. Feel free to look at my Startup.cs for reference.