0

I have been experimenting with slot warm up settings using "WEBSITE_SWAP_WARMUP_PING_PATH" app service configuration as suggested in Ruslan's blog. Unfortunately, I don't see it working the way I would expect. My expectation is that the slot swap operation would fail if the status code listed in "WEBSITE_SWAP_WARMUP_PING_STATUSES" did not match the "WEBSITE_SWAP_WARMUP_PING_PATH" response code. I went as far as hard-coding a 500 status code in my warm-up path but the slot swaps continue to complete successfully.

Shouldn't an unmatched status code prevent the slot swap?

Here is my controller action:

  public class HomeController : Controller
  {
        ...
        public IActionResult Warmup()
        {
             return new StatusCodeResult(500);
        }

Here are my App Service Configuration Settings

  {
    "name": "WEBSITE_SWAP_WARMUP_PING_PATH",
    "value": "/home/warmup",
    "slotSetting": true
  },
  {
    "name": "WEBSITE_SWAP_WARMUP_PING_STATUSES",
    "value": "200",
    "slotSetting": true
  },

Edit: I even took it a step further and completely removed the action. The application should now return a 400. However, when I turn on request tracing I can see that I am actually getting a 307.

enter image description here

William Edmondson
  • 3,619
  • 3
  • 32
  • 41
  • Here's some useful information about this. https://haacked.com/archive/2020/09/28/azure-swap-with-warmup-aspnetcore/ – lopezbertoni Aug 03 '22 at 20:13

1 Answers1

1

The documentation states that it can be put in the web.config as well as the azure app configuration. We initially had it in web config which didn't work. When we changed it to the azure app setting configuration it worked and didn't swap on an error 500.

Link to the settings I mean: https://learn.microsoft.com/en-us/azure/app-service/configure-common

Dharman
  • 30,962
  • 25
  • 85
  • 135
nldev
  • 299
  • 3
  • 15