You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/management/async-operations.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Status of asynchronous operations
3
3
description: Describes how to track asynchronous operations in Azure. It shows the values you use to get the status of a long-running operation.
4
4
ms.topic: conceptual
5
-
ms.date: 01/31/2022
5
+
ms.date: 01/04/2024
6
6
ms.custom: seodec18
7
7
---
8
8
# Track asynchronous Azure operations
@@ -16,7 +16,7 @@ An asynchronous operation initially returns an HTTP status code of either:
16
16
* 201 (Created)
17
17
* 202 (Accepted)
18
18
19
-
However, that status code doesn't necessarily mean the operation is asynchronous. An asynchronous operation also returns a value for `provisioningState` that indicates the operation hasn't finished. The value can vary by operation but won't include **Succeeded**, **Failed**, or **Canceled**. Those three values indicate the operation has finished. If no value is returned for `provisioningState`, the operation has finished and succeeded.
19
+
However, that status code doesn't necessarily mean the operation is asynchronous. An asynchronous operation also returns a value for `provisioningState` that indicates the operation isn't finished. The value can vary by operation but doesn't include **Succeeded**, **Failed**, or **Canceled**. Those three values indicate the operation finished. If no value is returned for `provisioningState`, the operation finished and succeeded.
20
20
21
21
When the operation successfully completes, it returns either:
22
22
@@ -36,18 +36,28 @@ There are two different ways to monitor the status the asynchronous operation. Y
36
36
37
37
If `Azure-AsyncOperation` isn't one of the header values, then look for:
38
38
39
-
*`Location` - URL for determining when an operation has completed. Use this value only when `Azure-AsyncOperation` isn't returned.
39
+
*`Location` - URL for determining when an operation is completed. Use this value only when `Azure-AsyncOperation` isn't returned.
40
40
*`Retry-After` - The number of seconds to wait before checking the status of the asynchronous operation.
41
41
42
+
When the `Retry-after` header isn't returned, [implement your own retry logic](/azure/architecture/best-practices/retry-service-specific#general-rest-and-retry-guidelines).
43
+
42
44
> [!NOTE]
43
45
> Your REST client must accept a minimum URL size of 4 KB for `Azure-AsyncOperation` and `Location`.
44
46
45
-
> [!NOTE]
46
-
> When the `Retry-after` header is not returned, implement your own retry logic by following the Azure guidelines in [this](https://learn.microsoft.com/azure/architecture/best-practices/retry-service-specific#general-rest-and-retry-guidelines) document.
47
+
## Permission for tracking async status
48
+
49
+
To track the status of an asynchronous operation, you need sufficient permission at the level of the resource group. If you only have permission at the level of the resource, you can start the operation but you can't track its status. Permission at the level of the resource group is required because the URL for tracking status isn't scoped to the resource.
50
+
51
+
For example, to start a virtual machine, you need the Virtual Machine Contributor role for the resource group that contains the virtual machine. The URL for tracking a start request doesn't include the virtual machine in its path.
If you have a URL from the `Azure-AsyncOperation` header value, send a GET request to that URL. Use the value from `Retry-After` to schedule how often to check the status. You'll get a response object that indicates the status of the operation. A different response is returned when checking the status of the operation with the `Location` URL. For more information about the response from a location URL, see [Create storage account (202 with Location and Retry-After)](#create-storage-account-202-with-location-and-retry-after).
60
+
If you have a URL from the `Azure-AsyncOperation` header value, send a GET request to that URL. Use the value from `Retry-After` to schedule how often to check the status. You get a response object that indicates the status of the operation. A different response is returned when checking the status of the operation with the `Location` URL. For more information about the response from a location URL, see [Create storage account (202 with Location and Retry-After)](#create-storage-account-202-with-location-and-retry-after).
51
61
52
62
The response properties can vary but always include the status of the asynchronous operation.
53
63
@@ -81,13 +91,13 @@ The error object is returned when the status is Failed or Canceled. All other va
81
91
82
92
## provisioningState values
83
93
84
-
Operations that create, update, or delete (PUT, PATCH, DELETE) a resource typically return a `provisioningState` value. When an operation has completed, one of following three values is returned:
94
+
Operations that create, update, or delete (PUT, PATCH, DELETE) a resource typically return a `provisioningState` value. When an operation completes, one of following three values is returned:
85
95
86
96
* Succeeded
87
97
* Failed
88
98
* Canceled
89
99
90
-
All other values indicate the operation is still running. The resource provider can return a customized value that indicates its state. For example, you may receive **Accepted** when the request is received and running.
100
+
All other values indicate the operation is still running. The resource provider can return a customized value that indicates its state. For example, you receive **Accepted** when the request is received and running.
91
101
92
102
## Example requests and responses
93
103
@@ -106,7 +116,7 @@ It returns status code 202. Among the header values, you see:
If the request is still running, you receive a status code 202. If the request has completed, your receive a status code 200. The body of the response contains the properties of the storage account that was created.
216
+
If the request is still running, you receive a status code 202. If the request is completed, your receive a status code 200. The body of the response contains the properties of the storage account that was created.
0 commit comments