Skip to content

long-running-polling-operation-required

Full name
@azure-tools/typespec-azure-core/long-running-polling-operation-required

Long-running operations that return an Operation-Location header should have a linked polling operation. Use the @pollingOperation decorator to link a status polling operation.

Operation returning Operation-Location header without a linked polling operation:

op read(): Foundations.LongRunningStatusLocation;

Custom header with Operation-Location without a polling operation:

op readWithCustomHeader(): {
@header("Operation-Location") location: string;
};

Use the @pollingOperation decorator to link a status polling operation:

op getOperationStatus is Foundations.GetOperationStatus;
@pollingOperation(getOperationStatus)
op read(): Foundations.LongRunningStatusLocation;
op getOperationStatus is Foundations.GetOperationStatus;
@pollingOperation(getOperationStatus)
op readWithCustomHeader(): {
@header("Operation-Location") location: string;
};