Currently there is no standard REST API to monitor swap operation, apart from using the activity logs.
Web Apps - Swap Slot Slot - REST API (Azure App Service) | Microsoft Docs
However, we have recently found the following way to monitor the Swap operation and the same API is being used by Azure portal as well to update the Swap status and it's comparatively fast. Please refer to the steps below:
- First call the POST Slot-Swap API & it will trigger the swap operation as shown below:
2. The above API will have location parameter in Response Headers with Operation Results API call which can be used to continuously poll in a loop until the Response is 200 (Swap completed) or (failure status code in case of swap failure)
Polling: Swap in accepted/in-progress state:
Polling: Swap completed:
Thanks to @DeependraChaudhary for sharing the approach.
If you have any questions or feedback, please add a comment below.