Mid Azure

How do you create an Azure Function using C#?

  • Visual Studio: File → New Project → Azure Functions → Choose Trigger → .NET

6/7

  • Example: HTTP-triggered function

[FunctionName("HelloFunction")]

public static IActionResult Run(

[HttpTrigger(AuthorizationLevel.Function, "get", "post")]

HttpRequest req,

ILogger log)

log.LogInformation("C# HTTP trigger function processed a

request.");

string name = req.Query["name"];

return new OkObjectResult($"Hello, {name ?? "World"}!");

More from Microsoft Azure Tutorial

All questions for this course