.cancel operation command
Learn how to use the
.cancel operation command to cancel a long-running operation.This command cancels a long-running ingest from query operation. This command is useful when the operation is taking too long and you would like to abort it while running.
The cancel operation command isn’t guaranteed to succeed. The output of the .cancel operation command indicates whether or not cancellation was successful.
Syntax
.cancel operation OperationId [with ( reason = ReasonPhrase )]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| OperationId | guid | ✔️ | A guid of the operation ID returned from the running command. |
| ReasonPhrase | string | The reason for canceling the running command. |
Returns
| Output parameter | Type | Description |
|---|---|---|
| OperationId | guid | The operation ID of the operation that was canceled. |
| Operation | string | The operation kind that was canceled. |
| StartedOn | datetime | The start time of the operation that was canceled. |
| CancellationState | string | Returns one of the following options:Cancelled successfully: the operation was canceledCancel failed: the operation can’t be canceled at this point. The operation may still be running or may have completed. |
| ReasonPhrase | string | Reason why cancellation wasn’t successful. |
Example
.cancel operation 078b2641-f10d-4694-96f8-1ee2b75dda48 with(Reason="Command canceled by me")
| OperationId | Operation | StartedOn | CancellationState | ReasonPhrase |
|---|---|---|---|---|
| c078b2641-f10d-4694-96f8-1ee2b75dda48 | TableSetOrAppend | 2022-07-18 09:03:55.1387320 | Canceled successfully | Command canceled by me |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.