AZ-204 Event Grid Trigger Practice Question
You are developing a web application that allows users to upload profile pictures to Azure Blob Storage. The application generates thumbnails using an Azure Function that is triggered by blob creation. You need to ensure that the function only processes image files and ignores other file types. What should you do?
⚠ Common exam trap
Candidates often mistakenly believe that blob trigger path patterns can filter by file extension (Option D), but in reality, the trigger fires for any blob in the container regardless of the pattern. The correct approaches are either using Event Grid trigger with content-type filtering or checking the content type inside the function.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Set the trigger's 'source' parameter to 'EventGrid' and filter events by the 'content-type' property.
Both options A and C are valid methods to ensure the Azure Function only processes image files. Option A uses an Event Grid trigger with filtering on the 'content-type' property, which allows the function to only run for blobs with image content types. Option C checks the content type inside the function and ignores non-image blobs, which also works but runs the function for all blobs. Option B is incorrect because blob triggers do not have a 'filter' property for extensions. Option D is incorrect because the blob trigger's path pattern does not filter by extension; the function triggers for any blob in the container regardless of the file extension.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Set the trigger's 'source' parameter to 'EventGrid' and filter events by the 'content-type' property.
Why this is correct
Correct. By setting the trigger source to EventGrid and filtering events by the 'content-type' property (e.g., 'image/jpeg', 'image/png'), the function only triggers for image blobs, avoiding unnecessary invocations for other file types.
- ✗
Set the trigger's 'filter' property to '*.jpg,*.png'.
Why it's wrong here
Incorrect. Azure Blob Storage triggers do not support a 'filter' property like '*.jpg,*.png'. This is not a valid configuration option.
- ✓
Implement the function without filtering and check the content type inside the function, ignoring non-image blobs.
Why this is correct
Correct. While this approach invokes the function for every blob, checking the content type inside the function and ignoring non-image blobs is a straightforward and valid method to only process images.
- ✗
Use the blob trigger with a path pattern like 'images/{name}.jpg' and 'images/{name}.png' and use the extension binding to filter.
Why it's wrong here
Incorrect. The blob trigger's path pattern (e.g., 'images/{name}.jpg') is used to bind the blob name, but it does not filter the trigger. The function will fire for any blob created in the container, regardless of the extension.
Quick reference
Azure Blob Storage Tier Comparison
| Tier | Storage Cost | Retrieval Cost | Latency | Use Case |
|---|---|---|---|---|
| Hot | Highest | Lowest | Immediate | Active data, frequent reads |
| Cool | Lower | Higher | Immediate | Data accessed < once / month |
| Cold | Lower still | Higher | Immediate | Data accessed < once / quarter |
| Archive | Lowest | Highest + rehydration delay | Hours | Long-term compliance retention |
Go deeper
Related to this question
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.