Microsoft
AZ-204 · Question #348
A company is implementing a publish-subscribe (Pub/Sub) messaging component by using Azure Service Bus. You are developing the first subscription application. In the Azure portal you see that messages
Sign in or unlock AZ-204 to reveal the answer and full explanation for question #348. The question stem and answer options stay visible for context.
Submitted by carter_n· Mar 30, 2026Connect to and consume Azure services and third-party services
Question
A company is implementing a publish-subscribe (Pub/Sub) messaging component by using Azure Service Bus. You are developing the first subscription application. In the Azure portal you see that messages are being sent to the subscription for each topic. You create and initialize a subscription client object by supplying the correct details, but the subscription application is still not consuming the messages. You need to ensure that the subscription client processes all messages. Which code segment should you use?
Options
- Aawait subscriptionClient.AddRuleAsync(new RuleDescription(RuleDescription.DefaultRuleName,
- BsubscriptionClient = new SubscriptionClient(ServiceBusConnectionString, TopicName,
- Cawait subscriptionClient.CloseAsync();
- DsubscriptionClient.RegisterMessageHandler(ProcessMessageAsync, messageHandlerOptions);
Unlock AZ-204 to see the answer
You've previewed enough free AZ-204 questions. Unlock AZ-204 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Service Bus#subscription client#message handler#pub-sub