Skip to content

Clarify Retry Behavior in Azure Function Apps (Service Bus) #1662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
trin94 opened this issue Apr 3, 2025 · 3 comments
Closed

Clarify Retry Behavior in Azure Function Apps (Service Bus) #1662

trin94 opened this issue Apr 3, 2025 · 3 comments
Assignees

Comments

@trin94
Copy link

trin94 commented Apr 3, 2025

Is your question related to a specific version? If so, please specify:

Extension Bundle:

"extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
},

Python Programming Model:

"version": "2.0"

What binding does your question apply to, if any? (e.g. Blob Trigger, Event Hub Binding, etc)

@app.service_bus_queue_trigger(...)
# and 
@app.retry(...)

Question

I've configured retries using the following code:

function_app.py:

@app.function_name(name="...")
@app.service_bus_queue_trigger(...)
@app.retry(
    strategy="exponential_backoff",
    max_retry_count="3",
    minimum_interval="00:00:08",
    maximum_interval="00:00:60",
)
def process_something(...):
    pass

host.json:

"extensions": {
    "serviceBus": {
        "clientRetryOptions": {
            "mode": "exponential",
            "tryTimeout": "00:01:00",
            "delay": "00:00:00.80",
            "maxDelay": "00:01:00",
            "maxRetries": 3
        }
    }
}

When I start the function app (locally or in the cloud) I get the following warning:

Soon retries will not be supported for function 'Functions.process_something'. For more information, please visit http://aka.ms/func-retry-policies.

When I follow the link, I don't find any information regarding a deprecation or a migration path to an alternative solution.

Now my questions:

  • Is the warning correct and retries using the decorator will stop working?
  • If so, how should we implement retries?

More feedback:
For us developers it's much easier if (updated) documentation is located next to the code. As an example: to understand what the @app.retry parameter actually does, I have to follow the link and hope that

  • the link is working
  • the link is up-2-date
  • the documentation applies to the language I am using

Please let me know if you need any further information 👍

Best
Elias

@JAdluri JAdluri self-assigned this Apr 9, 2025
@JAdluri
Copy link

JAdluri commented Apr 9, 2025

Hello @trin94 . thankyou for reporting .

For ServiceBus triggered function, you will have to use built-in delivery count/dead letter queue for retries which implemented in ServiceBus extension.
Please note that, if you don’t remove the retry attributes, the functions retries will stop working but the trigger itself will continue to work.

@trin94
Copy link
Author

trin94 commented Apr 10, 2025

Hi @JAdluri,

Thanks for the clarification! That makes a lot of sense. As you guys work on aligning the functionality of these Python bindings with the C# ones, I believe this will provide a clean approach to error handling.

I have a couple of requests:

  • Please maintain the current retry functionality (the one using the decorator) until you guys implement manual message dead lettering or abandonment 😅
  • It would be great if you could update the documentation to include how to implement fixed_delay and/or exponential_backoff strategies with dead letter messages in Python using this new approach 👍

Thanks again for your help! For me everything is clear now, so the issue can be closed 😄

Best,
Elias

@JAdluri
Copy link

JAdluri commented Apr 10, 2025

As of now I couldnt guarantee on updating the document or implementing the approach you mentioned. But i believe I was able to address your query

@JAdluri JAdluri closed this as completed Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants