I have a release pipeline that runs Azure App Service deploy task and then runs API management update task from "API Management Suite" by Stephane Eyskens.
The API management task calls Swagger endpoint to update OpenAPI schema in the API management.
The problem is that App Service deploy task is lying - the app is not ready right after deployment. It still runs the old version and it takes some time (10 - 20 seconds) for the deployment to actually complete.
So, when the API update task kicks in, it actually picks up Swagger definitions of the old version of the service and not the freshly deployed ones.
Is there any reasonable way to detect the real completion of the app service deployment process to delay the pipeline until the app has been fully restarted?
By the way, the same happens when restarting an app service manually. Azure happily reports the service has been restarted, but in reality, any requests to the service still return the old state of the app for like 5 seconds, and then it goes down for 5 more seconds, and then it is up and running with the new state. Microsoft should do something about it to stop lying to developers about the state of their apps during restart.