Niels Brinch
Niels Brinch

Reputation: 3622

Prevent Azure from shutting down my App Service

I am running a .NET Core web application on an Azure App Service (App Service plan is configured to use S1). It is stable.

However, I recently ran an automated test against production and it caused 100s of errors in a few minutes. After this, the App Service became unavailable for a long time.

I know that App Service basically uses IIS and I know that there is a setting in IIS that will shut down an App Service on too many errors in a short time. I am assuming that this is the setting that came into effect for my app.

My question is: How do I prevent Azure from shutting down my App Service, even if many errors happen in a short time?

Upvotes: 1

Views: 4141

Answers (3)

Niels Brinch
Niels Brinch

Reputation: 3622

I am not sure whether this problem was correctly diagnosed back in 2017 when I was using a .NET Core WebApp. Maybe it was or maybe it wasn't.

However, I have today in late 2019 on Azure Functions V2 and .NET Core 2.2 recreated the same scenario and provoked 5000 unhandled exceptions in one minute and the Function did not go down because of that.

So anyone finding this question can pretty much rest assured, if they are on Azure Functions V2 or newer - it does not crash just because of the quantity of exceptions like it was the case with default settings in IIS in the past.

Upvotes: 0

camelCase
camelCase

Reputation: 1780

Investigate the "Always On" setting that can be changed in the Azure Portal under Application settings, General Settings. This value is configured per App.

The UI control will be disabled if your price tier does not support always on. Typically these lower priced levels in the pricing tiers are not used for a production site.

Upvotes: 6

Fei Han
Fei Han

Reputation: 27793

I recently ran an automated test against production and it caused 100s of errors in a few minutes. After this, the App Service became unavailable for a long time.

Firstly, you can enable diagnostic functionality for App Service web app to log information from both the web server and the web application, which will help you troubleshoot the issue.

Secondly, you can try to increase the number of instances that run your app and check if it can mitigate the issue.

Besides, if possible, you can set up staging environment and do automated test on staging environment instead of production environment, which will not cause your production shutting down for long time when you do automated test on staging.

Upvotes: 0

Related Questions