What is the role of a trigger in an Azure Function?
Short answer: A trigger defines how and when a function is invoked.
Explain a bit more
Examples: HTTP requests, queue messages, blob changes, timer events. Every function must have exactly one trigger. Example (HTTP trigger): [FunctionName("HttpTriggerFunction")] public static IActionResult Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req, ILogger log) { log.LogInformation("HTTP trigger executed."); return new OkObjectResult("Hello from Azure Function!");
Real-world example (ShopNest)
Order-paid events go to Service Bus; an Azure Function sends the confirmation email asynchronously.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png