3
votes

I've just upgraded an ASP.NET Core 1.1 web application to 2.0 and tested without issue locally. However, when the site is deployed to Azure a POST request that worked locally results in a 404 (I guess this could be the same for all POST requests, but I'm unable to log-in due to the issue).

Any ideas why this might fail to be working when deployed to Azure but working perfectly when run through IIS Express locally?

I deleted the original deployment slot on Azure and re-created as initially deploying over the slot mixed old 1.1 DLL's with the newer 2.0 DLL's and prevented the site working at all.

1
Have tried activating logging? Maybe you can get some clues there?Alex Albu
@AlexAlbu thanks, that's where I found the real issue. Just need to work out why I was receiving a 4040 instead of an error response code!Gavin

1 Answers

3
votes

Seems I was caught out by poor handling of errors by my web application. I'd assumed that app.UseExceptionHandler("/Error") (I default my HomeController to not require the leading "Home" for /Home/Error) in Startup.cs would redirect to an error page, but for me it is not.

My underlying issue was a database connection error that caused the POST controller method to fail. I was caught out by the response returning a 404 rather than an error status.

I will need to investigate how error handling works in more detail for ASP.NET Core it seems.