Tracking Asynchronous Service Management Requests
Updated: November 22, 2010
The Service Management API includes a number of operations that are processed asynchronously. An asynchronous operation may take an unspecified amount of time to complete. After you call an asynchronous operation, you must poll the management service to determine the status of the operation – whether it is complete, has failed, or is still in progress.
The Service Management API includes the following asynchronous operations:
-
Create Deployment
-
Swap Deployment
-
Delete Deployment
-
Change Deployment Configuration
-
Update Deployment Status
-
Upgrade Deployment
-
Walk Upgrade Domain
-
Reboot Role Instance
-
Reimage Role Instance
Polling an Asynchronous Operation
When you send an asynchronous request to the management service, the response includes data that you can use to poll the service for the status of the asynchronous operation.
If the request was successful and the asynchronous operation is being processed, the service returns status code 202 (Accepted). Note that this status code does not indicate whether the operation itself has been processed successfully, but only that the request has been received by the service. If the return status code is not 202 (Accepted), but indicates a service error, then the request must be retried.
The response headers include the x-ms-request-id header, the value of which uniquely identifies the request. You can call Get Operation Status with this value to poll the service to determine the status of the asynchronous operation. A call to Get Operation Status returns in the response body an indication of whether the operation has succeeded, has failed, or is still in progress.
If the asynchronous operation has succeeded or failed, the response will include the HTTP status code. If the operation failed, the response will also include additional error information. If the operation is still in progress, you can poll again after some interval to determine whether it has completed.
Note |
|---|
| If possible, your code should poll no more than once every few seconds to avoid being throttled. |
See Also
Note