Explain it simpler
A trigger is what starts a function. Different triggers fit different jobs. An HTTP trigger turns your function into a web address that runs when called, and you can require a key to call it. A timer trigger runs on a schedule written in a six-part code where the first part is seconds. A Service Bus trigger runs for each business message in a queue. A Cosmos DB trigger runs when documents in a database change. A Blob trigger runs when a file is added, and an Event Grid trigger runs when Azure announces that something happened. Picking a trigger is like choosing what wakes you up: an alarm clock, a phone call or a knock at the door.
Theo on the night shift at Granite Peak Logistics gets paged at 2:03 a.m.: the warehouse database is pegged at full CPU. The culprit is the nightly cleanup function, which was supposed to run once at 2:00. The logs show it has started 60 times in the last minute. Down the hall, a separate complaint waits in the queue: the document-intake function takes several minutes to notice new uploads. Both problems trace back to how a trigger was configured. What did the schedule actually say, and why is the blob trigger so slow?
Triggers decide when your code runs, and each one has a few settings the exam expects you to know cold. This lesson walks through the six most common triggers, the detail that matters most for each, and how to choose between them.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 8 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.