Skip to content

Commit c6804ad

Browse files
authored
Move up Retry policies
1 parent e3579c7 commit c6804ad

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

articles/azure-functions/functions-bindings-error-pages.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Handling errors in Azure Functions is important to help you avoid lost data, avo
1414
This article describes general strategies for error handling and the available retry strategies.
1515

1616
> [!IMPORTANT]
17-
> Preview retry policy support for certain triggers was removed in December 2022. Retry policies for supported triggers is now generally available (GA). For a list of extensions that currently support retry policies, see the [Retries](#retries) section.
17+
> Preview retry policy support for certain triggers was removed in December 2022. Retry policies for supported triggers are now generally available (GA). For a list of extensions that currently support retry policies, see the [Retries](#retries) section.
1818
1919
## Handling errors
2020

@@ -25,7 +25,7 @@ Errors that occur in an Azure function can come from:
2525
- Calls to REST endpoints.
2626
- Calls to client libraries, packages, or third-party APIs.
2727

28-
To avoid loss of data or missed messages, it's important to practice good error handling. This section describes some recommended error-handling practices and provides links to more information.
28+
To avoid loss of data or missed messages, it's important to practice good error handling. This table describes some recommended error-handling practices and provides links to more information.
2929

3030
| Recommendation | Details |
3131
| ---- | ---- |
@@ -56,7 +56,7 @@ The following table indicates which triggers support retries and where the retry
5656

5757
<sup>*</sup>Requires version 5.x of the Azure Service Bus extension. In older extension versions, retry behaviors are implemented by the [Service Bus dead letter queue](../service-bus-messaging/service-bus-dead-letter-queues.md#maximum-delivery-count).
5858

59-
### Retry policies
59+
## Retry policies
6060

6161
Azure Functions lets you define retry policies for specific trigger types, which are enforced by the runtime. These trigger types currently support retry policies:
6262

@@ -81,37 +81,37 @@ A retry policy is evaluated when a function executed by a supported trigger type
8181
>
8282
> The version 5.x of the Event Hubs extension supports additional retry capabilities for interactions between the Functions host and the event hub. For more information, see `clientRetryOptions` in the [Event Hubs host.json reference](functions-bindings-event-hubs.md#host-json).
8383
84-
#### Retry strategies
84+
### Retry strategies
8585

8686
You can configure two retry strategies that are supported by policy:
8787

88-
##### [Fixed delay](#tab/fixed-delay)
88+
#### [Fixed delay](#tab/fixed-delay)
8989

9090
A specified amount of time is allowed to elapse between each retry.
9191

92-
##### [Exponential backoff](#tab/exponential-backoff)
92+
#### [Exponential backoff](#tab/exponential-backoff)
9393

9494
The first retry waits for the minimum delay. On subsequent retries, time is added exponentially to the initial duration for each retry, until the maximum delay is reached. Exponential back-off adds some small randomization to delays to stagger retries in high-throughput scenarios.
9595

9696
---
9797

9898
When running in a Consumption plan, you are only billed for time your function code is executing. You aren't billed for the wait time between executions in either of these retry strategies.
9999

100-
#### Max retry counts
100+
### Max retry counts
101101

102102
You can configure the maximum number of times that a function execution is retried before eventual failure. The current retry count is stored in memory of the instance.
103103

104104
It's possible for an instance to have a failure between retry attempts. When an instance fails during a retry policy, the retry count is lost. When there are instance failures, the Event Hubs trigger is able to resume processing and retry the batch on a new instance, with the retry count reset to zero. The timer trigger doesn't resume on a new instance.
105105

106106
This behavior means that the maximum retry count is a best effort. In some rare cases, an execution could be retried more than the requested maximum number of times. For Timer triggers, the retries can be less than the maximum number requested.
107107

108-
#### Retry examples
108+
### Retry examples
109109
::: zone pivot="programming-language-python,programming-language-csharp"
110110
Examples are provided for both fixed delay and exponential backoff strategies. To see examples for a specific strategy, you must first select that strategy in the previous tab.
111111
::: zone-end
112112
::: zone pivot="programming-language-csharp"
113113

114-
##### [Isolated worker model](#tab/isolated-process/fixed-delay)
114+
#### [Isolated worker model](#tab/isolated-process/fixed-delay)
115115

116116
Function-level retries are supported with the following NuGet packages:
117117

@@ -127,7 +127,7 @@ Function-level retries are supported with the following NuGet packages:
127127
|MaxRetryCount|Required. The maximum number of retries allowed per function execution. `-1` means to retry indefinitely.|
128128
|DelayInterval|The delay used between retries. Specify it as a string with the format `HH:mm:ss`.|
129129

130-
##### [In-process model](#tab/in-process/fixed-delay)
130+
#### [In-process model](#tab/in-process/fixed-delay)
131131

132132
Retries require NuGet package [Microsoft.Azure.WebJobs](https://www.nuget.org/packages/Microsoft.Azure.WebJobs) >= 3.0.23
133133

@@ -145,7 +145,7 @@ public static async Task Run([EventHubTrigger("myHub", Connection = "EventHubCon
145145
|MaxRetryCount|Required. The maximum number of retries allowed per function execution. `-1` means to retry indefinitely.|
146146
|DelayInterval|The delay used between retries. Specify it as a string with the format `HH:mm:ss`.|
147147

148-
##### [Isolated worker model](#tab/isolated-process/exponential-backoff)
148+
#### [Isolated worker model](#tab/isolated-process/exponential-backoff)
149149

150150
Function-level retries are supported with the following NuGet packages:
151151

@@ -156,7 +156,7 @@ Function-level retries are supported with the following NuGet packages:
156156

157157
:::code language="csharp" source="~/azure-functions-dotnet-worker/samples/Extensions/CosmosDB/CosmosDBFunction.cs" id="docsnippet_exponential_backoff_retry_example" :::
158158

159-
##### [In-process model](#tab/in-process/exponential-backoff)
159+
#### [In-process model](#tab/in-process/exponential-backoff)
160160

161161
Retries require NuGet package [Microsoft.Azure.WebJobs](https://www.nuget.org/packages/Microsoft.Azure.WebJobs) >= 3.0.23
162162

@@ -181,11 +181,11 @@ public static async Task Run([EventHubTrigger("myHub", Connection = "EventHubCon
181181

182182
Here's an example of a retry policy defined in the *function.json* file:
183183

184-
##### [Fixed delay](#tab/fixed-delay)
184+
#### [Fixed delay](#tab/fixed-delay)
185185

186186
[!INCLUDE [functions-retry-fixed-delay-json](../../includes/functions-retry-fixed-delay-json.md)]
187187

188-
##### [Exponential backoff](#tab/exponential-backoff)
188+
#### [Exponential backoff](#tab/exponential-backoff)
189189

190190
[!INCLUDE [functions-retry-exponential-backoff-json](../../includes/functions-retry-exponential-backoff-json.md)]
191191

@@ -199,13 +199,13 @@ You can set these properties on retry policy definitions:
199199
::: zone pivot="programming-language-javascript"
200200
The way you define the retry policy for the trigger depends on your Node.js version.
201201

202-
##### [Node.js v4](#tab/node-v4)
202+
#### [Node.js v4](#tab/node-v4)
203203

204204
Here's an example of a Timer trigger function that uses a fixed delay retry strategy:
205205

206206
:::code language="javascript" source="~/azure-functions-nodejs-v4/js/src/functions/timerTriggerWithRetry.js" :::
207207

208-
##### [Node.js v3](#tab/node-v3)
208+
#### [Node.js v3](#tab/node-v3)
209209

210210
Here's an example of a fixed delay retry policy defined in the *function.json* file:
211211

@@ -217,13 +217,13 @@ Here's an example of a fixed delay retry policy defined in the *function.json* f
217217
::: zone pivot="programming-language-typescript"
218218
The way you define the retry policy for the trigger depends on your Node.js version.
219219

220-
##### [Node.js v4](#tab/node-v4)
220+
#### [Node.js v4](#tab/node-v4)
221221

222222
Here's an example of a Timer trigger function that uses a fixed delay retry strategy:
223223

224224
:::code language="typescript" source="~/azure-functions-nodejs-v4/ts/src/functions/timerTriggerWithRetry.ts" :::
225225

226-
##### [Node.js v3](#tab/node-v3)
226+
#### [Node.js v3](#tab/node-v3)
227227

228228
Here's an example of a fixed delay retry policy defined in the *function.json* file:
229229

@@ -239,19 +239,19 @@ You can set these properties on retry policy definitions:
239239

240240
::: zone-end
241241
::: zone pivot="programming-language-python"
242-
##### [Python v2 model](#tab/python-v2/fixed-delay)
242+
#### [Python v2 model](#tab/python-v2/fixed-delay)
243243

244244
Here's an example of a Timer trigger function that uses a fixed delay retry strategy:
245245

246246
:::code language="python" source="~/azure-functions-python-worker/tests/endtoend/retry_policy_functions/fixed_strategy/function_app.py" :::
247247

248-
##### [Python v2 model](#tab/python-v2/exponential-backoff)
248+
#### [Python v2 model](#tab/python-v2/exponential-backoff)
249249

250250
Here's an example of a Timer trigger function that uses an exponential backoff retry strategy:
251251

252252
:::code language="python" source="~/azure-functions-python-worker/tests/endtoend/retry_policy_functions/exponential_strategy/function_app.py" :::
253253

254-
##### [Python v1 model](#tab/python-v1/fixed-delay)
254+
#### [Python v1 model](#tab/python-v1/fixed-delay)
255255

256256
The retry policy is defined in the function.json file:
257257

@@ -274,7 +274,7 @@ def main(mytimer: azure.functions.TimerRequest, context: azure.functions.Context
274274

275275
```
276276

277-
##### [Python v1 model](#tab/python-v1/exponential-backoff)
277+
#### [Python v1 model](#tab/python-v1/exponential-backoff)
278278

279279
Here's an example of an exponential backoff retry policy defined in the *function.json* file:
280280

@@ -284,7 +284,7 @@ Here's an example of an exponential backoff retry policy defined in the *functio
284284

285285
You can set these properties on retry policy definitions:
286286

287-
##### [Python v2 model](#tab/python-v2)
287+
#### [Python v2 model](#tab/python-v2)
288288

289289
|Property | Description |
290290
|---------|-------------|
@@ -294,7 +294,7 @@ You can set these properties on retry policy definitions:
294294
|minimum_interval|The minimum retry delay when you're using an `exponential_backoff` strategy. Specify it as a string with the format `HH:mm:ss`.|
295295
|maximum_interval|The maximum retry delay when you're using `exponential_backoff` strategy. Specify it as a string with the format `HH:mm:ss`.|
296296

297-
##### [Python v1 model](#tab/python-v1)
297+
#### [Python v1 model](#tab/python-v1)
298298

299299
[!INCLUDE [functions-retry-function-json-definitions](../../includes/functions-retry-function-json-definitions.md)]
300300

@@ -303,7 +303,7 @@ You can set these properties on retry policy definitions:
303303
::: zone-end
304304
::: zone pivot="programming-language-java"
305305

306-
##### [Fixed delay](#tab/fixed-delay)
306+
#### [Fixed delay](#tab/fixed-delay)
307307

308308
```java
309309
@FunctionName("TimerTriggerJava1")
@@ -316,7 +316,7 @@ public void run(
316316
}
317317
```
318318

319-
##### [Exponential backoff](#tab/exponential-backoff)
319+
#### [Exponential backoff](#tab/exponential-backoff)
320320

321321
```java
322322
@FunctionName("TimerTriggerJava1")

0 commit comments

Comments
 (0)