1

I have ASP.NET Core Web API deployed as App Service on Azure. App Service is set up to require Client Certificate. Also AlwaysOn for App Service is set to True.

Issue is that first request with small payload sent to Web API takes approximately 2-3 seconds, and with large payload timed out. But after first small successful request, next one with large payload executes in less than a second. After some period of inactivity the issue occurs again, and first request to Web API again either takes time or timed out.

When Require Incoming Certificate is disabled, no issues with first request execution time, it executes quite fast always.

  • Today I noticed the same issue in an ASE v2. Did you find a solution for this? In my case, I noticed the error on file upload api calls. File uploads > 100kb time out. But when first uploading a small file, I can upload a large file after this immediately. Also using AlwaysOn/Require Client Cert. With client certificate mode set to "ignore" I can always upload large files without getting a timeout. – martinoss Mar 15 '23 at 16:18

1 Answers1

0

Web apps are unloaded if they are idle for a set period of time.

Quoted from official docs:

The downside is that the response to the first request after the web app is unloaded is longer, to allow the web app to load and start serving responses.

If you're using a Basic and Standard service plan, you can turn on the Always On setting to keep the app always loaded:

  1. In the Azure portal, go to your web app.
  2. Select Application settings.
  3. For Always On, select On.
itminus
  • 23,772
  • 2
  • 53
  • 88