Increasing response times when deploying to app service

Brian Brinch 61 Reputation points
2022-04-05T12:55:04.913+00:00

I have a number of app services running in Azure and I just changed our deployments to use a staging slot for each app service. My flow is like this, using AZ CLI in each step:

  1. Delete existing staging slot
  2. Create new staging slot
  3. Deploy website to staging slot
  4. Warm up staging slot (using Invoke-WebRequest)
  5. Swap staging slot to production

But when step 3, 4 and 5 is executing the site is still running but it's very slow and response time are high. Do you have any idea how to make this more smooth? Can I scale the app service before starting the processes or what can I do?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,134 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 19,361 Reputation points
    2022-04-11T11:37:32.787+00:00

    Further if the swap operation takes a long time to complete, you can also get information on the swap operation in the activity log. On your app's resource page in the portal, in the left pane, select Activity log. A swap operation appears in the log query as Swap Web App Slots. You can expand it and select one of the sub operations or errors to see the details.

    Please refer to below links for more details on this:

    https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#what-happens-during-a-swap

    https://ruslany.net/2017/11/most-common-deployment-slot-swap-failures-and-how-to-fix-them/

    https://ruslany.net/2019/06/azure-app-service-deployment-slots-tips-and-tricks/

    Let us know if issue remains.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 19,361 Reputation points
    2022-04-11T11:36:43.393+00:00

    Just checking if you are still facing this issue.

    Adding some information here regarding Azure App service deployment slot swap might be helpful:

    Some apps might require custom warm-up actions before the swap. The applicationInitialization configuration element in web.config lets you specify custom initialization actions. The swap operation waits for this custom warm-up to finish before swapping with the target slot.

    During the swap operation the Web App’s worker process may get restarted in order for some settings to take effect. Even though the swap does not proceed until the restarted worker process comes back online on every VM instance, it may still not be enough for application to be completely ready to take on production traffic.

    Try enabling Application Initialization Module to completely warm up your application prior to swapping it into production.

    Check this: How to warm up Azure Web App during deployment slots swap

    1 person found this answer helpful.