Reputation: 2207
I've got an Azure isolated function like so:
[Function("TransactionEventsIntegration")]
[ExponentialBackoffRetry(maxRetryCount: 3, minimumInterval: "00:00:02", maximumInterval: "00:05:00")]
[ServiceBusOutput("%Transactions:SB:Transactions:ProcessorUpdateQueue%", Connection = "Transactions:SB:Transactions")]
public async Task<ServiceBusMessage> Process(
[ServiceBusTrigger(
"%Transactions:SB:Transactions:ReceiveTopic%",
"%Transactions:SB:Transactions:TransactionEventsTopicSubscription%",
Connection = "Transactions:SB:Transactions")]
ServiceBusReceivedMessage message,
ServiceBusMessageActions messageActions,
Microsoft.Azure.WebJobs.ExecutionContext executionContext)
{
// code
}
This returns the following error:
Invalid use of a retry attribute. Check that the attribute is used on a trigger that supports function-level retry. (https://aka.ms/azfw-rules?ruleid=AZFW0012)
Upvotes: 0
Views: 29
Reputation: 1775
The Service Bus trigger in function app does not support function level retry
, but you can configure retry in the Binding extension
level for all the functions.
Rule description
This rule is triggered in two scenarios:
A retry strategy is not recognized (only Fixed Delay and Exponential Backoff are supported)
A retry attribute is used on a trigger type that does not support function-level retry.
A list of triggers that support function-level retry can be found here.
Then follow the link in here
text, it takes us to https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=fixed-delay%2Cin-process%2Cnode-v4%2Cpython-v2&pivots=programming-language-csharp#retries
Looking at the row in the table below, Service Bus
does not support function level configuration for retry. It only supports Binding extension
that you can configure in the host.json.
{
"version": "2.0",
"extensions": {
"serviceBus": {
"clientRetryOptions":{
"mode": "exponential",
"tryTimeout": "00:01:00",
"delay": "00:00:00.80",
"maxDelay": "00:01:00",
"maxRetries": 3
},
"prefetchCount": 0,
..........
}
}
}
Upvotes: 1