0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure App Service の warmup request が通らなくて困った

Last updated at Posted at 2025-07-18

ハマったのでメモ。

状況

  • App Service で Linux コンテナを動かしている
  • App Service 認証 (Easy Auth) を有効にしている
  • warmup request 成功と見なすステータスコードを環境変数 WEBSITE_WARMUP_STATUSES で絞りたい

困ったこと

WEBSITE_WARMUP_STATUSES を設定すると warmup request が通らなくてサービスが死ぬ。

※ 今回は WEBSITE_WARMUP_STATUSES200,401,404 と設定していた。

原因

デプロイログを見てみる。

INFO - Site myapp has explicitly set accepted warmup statuses: OK,Unauthorized,NotFound
INFO - Initiating warmup request to container myapp_1_00000000 for site myapp
INFO - Container myapp_1_00000000 for site myapp initialized successfully and is ready to serve requests.

あれ? 普通に warmup request 成功してね?

と思ったが、そのあと

INFO - Initiating warmup request to container myapp_1_00000000_middleware for site myapp
(略)
ERROR - Container myapp_1_00000000_middleware for site myapp did not start within expected time limit. Elapsed time = 230.5241168 sec
ERROR - Container myapp_1_00000000_middleware didn't respond to HTTP pings on port: 8181. Failing site start. See container logs for debugging.
INFO - Stopping site myapp because it failed during startup.

えっ 誰

どうも _middleware という suffix つきのコンテナが起動していて、その warmup request が失敗しているらしい。

解決策

調べると _middleware コンテナは Easy Auth のために App Service 側で起動したコンテナらしい。

Easy Auth ということは、warmup request に対してリダイレクトしているんじゃね?と予想して 301,302 を追加したら直った。

WEBSITE_WARMUP_STATUSES = 200,301,302,401,404

※ 実際にはどちらか片方でいいのだろうけど、どちらなのか調べるのが面倒だった

お気持ち

Easy Auth のコンテナにアプリケーション本体のコンテナと同じ warmup 設定を使い回す のやめてほしい!!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?