Courseiva

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

An application uses Azure Functions with a Durable Functions extension to orchestrate a workflow. The workflow calls multiple external APIs. The developer needs to handle transient failures when calling these APIs. Which pattern should the developer implement?

⚠ Common exam trap

Candidates often confuse the circuit breaker pattern with retry logic, but circuit breakers are for preventing cascading failures in long-term outages, not for handling transient failures with exponential backoff.

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

Implement retry logic with exponential backoff

Durable Functions provides built-in support for automatic retry with exponential backoff via the `CallActivityWithRetryAsync` method or by configuring retry policies in orchestrator functions. This pattern is specifically designed to handle transient failures when calling external APIs, as it automatically retries failed operations with increasing delays, reducing load on the downstream service and improving resilience.

Answer analysis

Option-by-option breakdown

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

  • Implement retry logic with exponential backoff

    Why this is correct

    Durable Functions orchestrations are inherently stateful and resilient, making them ideal for implementing robust retry logic. Exponential backoff is a crucial strategy for handling transient failures, where retries are attempted with progressively longer delays between attempts. This prevents overwhelming the failing service and allows it time to recover, significantly improving the reliability of long-running operations within a durable orchestration. It's a best practice for distributed systems to manage intermittent issues effectively.

  • Use a saga pattern

    Why it's wrong here

    The Saga pattern is a design pattern used to manage distributed transactions that span multiple services, ensuring data consistency across independent components. It achieves this by orchestrating a sequence of local transactions, each with a corresponding compensating transaction to undo previous changes in case of failure. While it handles failures by rolling back, its primary purpose is transactional integrity across services, not to re-attempt a failed operation due to transient issues.

  • Use a request-reply pattern

    Why it's wrong here

    The request-reply pattern is a fundamental messaging interaction where a sender sends a message and then waits for a response from the receiver. It defines a communication style, ensuring that a client receives an acknowledgment or result for its request. While essential for many synchronous or asynchronous interactions, this pattern itself does not inherently provide mechanisms for automatically retrying failed requests or handling transient errors; it merely describes the exchange of messages.

  • Use a circuit breaker pattern

    Why it's wrong here

    The Circuit Breaker pattern is designed to prevent an application from repeatedly trying to invoke a service that is likely to fail, thereby conserving resources and allowing the service time to recover. When a service experiences a certain number of failures, the circuit "trips," and subsequent calls are immediately rejected without attempting to contact the failing service. While it helps manage cascading failures, its purpose is to stop calls to a failing service, not to retry them with increasing delays.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

Go deeper

Related to this question

About these practice questions

One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.