retry-after
@azure-tools/typespec-azure-resource-manager/retry-afterCheck if retry-after header appears in response body.
For long-running operations, the Retry-After header indicates how long the client should wait before polling the operation status. This header should be included in 201 or 202 responses.
Impact
Section titled “Impact”- Area: API
Long-running or throttled operations should expose a standard Retry-After header so clients can poll correctly.
❌ Incorrect
Section titled “❌ Incorrect”Custom long-running operation missing Retry-After header:
@armResourceOperationsinterface FooResources { @Azure.Core.pollingOperation(FooResources.getOperationStatus) @post update(): FooResource;
getOperationStatus(): { status: Status; };}✅ Correct
Section titled “✅ Correct”Use ARM operation templates which include the Retry-After header automatically:
@armResourceOperationsinterface FooResources { start is ArmResourceActionAsync<FooResource, FooRequestBody, FooResponse>;}Or include Foundations.RetryAfterHeader in your custom response:
@armResourceOperationsinterface FooResources { @Azure.Core.pollingOperation(FooResources.getOperationStatus) @post update(): FooResource & Foundations.RetryAfterHeader;
getOperationStatus(): { status: Status; };}Suppression
Section titled “Suppression”Suppress only when required to match an existing API; otherwise add the standard Retry-After header.