AZ-204 Practice Question: Connect to and consume Azure services and third-party services
Exhibit
Refer to the exhibit.
```json
{
"parameters": {
"eventHubConnectionString": {
"type": "securestring"
},
"storageAccountName": {
"type": "string"
}
},
"functions": [
{
"name": "EventProcessor",
"type": "EventHubTrigger",
"direction": "in",
"eventHubName": "telemetry",
"connection": "EventHubConnectionString",
"cardinality": "many",
"consumerGroup": "$Default"
}
]
}
```Refer to the exhibit. An Azure Function is configured with an Event Hub trigger to process telemetry data. The function uses the EventProcessorHost to read events. The developer notices that the function is not processing all events; some events are skipped. What is the most likely cause?
⚠ Common exam trap
Many exam-takers assume 'many' cardinality improves throughput without realizing it introduces batch processing complexities that can lead to skipped events if checkpointing is not handled correctly.
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
✓
The cardinality is set to 'many' causing batch processing issues
Setting the cardinality to 'many' in an Event Hub-triggered Azure Function causes the function to process events in batches. If the batch size is not properly configured or if the function fails to checkpoint after processing a batch, some events may be skipped when the host rebalances or restarts. The EventProcessorHost relies on checkpointing to track progress, and batch processing without proper checkpoint handling can lead to event loss.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The event hub name is misspelled
Why it's wrong here
A misspelled Event Hub name would prevent the Azure Function trigger from correctly binding to the specified Event Hub resource. This would typically result in a runtime error indicating that the Event Hub could not be found or connected to, causing the function to fail to start or receive any events. However, the problem description implies the function is running and experiencing processing issues, not a fundamental connection failure due to a naming error, suggesting the name itself is correct.
- ✓
The cardinality is set to 'many' causing batch processing issues
Why this is correct
When an Event Hub trigger's 'cardinality' is set to 'many', the Azure Function expects to receive a batch of events, typically as 'EventData[]' or 'List<EventData>'. If the function's code is designed to process individual events (i.e., expecting a single 'EventData' parameter) or if the batch processing logic is inefficient, it can lead to significant issues. Large batches might cause the function to exceed its execution timeout, or checkpointing might not occur correctly, resulting in events being reprocessed or, worse, skipped entirely if the lease is lost before successful processing.
- ✗
The consumer group is set to $Default
Why it's wrong here
The '$Default' consumer group is a standard and perfectly valid consumer group provided by Azure Event Hubs. It allows applications to begin reading events from the Event Hub without requiring explicit configuration of a custom group. While using a dedicated consumer group is often recommended for production scenarios to isolate different consumers and prevent interference, '$Default' itself does not inherently cause processing issues or errors in an Azure Function's operation.
- ✗
The connection string is stored as a securestring parameter
Why it's wrong here
Storing sensitive information like an Event Hub connection string as a 'securestring' parameter, typically within application settings or referenced from Azure Key Vault, is a recommended security best practice. This method encrypts the string at rest and in transit, protecting it from unauthorized access. This secure storage mechanism does not introduce any functional problems or processing issues for the Azure Function; rather, it enhances the overall security posture of the application.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.