Microsoft Certified: Azure Developer Associate (AZ-204)Connect to and consume Azure services and third-party servicesMedium

A company uses Azure Logic Apps to automate workflows. One Logic App needs to periodically check an external REST API for new data and, if data is found, process it. The external API has a rate limit of 100 requests per minute and returns a 429 Too Many Requests status code if exceeded. How should the Logic App be configured to handle this rate limit gracefully and ensure data is processed without overwhelming the API?

  1. AUse a 'Recurrence' trigger and configure the API connector with a retry policy set to exponential back-off.
  2. BWrap the API call in a 'Scope' action with a 'Terminate' action on failure.
  3. CAdd a 'Delay' action before each API call to ensure calls are spaced out.
  4. DImplement a 'For each' loop with a fixed delay inside it.
Show answer & explanation

Correct answer: A. Use a 'Recurrence' trigger and configure the API connector with a retry policy set to exponential back-off.

The most robust and efficient way to handle rate limiting in Logic Apps is to use a retry policy with exponential back-off on the API connector. This automatically retries failed requests with increasing delays, preventing overwhelming the API while ensuring eventual success. The recurrence trigger handles the periodic check.

Why the other options are wrong

  • B. A 'Scope' action groups related actions, and 'Terminate' stops the workflow on failure, neither of which directly addresses graceful rate limit handling or retries.
  • C. Adding a fixed 'Delay' action might work for simple cases but is less flexible and robust than an exponential back-off retry policy, which dynamically adapts to the API's availability.
  • D. A 'For each' loop is for iterating over collections, not for periodic checks, and a fixed delay might not be dynamic enough for varying rate limits.

Azure Logic Apps Retry Policies

A configuration setting for actions in Azure Logic Apps that specifies how to handle transient failures, such as network glitches or API rate limits, by automatically retrying the action.

  • Common policies include Default, None, Exponential interval, and Fixed interval.
  • Exponential interval is ideal for handling rate limits (429 errors) and transient network issues.
  • Configured on individual actions, often within the connector properties.

Memory trick: Logic Apps are 'smart workers' that know how to politely wait for APIs.

More Connect to and consume Azure services and third-party services questions