How to do it...

  1. Create a new HTTP trigger named LoadTestHttpTrigger with Authorization Level set to Anonymous.
  2. Replace the default code with the following in run.csx:
        using System.Net;        public static async Task<HttpResponseMessage>         Run(HttpRequestMessage req, TraceWriter log)        {          System.Threading.Thread.Sleep(2000);          return req.CreateResponse(HttpStatusCode.OK, "Hello ");        }
  1. The preceding code is self-explainable. In order to make the load test interesting, let's simulate some processing load by adding a wait time of two seconds using System.Threading.Thread.Sleep(2000);.
  2. Copy the function URL by clicking on the </> Get function URL link available on the right-hand side of the run.csx code editor, as shown in the following screenshot:

Get Azure Serverless Computing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.