retry-after
@azure-tools/typespec-azure-resource-manager/retry-afterCheck if the Retry-After header appears in the response for long-running operations. 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.
โ 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; };}