Guest shuanand Posted December 13, 2022 Posted December 13, 2022 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: https://management.azure.com/subscriptions/{SubscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap?api-version=2022-03-01 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) GET: https://management.azure.com/subscriptions/{SubscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/operationresults/915677b6-ea92-44c9-865b-95cfc693d5bb?api-version=2018-11-01 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. Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.