QuestionQ134

VerifiedDevelop Azure compute solutions

You develop and deploy an Azure App Service API app to a Windows-hosted deployment slot named Development. You create additional deployment slots named Testing and Production. You enable auto swap on the Production deployment slot.

You need to ensure that scripts run and resources are available before a swap operation occurs.

Solution: Update the app with a method named statuscheck that runs the scripts. Update the app settings for the app. Configure WEBSITE_SWAP_WARMUP_PING_PATH and WEBSITE_SWAP_WARMUP_PING_STATUSES with a path to the new method and appropriate response codes.

Does this solution meet the goal?

Explanation

WEBSITE_SWAP_WARMUP_PING_PATH configures the endpoint that Azure App Service pings to warm the target deployment slot during a swap. WEBSITE_SWAP_WARMUP_PING_STATUSES defines the HTTP status codes that allow the warm-up and swap to continue; other responses stop the operation. An endpoint that runs the required scripts and returns an accepted status code ensures those actions complete before the swap proceeds.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!