Skip to Content
Azure Serverless Computing Cookbook - Second Edition
book

Azure Serverless Computing Cookbook - Second Edition

by Praveen Kumar Sreeram, Jason Marston
November 2018
Intermediate to advanced
424 pages
10h 55m
English
Packt Publishing
Content preview from Azure Serverless Computing Cookbook - Second Edition

How to do it...

Perform the following steps:

  1. Create a new HTTP trigger, named LoadTestHttpTrigger, with the Authorization Level set to Anonymous.
  2. Replace the default code in run.csx with the following:
using System.Net;using Microsoft.AspNetCore.Mvc;public static async Task<IActionResult> Run(HttpRequest req, ILogger log){ System.Threading.Thread.Sleep(2000); return (ActionResult)new OkObjectResult($"Hello");}
  1. The preceding code is self-explanatory. 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 on the right-hand side of the run.csx code editor.
  1. Navigate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Azure Serverless Computing Cookbook

Azure Serverless Computing Cookbook

Praveen Kumar Sreeram
Azure Serverless Computing Cookbook - Third Edition

Azure Serverless Computing Cookbook - Third Edition

Praveen Kumar Sreeram, Kasam Shaikh, Greg Leonardo
Mastering Azure Serverless Computing

Mastering Azure Serverless Computing

Lorenzo Barbieri, Massimo Bonanni

Publisher Resources

ISBN: 9781789615265Supplemental Content