Question 14 of 997

Quick Answer

The correct answer is to configure Advanced Filters on the Event Grid subscription with a 'subjectEndsWith' condition set to '.jpg' or '.jpeg'. This works because Event Grid’s advanced filtering operates at the service level, evaluating the event’s subject field—which contains the blob file name—before delivery, so only matching JPEG creation events ever reach your Azure Function, eliminating unnecessary invocations and reducing both cost and latency. On the AZ-204 exam, this scenario tests your understanding of Event Grid’s filtering capabilities versus handling events inside the function code; a common trap is choosing to filter within the function, which still incurs invocation costs and adds processing overhead. Remember, for high-volume blob storage events, always push filtering upstream to Event Grid’s advanced filters rather than downstream to your code. Memory tip: “EndsWith” is your friend for file-type filtering—think of it as the gatekeeper that keeps non-JPEG blobs from knocking on your function’s door.

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

This AZ-204 practice question tests your understanding of connect to and consume azure services and third-party services. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You are using Azure Event Grid to respond to blob storage events (blob created). You need to ensure that only JPEG image files trigger a function for processing, while other files are ignored. The number of files is high, and you want to minimize cost and latency. How should you filter events?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "minimum / minimize"

    Why it matters: Asks for the least resource use — fewest addresses, smallest subnet, lowest overhead. Eliminate over-provisioned options even if they would technically work.

Question 1mediummultiple choice
Full question →

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

Configure Advanced Filters on the Event Grid subscription with a 'subjectEndsWith' condition set to '.jpg' or '.jpeg'.

Option B is correct because Azure Event Grid supports advanced filtering on event properties, including 'subjectEndsWith', which allows you to filter events at the service level before they are delivered to the endpoint. This ensures that only blob creation events for files ending with '.jpg' or '.jpeg' trigger the function, reducing unnecessary invocations, cost, and latency. By filtering at the Event Grid level, you avoid processing unwanted events entirely, which is more efficient than filtering within the function code.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create the function to check the blob extension at the start of the function code and return early if it's not a JPEG.

    Why it's wrong here

    This approach still triggers the function for every blob creation, incurring execution costs and latency. It is better to filter at the Event Grid level to avoid invoking the function unnecessarily.

  • Configure Advanced Filters on the Event Grid subscription with a 'subjectEndsWith' condition set to '.jpg' or '.jpeg'.

    Why this is correct

    Advanced filters allow you to specify conditions on event properties. By using 'subjectEndsWith' for both .jpg and .jpeg, Event Grid will only deliver events that match, preventing unnecessary function invocations.

    Clue confirmation

    The clue word "minimum / minimize" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create separate event subscriptions for each file extension and point them to different functions.

    Why it's wrong here

    This adds management overhead. A single subscription with advanced filters is simpler and more efficient.

  • Use Event Hubs capture to filter files before sending events.

    Why it's wrong here

    Event Hubs is for streaming data, not for filtering events. The capture feature archives events but does not filter them before delivery.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often default to filtering inside the function code (Option A) because it seems simpler, but they overlook that Event Grid's advanced filtering can prevent the function from being triggered at all, which is the key to minimizing cost and latency in high-volume scenarios.

Detailed technical explanation

How to think about this question

Event Grid's advanced filtering uses the CloudEvents 1.0 specification and supports operators like 'subjectEndsWith', 'subjectBeginsWith', and numeric/boolean comparisons on event data. Under the hood, Event Grid evaluates filters before dispatching events to the endpoint, meaning no HTTP request is made to the function for filtered-out events, which directly reduces compute costs and network latency. In high-volume scenarios, such as processing millions of image uploads daily, this server-side filtering can significantly lower Azure Functions consumption plan costs by avoiding cold starts and execution time for irrelevant events.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A startup's cloud architect reviews their monthly bill and notices costs are higher than expected for a long-running batch job. Switching from on-demand instances to Reserved Instances — or using Spot/Preemptible VMs — can reduce compute costs by up to 72 %. Questions like this test whether you understand the tradeoffs between commitment, flexibility, and cost across cloud pricing models.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related AZ-204 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free AZ-204 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this AZ-204 question test?

Connect to and consume Azure services and third-party services — This question tests Connect to and consume Azure services and third-party services — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Configure Advanced Filters on the Event Grid subscription with a 'subjectEndsWith' condition set to '.jpg' or '.jpeg'. — Option B is correct because Azure Event Grid supports advanced filtering on event properties, including 'subjectEndsWith', which allows you to filter events at the service level before they are delivered to the endpoint. This ensures that only blob creation events for files ending with '.jpg' or '.jpeg' trigger the function, reducing unnecessary invocations, cost, and latency. By filtering at the Event Grid level, you avoid processing unwanted events entirely, which is more efficient than filtering within the function code.

What should I do if I get this AZ-204 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "minimum / minimize". Asks for the least resource use — fewest addresses, smallest subnet, lowest overhead. Eliminate over-provisioned options even if they would technically work.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More AZ-204 practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.