Skip to content

Commit 2e216f1

Browse files
authored
Merge pull request #290503 from pauljewellmsft/srp-retry
Add retry guidance to management plane dev guide
2 parents 9fdd4ef + f58e6c5 commit 2e216f1

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

articles/storage/blobs/storage-retry-policy.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: pauljewellmsft
66
ms.author: pauljewell
77
ms.service: azure-blob-storage
88
ms.topic: how-to
9-
ms.date: 08/05/2024
9+
ms.date: 11/19/2024
1010
ms.custom: devx-track-dotnet, devguide-csharp
1111
---
1212

@@ -26,10 +26,13 @@ The following table lists the properties of the [RetryOptions](/dotnet/api/azure
2626
| --- | --- | --- | --- |
2727
| [Delay](/dotnet/api/azure.core.retryoptions.delay) | [TimeSpan](/dotnet/api/system.timespan) | The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach. If the service provides a Retry-After response header, the next retry is delayed by the duration specified by the header value. | 0.8 second |
2828
| [MaxDelay](/dotnet/api/azure.core.retryoptions.maxdelay) | [TimeSpan](/dotnet/api/system.timespan) | The maximum permissible delay between retry attempts when the service doesn't provide a Retry-After response header. If the service provides a Retry-After response header, the next retry is delayed by the duration specified by the header value. | 1 minute |
29-
| [MaxRetries](/dotnet/api/azure.core.retryoptions.maxretries) | int | The maximum number of retry attempts before giving up. | 5 |
29+
| [MaxRetries](/dotnet/api/azure.core.retryoptions.maxretries) | int | The maximum number of retry attempts before giving up. | 5 (see note) |
3030
| [Mode](/dotnet/api/azure.core.retryoptions.mode) | [RetryMode](/dotnet/api/azure.core.retrymode) | The approach to use for calculating retry delays. | Exponential |
3131
| [NetworkTimeout](/dotnet/api/azure.core.retryoptions.networktimeout) | [TimeSpan](/dotnet/api/system.timespan) | The timeout applied to an individual network operation. | 100 seconds |
3232

33+
> [!NOTE]
34+
> `StorageClientOptions` increases the default value for `MaxRetries` from 3 to 5. All other properties have the same default values as `RetryOptions`.
35+
3336
In this code example for Blob Storage, we configure the retry options in the `Retry` property of the [BlobClientOptions](/dotnet/api/azure.storage.blobs.blobclientoptions) class. Then, we create a client object for the blob service using the retry options.
3437

3538
:::code language="csharp" source="~/azure-storage-snippets/blobs/howto/dotnet/dotnet-v12/Retry.cs" id="Snippet_RetryOptions":::

articles/storage/common/storage-srp-dotnet-get-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: pauljewellmsft
88
ms.author: pauljewell
99
ms.service: azure-storage
1010
ms.topic: how-to
11-
ms.date: 08/01/2024
11+
ms.date: 11/19/2024
1212
ms.devlang: csharp
1313
ms.custom: template-how-to, devguide-csharp, devx-track-dotnet
1414
---
@@ -128,3 +128,4 @@ The following guide shows you how to manage resources and perform specific actio
128128
| Guide | Description |
129129
| --- | --- |
130130
| [Manage a storage account](storage-srp-manage-account-dotnet.md) | Learn how to create and manage a storage account, manage storage account keys, and configure client options to create a custom retry policy. |
131+

articles/storage/common/storage-srp-manage-account-dotnet.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to manage storage account resources with the Azure Storag
55
services: storage
66
author: pauljewellmsft
77
ms.author: pauljewell
8-
ms.date: 08/01/2024
8+
ms.date: 11/19/2024
99
ms.service: azure-blob-storage
1010
ms.topic: how-to
1111
ms.devlang: csharp
@@ -146,10 +146,26 @@ The following code example shows how to delete a storage account:
146146

147147
You can pass an [ArmClientOptions](/dotnet/api/azure.resourcemanager.armclientoptions) instance when creating an `ArmClient` object. This class allows you to configure values for diagnostics, environment, transport, and retry options for a client object.
148148

149-
The following code example shows how to configure the `ArmClient` object to change the default retry policy:
149+
### Example: Configure retry options
150+
151+
The following code example shows how to configure the `ArmClient` object to use a custom retry policy:
150152

151153
:::code language="csharp" source="~/storage-mgmt-devguide-dotnet/StorageAccountManagement/Program.cs" id="Snippet_CreateArmClient":::
152154

155+
If you don't specify a custom retry policy, the default retry values are used. The following table lists the properties of the [RetryOptions](/dotnet/api/azure.core.retryoptions) class, along with the type, a brief description, and the default value:
156+
157+
| Property | Type | Description | Default value |
158+
| --- | --- | --- | --- |
159+
| [Delay](/dotnet/api/azure.core.retryoptions.delay) | [TimeSpan](/dotnet/api/system.timespan) | The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach. If the service provides a Retry-After response header, the next retry is delayed by the duration specified by the header value. | 0.8 second |
160+
| [MaxDelay](/dotnet/api/azure.core.retryoptions.maxdelay) | [TimeSpan](/dotnet/api/system.timespan) | The maximum permissible delay between retry attempts when the service doesn't provide a Retry-After response header. If the service provides a Retry-After response header, the next retry is delayed by the duration specified by the header value. | 1 minute |
161+
| [MaxRetries](/dotnet/api/azure.core.retryoptions.maxretries) | int | The maximum number of retry attempts before giving up. | 3 |
162+
| [Mode](/dotnet/api/azure.core.retryoptions.mode) | [RetryMode](/dotnet/api/azure.core.retrymode) | The approach to use for calculating retry delays. | Exponential |
163+
| [NetworkTimeout](/dotnet/api/azure.core.retryoptions.networktimeout) | [TimeSpan](/dotnet/api/system.timespan) | The timeout applied to an individual network operation. | 100 seconds |
164+
165+
As you configure retry options for an `ArmClient` object, it's important to note that the [scale targets](scalability-targets-resource-provider.md) are different between the Storage resource provider (management plane) and the data plane. Be sure to configure retry options with these limits in mind.
166+
167+
If you exceed the rate limit for Azure Storage management plane APIs, you receive an HTTP status code `429 Too Many Requests`, which indicates that the request is being throttled. The response includes a `Retry-After` value, which specifies the number of seconds your application should wait (or sleep) before sending the next request. If you send a request before the retry value elapses, your request isn't processed and a new `Retry-After` value is returned.
168+
153169
## Resources
154170

155171
To learn more about resource management using the Azure management library for .NET, see the following resources.

articles/storage/common/storage-srp-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: pauljewell
88

99
ms.service: azure-storage
1010
ms.topic: overview
11-
ms.date: 08/01/2024
11+
ms.date: 11/19/2024
1212
ms.custom: devguide-csharp, devguide-java, devguide-javascript, devguide-python, devguide-go
1313
---
1414

0 commit comments

Comments
 (0)