App Service on Linux Python runtime における デプロイおよびリモートビルド(Kudu Oryx Build) について

# はじめに

App Service に おいてリモートビルドが有効な場合には、SCM サイトである kudu (App Service On Linux の場合は Kuduliteコンテナ)上で、Oryx を用いたリモートビルドが行われます。

この記事では、App Service On Linux Python アプリケーションを題材に、デプロイおよび、リモートビルドがどのように実行されているのかを確認します。

ローカルビルドについては以下で記載しています。

https://qiita.com/georgeOsdDev@github/items/7871193e037bfc02a8cb

Node.js ランタイムのデプロイについては以下で記載しています。

https://qiita.com/georgeOsdDev@github/items/a4aa7b7aa43a0114d96f

# TL;DR

- App Service On Linux Python リモートビルドでは Oryx が動作します。
  - Python ランタイムのダウンロードのために https://oryx-cdn.microsoft.io への通信が発生します。
  - Pip モジュールインストールのために、https://pypi.org 、https://files.pythonhosted.org への通信が発生します。
- Kudu コンテナ上において、Oryx(builder) によってビルドされたアプリケーションモジュールは `/home/site/wwwroot/output.tar.gz` として保存されます。
    - その時のビルド情報は、`/home/site/wwwroot/oryx-manifest.toml` に記載されている。
- App コンテナ上において、コンテナ起動時には Oryx(script generator) によって、スタートアップスクリプトが作成され、`/home/site/wwwroot/output.tar.gz` は、アプリケーションコンテナの `/tmp` 配下に展開されて実行されます。

# 題材

題材としては以下のチュートリアルに沿って　Django アプリをデプロイしてみます。

https://learn.microsoft.com/ja-jp/azure/app-service/quickstart-python?tabs=django%2Cwindows%2Cazure-cli%2Cvscode-deploy%2Cdeploy-instructions-azportal%2Cterminal-bash%2Cdeploy-instructions-zip-azcli

「1 - サンプル アプリケーション」まで進めてローカル環境で動作するようにしておきます。
プロジェクトルートには .venv が存在し、pip モジュールがインストールされた状態となっています。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/4914/99630958-6ba2-1a0f-3503-b405c920eb7e.png)

また、まだ Azure 上には デプロイしていないため　`/home/site/wwwroot` 配下は空のまま。`/tmp` 配下にも `oryx` ディレクトリは存在しません。（同じApp Service Plan で別のアプリでリモートビルドを利用している場合は既に存在している場合があります。)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/4914/0ee64c94-08e8-3ed6-0a5a-106bde725455.png)


# App Service On Linux Python におけるリモートビルド

Python 環境においてリモートビルドを有効にする場合、アプリの設定 `SCM_DO_BUILD_DURING_DEPLOYMENT` が `1(または true)` に設定されている必要があります。

https://learn.microsoft.com/ja-jp/azure/app-service/configure-language-python#customize-build-automation

## VS Code 機能拡張を用いてデプロイする場合の Tips

VS Code 機能拡張を用いてデプロイする場合、[zip デプロイ](https://learn.microsoft.com/ja-jp/azure/app-service/deploy-zip?tabs=cli#create-a-project-zip-package)が用いられることになりますが、デプロイの最適化をよしなにやってくれます。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/4914/3edf7226-f705-aa5c-abb6-eac087b480f6.png)

上記ダイアログで `Yes` を選択すると、プロジェクト内に `.vscode/settings.json` と `.deployment` ファイルが作成されます。仕組みとしては [Node.js 版での記事](https://qiita.com/georgeOsdDev@github/items/a4aa7b7aa43a0114d96f#vs-code-%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AE%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A0%85) と同じです。

https://github.com/microsoft/vscode-azureappservice/wiki/Configuring-Zip-Deployment

## Zip デプロイの実行

VS Code の output パネルの出力は以下のようになります。

`11:39:18 AM python-remote-build: Zip package size: 2.16 MB` までは、VSCode(クライアント側)の処理となり、zip ファイルを作成したりする処理となります。

`.vscode/settings.json` に記載の `appService.zipIgnorePattern` に沿ってローカルビルド/実行時に必要だった pip モジュールなどは zip に含めないように作成されています。
Pythonのコード自体はわずかですが、サンプルプロジェクトには `static/bootstrap` が含まれているのでそれが影響して 2.16 MB となっています。 

`11:39:18 AM python-remote-build: Fetching changes.` 以降が Kudu 上での処理となります。

```log:output.log
11:39:16 AM python-remote-build: Starting deployment...
11:39:16 AM python-remote-build: Creating zip package...
11:39:17 AM python-remote-build: Ignoring files from "appService.zipIgnorePattern"
"__pycache__{,/**}"
"*.py[cod]"
"*$py.class"
".Python{,/**}"
"build{,/**}"
"develop-eggs{,/**}"
"dist{,/**}"
"downloads{,/**}"
"eggs{,/**}"
".eggs{,/**}"
"lib{,/**}"
"lib64{,/**}"
"parts{,/**}"
"sdist{,/**}"
"var{,/**}"
"wheels{,/**}"
"share/python-wheels{,/**}"
"*.egg-info{,/**}"
".installed.cfg"
"*.egg"
"MANIFEST"
".env{,/**}"
".venv{,/**}"
"env{,/**}"
"venv{,/**}"
"ENV{,/**}"
"env.bak{,/**}"
"venv.bak{,/**}"
".vscode{,/**}"
11:39:18 AM python-remote-build: Zip package size: 2.16 MB
11:39:18 AM python-remote-build: Fetching changes.
11:39:19 AM python-remote-build: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/ca6d6728-ef21-43fd-811e-af4506d2fc8c.zip (2.06 MB) to /tmp/zipdeploy/extracted
11:39:23 AM python-remote-build: Updating submodules.
11:39:24 AM python-remote-build: Preparing deployment for commit id 'e8ddf80e-3'.
11:39:24 AM python-remote-build: PreDeployment: context.CleanOutputPath False
11:39:24 AM python-remote-build: PreDeployment: context.OutputPath /home/site/wwwroot
11:39:25 AM python-remote-build: Repository path is /tmp/zipdeploy/extracted
11:39:25 AM python-remote-build: Running oryx build...
11:39:25 AM python-remote-build: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.12 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8dbed5fbcb85126 --compress-destination-dir | tee /tmp/oryx-build.log
11:39:29 AM python-remote-build: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
11:39:29 AM python-remote-build: You can report issues at https://github.com/Microsoft/Oryx/issues
11:39:29 AM python-remote-build: Oryx Version: 0.2.20230508.1, Commit: 7fe2bf39b357dd68572b438a85ca50b5ecfb4592, ReleaseTagName: 20230508.1
11:39:29 AM python-remote-build: Build Operation ID: a44e7c14de0e264b
11:39:29 AM python-remote-build: Repository Commit : e8ddf80e-392e-4179-846c-b8709a1299f7
11:39:29 AM python-remote-build: OS Type           : bullseye
11:39:29 AM python-remote-build: Image Type        : githubactions
11:39:30 AM python-remote-build: Detecting platforms...
11:39:32 AM python-remote-build: Detected following platforms:
11:39:32 AM python-remote-build:   python: 3.12.0
11:39:32 AM python-remote-build: Version '3.12.0' of platform 'python' is not installed. Generating script to install it...
11:39:33 AM python-remote-build: Using intermediate directory '/tmp/8dbed5fbcb85126'.
11:39:33 AM python-remote-build: Copying files to the intermediate directory...
11:39:33 AM python-remote-build: Done in 0 sec(s).
11:39:33 AM python-remote-build: Source directory     : /tmp/8dbed5fbcb85126
11:39:33 AM python-remote-build: Destination directory: /home/site/wwwroot
11:39:33 AM python-remote-build: Downloading and extracting 'python' version '3.12.0' to '/tmp/oryx/platforms/python/3.12.0'...
11:39:33 AM python-remote-build: Detected image debian flavor: bullseye.
11:39:49 AM python-remote-build: Downloaded in 16 sec(s).
11:39:49 AM python-remote-build: Verifying checksum...
11:39:49 AM python-remote-build: Extracting contents...
11:40:08 AM python-remote-build: performing sha512 checksum for: python...
11:40:10 AM python-remote-build: Done in 37 sec(s).
11:40:10 AM python-remote-build: image detector file exists, platform is python..
11:40:10 AM python-remote-build: OS detector file exists, OS is bullseye..
11:40:11 AM python-remote-build: Python Version: /tmp/oryx/platforms/python/3.12.0/bin/python3.12
11:40:11 AM python-remote-build: Creating directory for command manifest file if it does not exist
11:40:11 AM python-remote-build: Removing existing manifest file
11:40:11 AM python-remote-build: Python Virtual Environment: antenv
11:40:11 AM python-remote-build: Creating virtual environment...
11:40:26 AM python-remote-build: Activating virtual environment...
11:40:26 AM python-remote-build: Running pip install...
11:40:41 AM python-remote-build: [02:40:28+0000] Collecting Django (from -r requirements.txt (line 1))
11:40:41 AM python-remote-build: [02:40:28+0000]   Obtaining dependency information for Django from https://files.pythonhosted.org/packages/2d/6d/e87236e3c7b2f5911d132034177aebb605f3953910cc429df8061b13bf10/Django-4.2.7-py3-none-any.whl.metadata
11:40:41 AM python-remote-build: [02:40:28+0000]   Downloading Django-4.2.7-py3-none-any.whl.metadata (4.1 kB)
11:40:41 AM python-remote-build: [02:40:29+0000] Collecting whitenoise (from -r requirements.txt (line 2))
11:40:41 AM python-remote-build: [02:40:29+0000]   Obtaining dependency information for whitenoise from https://files.pythonhosted.org/packages/67/16/bb488ac8230f1bce94943b6654f2aad566d18aae575c8b6d8a99c78c489e/whitenoise-6.6.0-py3-none-any.whl.metadata
11:40:41 AM python-remote-build: [02:40:29+0000]   Downloading whitenoise-6.6.0-py3-none-any.whl.metadata (3.7 kB)
11:40:42 AM python-remote-build: [02:40:29+0000] Collecting asgiref<4,>=3.6.0 (from Django->-r requirements.txt (line 1))
11:40:42 AM python-remote-build: [02:40:29+0000]   Obtaining dependency information for asgiref<4,>=3.6.0 from https://files.pythonhosted.org/packages/9b/80/b9051a4a07ad231558fcd8ffc89232711b4e618c15cb7a392a17384bbeef/asgiref-3.7.2-py3-none-any.whl.metadata
11:40:42 AM python-remote-build: [02:40:29+0000]   Downloading asgiref-3.7.2-py3-none-any.whl.metadata (9.2 kB)
11:40:42 AM python-remote-build: [02:40:29+0000] Collecting sqlparse>=0.3.1 (from Django->-r requirements.txt (line 1))
11:40:42 AM python-remote-build: [02:40:29+0000]   Downloading sqlparse-0.4.4-py3-none-any.whl (41 kB)
11:40:42 AM python-remote-build: [02:40:29+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.2/41.2 kB 1.3 MB/s eta 0:00:00
11:40:42 AM python-remote-build: [02:40:29+0000] Downloading Django-4.2.7-py3-none-any.whl (8.0 MB)
11:40:42 AM python-remote-build: [02:40:29+0000]    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 21.5 MB/s eta 0:00:00
11:40:42 AM python-remote-build: [02:40:29+0000] Downloading whitenoise-6.6.0-py3-none-any.whl (19 kB)
11:40:42 AM python-remote-build: [02:40:29+0000] Downloading asgiref-3.7.2-py3-none-any.whl (24 kB)
11:40:42 AM python-remote-build: [02:40:30+0000] Installing collected packages: whitenoise, sqlparse, asgiref, Django
11:40:42 AM python-remote-build: [02:40:40+0000] Successfully installed Django-4.2.7 asgiref-3.7.2 sqlparse-0.4.4 whitenoise-6.6.0
11:40:42 AM python-remote-build: [notice] A new release of pip is available: 23.2.1 -> 23.3.1
11:40:42 AM python-remote-build: [notice] To update, run: pip install --upgrade pip
11:40:42 AM python-remote-build: Content in source directory is a Django app
11:40:42 AM python-remote-build: Running collectstatic...
11:40:50 AM python-remote-build: 171 static files copied to '/tmp/8dbed5fbcb85126/staticfiles', 513 post-processed.
11:40:50 AM python-remote-build: Done in 9 sec(s).
11:40:50 AM python-remote-build: Not a vso image, so not writing build commands
11:40:50 AM python-remote-build: Preparing output...
11:40:50 AM python-remote-build: Copying files to destination directory '/tmp/_preCompressedDestinationDir'...
11:40:55 AM python-remote-build: Done in 5 sec(s).
11:40:55 AM python-remote-build: Compressing content of directory '/tmp/_preCompressedDestinationDir'...
11:41:09 AM python-remote-build: Copied the compressed output to '/home/site/wwwroot'
11:41:09 AM python-remote-build: Removing existing manifest file
11:41:09 AM python-remote-build: Creating a manifest file...
11:41:09 AM python-remote-build: Manifest file created.
11:41:09 AM python-remote-build: Copying .ostype to manifest output directory.
11:41:09 AM python-remote-build: Done in 96 sec(s).
11:41:10 AM python-remote-build: Running post deployment command(s)...
11:41:10 AM python-remote-build: Generating summary of Oryx build
11:41:10 AM python-remote-build: Parsing the build logs
11:41:10 AM python-remote-build: Found 0 issue(s)
11:41:10 AM python-remote-build: Build Summary :
11:41:11 AM python-remote-build: ===============
11:41:11 AM python-remote-build: Errors (0)
11:41:11 AM python-remote-build: Warnings (0)
11:41:11 AM python-remote-build: Triggering recycle (preview mode disabled).
11:41:11 AM python-remote-build: Deployment successful. deployer = ms-azuretools-vscode deploymentPath = ZipDeploy. Extract zip.
11:41:18 AM: Deployment to "python-remote-build" completed.
```

### Kudu 側ログの確認

Kudu 側のログも確認してみます。
`/home/LogFiles/kudu/traces` 以下に以下のようなログファイル群が出力されています。

```bash
ls -rt
2023-11-25T02-39-17_157a08_002_POST_api-zipdeploy_202_1s.xml
2023-11-25T02-39-19_157a08_004_GET_api-deployments-latest_202_0s.xml
2023-11-25T02-39-19_157a08_005_GET_api-deployments-temp-f3d4af1b-log_200_0s.xml
2023-11-25T02-39-20_157a08_006_GET_api-deployments-temp-f3d4af1b-log-d9050df9-dd65-42fc-a8eb-d9a0d037beea_200_0s.xml
2023-11-25T02-39-26_157a08_007_GET_api-deployments-latest_202_1s.xml
2023-11-25T02-39-27_157a08_008_GET_api-deployments-e8ddf80e-392e-4179-846c-b8709a1299f7-log_200_0s.xml
2023-11-25T02-39-28_157a08_009_GET_api-deployments-e8ddf80e-392e-4179-846c-b8709a1299f7-log-8ff6c2e4-4da2-4f53-93fe-8719c5372321_200_0s.xml
<省略>
2023-11-25T02-41-09_157a08_052_GET_api-deployments-latest_202_0s.xml
2023-11-25T02-41-09_157a08_053_GET_api-deployments-e8ddf80e-392e-4179-846c-b8709a1299f7-log_200_0s.xml
2023-11-25T02-41-10_157a08_054_GET_api-deployments-e8ddf80e-392e-4179-846c-b8709a1299f7-log-8ff6c2e4-4da2-4f53-93fe-8719c5372321_200_0s.xml
2023-11-25T02-39-18_157a08_003_Background_POST_api-zipdeploy_pending.xml
2023-11-25T02-41-15_157a08_056_GET_api-deployments-e8ddf80e-392e-4179-846c-b8709a1299f7-log_200_0s.xml
2023-11-25T02-41-16_157a08_057_GET_api-deployments-e8ddf80e-392e-4179-846c-b8709a1299f7-log-8ff6c2e4-4da2-4f53-93fe-8719c5372321_200_0s.xml
```

VS Code によるリクエストは Zip パッケージを送信する POST と、デプロイステータス確認の GET が行われたことがわかります。
ここでは `POST_api-zipdeploy_202.xml` と、`Background_POST_api-zipdeploy_pending.xml` に着目します。

#### POST_api-zipdeploy_202.xml

`POST_api-zipdeploy_202_1s.xml` では以下のことがわかります。

- `api/zipdeploy?author=ms-azuretools-vscode&amp;deployer=ms-azuretools-vscode&amp;isAsync=true&amp;trackDeploymentId=true`に対してリクエストが行われたこと
- リクエスト内容から `/tmp/zipdeploy/ca6d6728-ef21-43fd-811e-af4506d2fc8c.zip` を保存したこと、
`/api/zipdeploy` は`isAsync=true` で呼び出されたため、`Start deployment in the background` 非同期処理が開始されたこと
- ステータスコードは `202` を返却したこと


<details><summary>/home/LogFiles/kudu/trace/POST_api-zipdeploy_202_1s.xml</summary>


```xml:/home/LogFiles/kudu/trace/POST_api-zipdeploy_202_1s.xml
kudu_ssh_user@9559f769d7bc:~/LogFiles/kudu/trace$ cat 2023-11-25T02-39-17_157a08_002_POST_api-zipdeploy_202_1s.xml
<step title="Incoming Request" date="2023-11-25T02:39:17.446" instance="157a08" url="/api/zipdeploy?author=ms-azuretools-vscode&amp;deployer=ms-azuretools-vscode&amp;isAsync=true&amp;trackDeploymentId=true" method="POST" type="request" pid="86,1,22" Host="python-remote-build.scm.azurewebsites.net" User-Agent="vscode-azureappservice/0.25.1 core-rest-pipeline/1.11.0 Node/v18.15.0 OS/(x64-Linux-5.15.133.1-microsoft-standard-WSL2)" Accept-Encoding="gzip,deflate" Accept-Language="en" Authorization="Bea..." Transfer-Encoding="chunked" x-ms-correlation-request-id="4a4ecb28-5538-4cf3-a26b-5d070b9051e7" x-ms-client-request-id="f5a4b6de-404d-49fd-a1a8-7c8c00e6b4e1" X-ARR-LOG-ID="8c4cd35f-88f7-4d17-8cdb-e944a03c5759" CLIENT-IP="[マスク]:63284" X-Client-IP="[マスク]" X-SITE-DEPLOYMENT-ID="python-remote-build" WAS-DEFAULT-HOSTNAME="python-remote-build.scm.azurewebsites.net" X-Forwarded-Proto="https" X-AppService-Proto="https" X-Forwarded-TlsVersion="1.2" X-MS-CLIENT-DISPLAY-NAME="Takeharu Oshida" X-WAWS-Unencoded-URL="/api/zipdeploy?author=ms-azuretools-vscode&amp;deployer=ms-azuretools-vscode&amp;isAsync=true&amp;trackDeploymentId=true" X-Client-Port="63284" >
  <step title="Cleanup Xml Logs" date="2023-11-25T02:39:17.475" /><!-- duration: 10ms -->
  <step title="ZipPushDeploy" date="2023-11-25T02:39:17.694" >
    <step title="ZipDeploy. Extract zip." date="2023-11-25T02:39:17.727" /><!-- duration: 5ms -->
    <step title="None repository commit" date="2023-11-25T02:39:17.754" >
      <step title="Commit id: e8ddf80e-392e-4179-846c-b8709a1299f7" date="2023-11-25T02:39:17.760" Message="N/A" AuthorName="N/A" AuthorEmail="N/A" /><!-- duration: 5ms -->
    </step><!-- duration: 15ms -->
    <step title="Writing artifact to /tmp/zipdeploy/ca6d6728-ef21-43fd-811e-af4506d2fc8c.zip" date="2023-11-25T02:39:17.872" /><!-- duration: 145ms -->
    <step title="Start deployment in the background" date="2023-11-25T02:39:18.044" >
      <step title="Acquiring Deployment Lock" date="2023-11-25T02:39:18.067" /><!-- duration: 16ms -->
      <step title="Acquired Deployment Lock" date="2023-11-25T02:39:18.158" /><!-- duration: 4ms -->
    </step><!-- duration: 235ms -->
  </step><!-- duration: 597ms -->
  <step title="Outgoing response" date="2023-11-25T02:39:18.303" type="response" statusCode="202" statusText="Accepted" /><!-- duration: 9ms -->
</step><!-- duration: 871ms -->
```
</details>

#### Background_POST_api-zipdeploy_pending.xml


下記の部分にて、`OryxBuilder` が選出され、実行されたことがわかります。
Oryx による処理の後、アプリケーションコンテナのリサイクルがトリガーされています。
```xml
<step title="Determining deployment builder" date="2023-11-25T02:39:24.657" >
  <step title="Builder is OryxBuilder" date="2023-11-25T02:39:24.679" /><!-- duration: 4ms -->
</step><!-- duration: 31ms -->
<step title="PreDeployment: context.CleanOutputPath False" date="2023-11-25T02:39:24.740" >
  <step title="PreDeployment: context.OutputPath /home/site/wwwroot" date="2023-11-25T02:39:24.856" >
    <step title="Building" date="2023-11-25T02:39:25.004" >
      <step title="Executing external process" date="2023-11-25T02:39:25.312" type="process" path="bash" arguments="-c &quot;oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.12 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8dbed5fbcb85126 --compress-destination-dir | tee /tmp/oryx-build.log ; exit $PIPESTATUS &quot;" /><!-- duration: 104503ms -->
      <step title="Using PythonDeploymentLogParser" date="2023-11-25T02:41:10.407" /><!-- duration: 10ms -->
      <step title="Triggering recycle (preview mode disabled)." date="2023-11-25T02:41:11.561" /><!-- duration: 13ms -->
      <step title="Modified file to trigger a restart of the app container." date="2023-11-25T02:41:11.610" /><!-- duration: 5ms -->
      <step title="Skip function trigger and logicapp sync because function is not enabled." date="2023-11-25T02:41:11.634" /><!-- duration: 11ms -->
    </step><!-- duration: 107417ms -->
  </step><!-- duration: 107574ms -->
```

<details><summary>/home/LogFiles/kudu/trace/POST_api-zipdeploy_202_1s.xml </summary>

```xml:/home/LogFiles/kudu/trace/Background_POST_api-zipdeploy_pending.xml
kudu_ssh_user@9559f769d7bc:~/LogFiles/kudu/trace$ cat 2023-11-25T02-39-18_157a08_003_Background_POST_api-zipdeploy_pending.xml
<step title="BackgroundTrace" date="2023-11-25T02:39:18.050" instance="157a08" url="/api/zipdeploy" method="POST" >
  <step title="Creating temporary deployment - FetchDeploymentManager" date="2023-11-25T02:39:18.167" /><!-- duration: 5ms -->
  <step title="Creating temporary deployment" date="2023-11-25T02:39:18.179" /><!-- duration: 94ms -->
  <step title="Performing fetch based deployment" date="2023-11-25T02:39:18.391" >
    <step title="Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/ca6d6728-ef21-43fd-811e-af4506d2fc8c.zip (2.06 MB) to /tmp/zipdeploy/extracted" date="2023-11-25T02:39:19.571" >
      <step title="ChmodRecursive Process exited with total time taken in ms: 172" date="2023-11-25T02:39:20.013" /><!-- duration: 9ms -->
    </step><!-- duration: 456ms -->
    <step title="Before sending BuildRequestReceived status to /api/updatedeploystatus" date="2023-11-25T02:39:22.056" /><!-- duration: 11ms -->
    <step title=" PostAsync - Trying to send BuildRequestReceived deployment status to /api/app/updatedeploystatus. DeploymentId is e8ddf80e-392e-4179-846c-b8709a1299f7" date="2023-11-25T02:39:22.073" /><!-- duration: 27ms -->
    <step title=" PostAsync - Trying to send BuildInProgress deployment status to /api/app/updatedeploystatus. DeploymentId is e8ddf80e-392e-4179-846c-b8709a1299f7" date="2023-11-25T02:39:22.882" /><!-- duration: 5ms -->
    <step title="Deployment timer started" date="2023-11-25T02:39:23.023" >
      <step title="DeploymentManager.Deploy(id:e8ddf80e-392e-4179-846c-b8709a1299f7)" date="2023-11-25T02:39:23.029" >
        <step title="Collecting changeset information" date="2023-11-25T02:39:23.086" /><!-- duration: 116ms -->
        <step title="Updating submodules" date="2023-11-25T02:39:23.213" /><!-- duration: 1175ms -->
        <step title="Determining deployment builder" date="2023-11-25T02:39:24.657" >
          <step title="Builder is OryxBuilder" date="2023-11-25T02:39:24.679" /><!-- duration: 4ms -->
        </step><!-- duration: 31ms -->
        <step title="PreDeployment: context.CleanOutputPath False" date="2023-11-25T02:39:24.740" >
          <step title="PreDeployment: context.OutputPath /home/site/wwwroot" date="2023-11-25T02:39:24.856" >
            <step title="Building" date="2023-11-25T02:39:25.004" >
              <step title="Executing external process" date="2023-11-25T02:39:25.312" type="process" path="bash" arguments="-c &quot;oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.12 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8dbed5fbcb85126 --compress-destination-dir | tee /tmp/oryx-build.log ; exit $PIPESTATUS &quot;" /><!-- duration: 104503ms -->
              <step title="Using PythonDeploymentLogParser" date="2023-11-25T02:41:10.407" /><!-- duration: 10ms -->
              <step title="Triggering recycle (preview mode disabled)." date="2023-11-25T02:41:11.561" /><!-- duration: 13ms -->
              <step title="Modified file to trigger a restart of the app container." date="2023-11-25T02:41:11.610" /><!-- duration: 5ms -->
              <step title="Skip function trigger and logicapp sync because function is not enabled." date="2023-11-25T02:41:11.634" /><!-- duration: 11ms -->
            </step><!-- duration: 107417ms -->
          </step><!-- duration: 107574ms -->
          <step title="Cleaning up temp files" date="2023-11-25T02:41:12.435" /><!-- duration: 1511ms -->
          <step title="Cleaning up temp files" date="2023-11-25T02:41:13.955" /><!-- duration: 511ms -->
          <step title="Reloading status file with latest updates" date="2023-11-25T02:41:14.503" >
            <step title="WebHooksManager.PublishEventAsync: PostDeployment" date="2023-11-25T02:41:14.508" /><!-- duration: 103ms -->
          </step><!-- duration: 117ms -->
          <step title=" PostAsync - Trying to send BuildSuccessful deployment status to /api/app/updatedeploystatus. DeploymentId is e8ddf80e-392e-4179-846c-b8709a1299f7" date="2023-11-25T02:41:14.632" /><!-- duration: 5ms -->
          <step title="Begin HttpPost https://python-remote-build.scm.azurewebsites.net/api/app/updatedeploystatus, x-ms-request-id: 00000000-0000-0000-0000-000000000000" date="2023-11-25T02:41:14.655" /><!-- duration: 5ms -->
          <step title="End HttpPost, status: OK" date="2023-11-25T02:41:14.780" /><!-- duration: 6ms -->
          <step title="Cleaning up temporary deployment - fetch deployment was successful" date="2023-11-25T02:41:14.818" /><!-- duration: 5ms -->
        </step><!-- duration: 110160ms -->
      </step><!-- duration: 111904ms -->
kudu_ssh_user@9559f769d7bc:~/LogFiles/kudu/trace$
```
</details>

上記 Oryx 起動コマンドでは `--log-file /tmp/build-debug.log` および、`| tee /tmp/oryx-build.log` と 2 つのログファイル作成が行われています。

#### /tmp/oryx-build.log

Oryx によるアプリケーションのビルド処理全体は、`/tmp/oryx-build.log` に出力されています。
このログからは、Oryx による`Detect` および `Build` 処理が行われたことがわかります。
その結果、Pythonランタイムの取得と`pip install` 等の処理 行われています。

Pyhon 環境におけるビルドの詳細は下記に記載されています。

https://github.com/microsoft/Oryx/blob/main/doc/runtimes/python.md

> **Build**
> The following process is applied for each build.
> 1. Run custom command or script if specified by PRE_BUILD_COMMAND or PRE_BUILD_SCRIPT_PATH.
> 2. Create python virtual environment if specified by VIRTUALENV_NAME.
> 3. Run python -m pip install --cache-dir /usr/local/share/pip-cache --prefer-binary -r requirements.txt if requirements.txt exists in the root of repo or specified by CUSTOM_REQUIREMENTSTXT_PATH.
> 4. Run python setup.py install if setup.py exists.
> 5. Run python package commands and determine python package wheel.
> 6. If manage.py is found in the root of the repo manage.py collectstatic is run. However, if DISABLE_COLLECTSTATIC is set to true this step is skipped.
> 7. Compress virtual environment folder if specified by compress_virtualenv property key.
> 8. Run custom command or script if specified by POST_BUILD_COMMAND or POST_BUILD_SCRIPT_PATH.

このタイミングで `pip install` が行われているため、Kudu コンテナから https://pypi.org 、https://files.pythonhosted.org など、`requirements.txt` に記載のないように基づいた通信が発生します。

VNet 統合時においては、Outbound の NSG でインターネット宛ての通信をブロックしている場合ビルドに失敗することになります。

<details><summary>/tmp/oryx-build.log </summary>


```log:/tmp/oryx-build.log
kudu_ssh_user@9559f769d7bc:/tmp$ cat oryx-build.log 
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20230508.1, Commit: 7fe2bf39b357dd68572b438a85ca50b5ecfb4592, ReleaseTagName: 20230508.1

Build Operation ID: a44e7c14de0e264b
Repository Commit : e8ddf80e-392e-4179-846c-b8709a1299f7
OS Type           : bullseye
Image Type        : githubactions

Detecting platforms...
Detected following platforms:
  python: 3.12.0
Version '3.12.0' of platform 'python' is not installed. Generating script to install it...

Using intermediate directory '/tmp/8dbed5fbcb85126'.

Copying files to the intermediate directory...
Done in 0 sec(s).

Source directory     : /tmp/8dbed5fbcb85126
Destination directory: /home/site/wwwroot


Downloading and extracting 'python' version '3.12.0' to '/tmp/oryx/platforms/python/3.12.0'...
Detected image debian flavor: bullseye.
Downloaded in 16 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: python...
Done in 37 sec(s).

image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Python Version: /tmp/oryx/platforms/python/3.12.0/bin/python3.12
Creating directory for command manifest file if it does not exist
Removing existing manifest file
Python Virtual Environment: antenv
Creating virtual environment...
Activating virtual environment...
Running pip install...
[02:40:28+0000] Collecting Django (from -r requirements.txt (line 1))
[02:40:28+0000]   Obtaining dependency information for Django from https://files.pythonhosted.org/packages/2d/6d/e87236e3c7b2f5911d132034177aebb605f3953910cc429df8061b13bf10/Django-4.2.7-py3-none-any.whl.metadata
[02:40:28+0000]   Downloading Django-4.2.7-py3-none-any.whl.metadata (4.1 kB)
[02:40:29+0000] Collecting whitenoise (from -r requirements.txt (line 2))
[02:40:29+0000]   Obtaining dependency information for whitenoise from https://files.pythonhosted.org/packages/67/16/bb488ac8230f1bce94943b6654f2aad566d18aae575c8b6d8a99c78c489e/whitenoise-6.6.0-py3-none-any.whl.metadata
[02:40:29+0000]   Downloading whitenoise-6.6.0-py3-none-any.whl.metadata (3.7 kB)
[02:40:29+0000] Collecting asgiref<4,>=3.6.0 (from Django->-r requirements.txt (line 1))
[02:40:29+0000]   Obtaining dependency information for asgiref<4,>=3.6.0 from https://files.pythonhosted.org/packages/9b/80/b9051a4a07ad231558fcd8ffc89232711b4e618c15cb7a392a17384bbeef/asgiref-3.7.2-py3-none-any.whl.metadata
[02:40:29+0000]   Downloading asgiref-3.7.2-py3-none-any.whl.metadata (9.2 kB)
[02:40:29+0000] Collecting sqlparse>=0.3.1 (from Django->-r requirements.txt (line 1))
[02:40:29+0000]   Downloading sqlparse-0.4.4-py3-none-any.whl (41 kB)
[02:40:29+0000]      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.2/41.2 kB 1.3 MB/s eta 0:00:00
[02:40:29+0000] Downloading Django-4.2.7-py3-none-any.whl (8.0 MB)
[02:40:29+0000]    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 21.5 MB/s eta 0:00:00
[02:40:29+0000] Downloading whitenoise-6.6.0-py3-none-any.whl (19 kB)
[02:40:29+0000] Downloading asgiref-3.7.2-py3-none-any.whl (24 kB)
[02:40:30+0000] Installing collected packages: whitenoise, sqlparse, asgiref, Django
[02:40:40+0000] Successfully installed Django-4.2.7 asgiref-3.7.2 sqlparse-0.4.4 whitenoise-6.6.0

[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip

Content in source directory is a Django app
Running collectstatic...

171 static files copied to '/tmp/8dbed5fbcb85126/staticfiles', 513 post-processed.
Done in 9 sec(s).
Not a vso image, so not writing build commands
Preparing output...

Copying files to destination directory '/tmp/_preCompressedDestinationDir'...
Done in 5 sec(s).
Compressing content of directory '/tmp/_preCompressedDestinationDir'...
Copied the compressed output to '/home/site/wwwroot'

Removing existing manifest file
Creating a manifest file...
Manifest file created.
Copying .ostype to manifest output directory.

Done in 96 sec(s).
```
</details>

#### /tmp/build-debug.log

`/tmp/build-debug.log` にはランタイム取得時のデバッグログなどが含まれています。
ストレージアカウントと見受けられる `https://oryx-cdn.microsoft.io` からファイル取得していることがわかります。

https://github.com/microsoft/Oryx/blob/main/doc/hosts/appservice.md#network-dependencies

> **Network Dependencies**
When using App Service with a Virtual Network or an App Service Environment, you will need to allow outbound access from the webapp to oryx-cdn.microsoft.io on port 443. oryx-cdn.microsoft.io hosts the Oryx packages corresponding to each SDK language and version. If this network dependency is blocked, then App Service will not be able to build your application using Oryx.

この Network 依存があるため VNet 統合時においては、Outbound の NSG でインターネット宛ての通信をブロックしている場合ビルドに失敗することになります。

https://github.com/microsoft/Oryx/issues/971

<details><summary>/tmp/build-debug.log </summary>


```log:/tmp/build-debug.log 
kudu_ssh_user@9559f769d7bc:/tmp$ cat build-debug.log 
2023-11-25 02:39:29.2513|INFO|Microsoft.Oryx.BuildScriptGeneratorCli.CommandBase|Oryx command line: /opt/buildscriptgen/GenerateBuildScript.dll build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.12 -p virtualenv_name=antenv --log-file /tmp/build-debug.log -i /tmp/8dbed5fbcb85126 --compress-destination-dir
2023-11-25 02:39:29.8197|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Available checkers: 5
2023-11-25 02:39:29.8468|DEBUG|Microsoft.Oryx.Detector.Node.NodeDetector|Could not find package.json/package-lock.json/yarn.lock in repo
2023-11-25 02:39:29.8557|DEBUG|Microsoft.Oryx.Detector.Node.NodeDetector|Could not find typical Node.js files in repo
2023-11-25 02:39:29.8557|DEBUG|Microsoft.Oryx.Detector.Node.NodeDetector|App in repo is not a NodeJS app
2023-11-25 02:39:29.9590|INFO|Microsoft.Oryx.Detector.Python.PythonDetector|Found 726571756972656d656e74732e747874 at the root of the repo.
2023-11-25 02:39:29.9642|WARN|Microsoft.Oryx.Detector.Python.PythonDetector|Missing wsgi.py at the root of the repo. More information: https://aka.ms/missing-django-files
2023-11-25 02:39:29.9642|WARN|Microsoft.Oryx.Detector.Python.PythonDetector|Missing app.py at the root of the repo. More information: https://aka.ms/missing-django-files
2023-11-25 02:39:29.9642|ERROR|Microsoft.Oryx.Detector.Python.PythonDetector|Missing setup.py at the root of the repo. More information: https://aka.ms/requirements-not-found
2023-11-25 02:39:29.9642|ERROR|Microsoft.Oryx.Detector.Python.PythonDetector|Missing setup.py at the root of the repo. More information: https://aka.ms/requirements-not-found
2023-11-25 02:39:29.9935|DEBUG|Microsoft.Oryx.Detector.Python.PythonDetector|Could not find file 'runtime.txt' in source repo
2023-11-25 02:39:30.0233|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonSdkStorageVersionProvider|Getting list of available versions for platform python.
2023-11-25 02:39:30.0618|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonSdkStorageVersionProvider|Using the Sdk storage url https://oryx-cdn.microsoft.io.
2023-11-25 02:39:30.1029|INFO|System.Net.Http.HttpClient.general.LogicalHandler|Start processing HTTP request GET https://oryx-cdn.microsoft.io/python?restype=container&comp=list&include=metadata&marker=&
2023-11-25 02:39:30.1490|TRACE|System.Net.Http.HttpClient.general.LogicalHandler|Request Headers:
User-Agent: oryx/1.0

2023-11-25 02:39:30.1877|INFO|System.Net.Http.HttpClient.general.ClientHandler|Sending HTTP request GET https://oryx-cdn.microsoft.io/python?restype=container&comp=list&include=metadata&marker=&
2023-11-25 02:39:30.1877|TRACE|System.Net.Http.HttpClient.general.ClientHandler|Request Headers:
User-Agent: oryx/1.0

2023-11-25 02:39:32.0079|INFO|System.Net.Http.HttpClient.general.ClientHandler|Received HTTP response headers after 1773.4759ms - 200
2023-11-25 02:39:32.0079|TRACE|System.Net.Http.HttpClient.general.ClientHandler|Response Headers:
Date: Sat, 25 Nov 2023 02:39:31 GMT
Transfer-Encoding: chunked
Connection: keep-alive
x-ms-request-id: 229682f4-e01e-0004-3748-1f855a000000
x-ms-version: 2009-09-19
x-azure-ref: 20231125T023930Z-5r19zpufdx7pz0p80uhsd2665w0000000d20000000032akb
X-Cache: CONFIG_NOCACHE
Content-Type: application/xml

2023-11-25 02:39:32.0490|INFO|System.Net.Http.HttpClient.general.LogicalHandler|End processing HTTP request after 1974.8346ms - 200
2023-11-25 02:39:32.0490|TRACE|System.Net.Http.HttpClient.general.LogicalHandler|Response Headers:
Date: Sat, 25 Nov 2023 02:39:31 GMT
Transfer-Encoding: chunked
Connection: keep-alive
x-ms-request-id: 229682f4-e01e-0004-3748-1f855a000000
x-ms-version: 2009-09-19
x-azure-ref: 20231125T023930Z-5r19zpufdx7pz0p80uhsd2665w0000000d20000000032akb
X-Cache: CONFIG_NOCACHE
Content-Type: application/xml

2023-11-25 02:39:32.1085|INFO|System.Net.Http.HttpClient.general.LogicalHandler|Start processing HTTP request GET https://oryx-cdn.microsoft.io/python?restype=container&comp=list&include=metadata&marker=&
2023-11-25 02:39:32.1085|TRACE|System.Net.Http.HttpClient.general.LogicalHandler|Request Headers:
User-Agent: oryx/1.0

2023-11-25 02:39:32.1085|INFO|System.Net.Http.HttpClient.general.ClientHandler|Sending HTTP request GET https://oryx-cdn.microsoft.io/python?restype=container&comp=list&include=metadata&marker=&
2023-11-25 02:39:32.1085|TRACE|System.Net.Http.HttpClient.general.ClientHandler|Request Headers:
User-Agent: oryx/1.0

2023-11-25 02:39:32.5726|INFO|System.Net.Http.HttpClient.general.ClientHandler|Received HTTP response headers after 463.3237ms - 200
2023-11-25 02:39:32.5726|TRACE|System.Net.Http.HttpClient.general.ClientHandler|Response Headers:
Date: Sat, 25 Nov 2023 02:39:32 GMT
Transfer-Encoding: chunked
Connection: keep-alive
x-ms-request-id: 2296844e-e01e-0004-7148-1f855a000000
x-ms-version: 2009-09-19
x-azure-ref: 20231125T023932Z-5r19zpufdx7pz0p80uhsd2665w0000000d20000000032az7
X-Cache: CONFIG_NOCACHE
Content-Type: application/xml

2023-11-25 02:39:32.5726|INFO|System.Net.Http.HttpClient.general.LogicalHandler|End processing HTTP request after 464.6624ms - 200
2023-11-25 02:39:32.5726|TRACE|System.Net.Http.HttpClient.general.LogicalHandler|Response Headers:
Date: Sat, 25 Nov 2023 02:39:32 GMT
Transfer-Encoding: chunked
Connection: keep-alive
x-ms-request-id: 2296844e-e01e-0004-7148-1f855a000000
x-ms-version: 2009-09-19
x-azure-ref: 20231125T023932Z-5r19zpufdx7pz0p80uhsd2665w0000000d20000000032az7
X-Cache: CONFIG_NOCACHE
Content-Type: application/xml

2023-11-25 02:39:32.6081|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonSdkStorageVersionProvider|Getting the default version from url https://oryx-cdn.microsoft.io/python/defaultVersion.bullseye.txt.
2023-11-25 02:39:32.6081|INFO|System.Net.Http.HttpClient.general.LogicalHandler|Start processing HTTP request GET https://oryx-cdn.microsoft.io/python/defaultVersion.bullseye.txt
2023-11-25 02:39:32.6081|TRACE|System.Net.Http.HttpClient.general.LogicalHandler|Request Headers:
User-Agent: oryx/1.0

2023-11-25 02:39:32.6081|INFO|System.Net.Http.HttpClient.general.ClientHandler|Sending HTTP request GET https://oryx-cdn.microsoft.io/python/defaultVersion.bullseye.txt
2023-11-25 02:39:32.6081|TRACE|System.Net.Http.HttpClient.general.ClientHandler|Request Headers:
User-Agent: oryx/1.0

2023-11-25 02:39:32.6262|INFO|System.Net.Http.HttpClient.general.ClientHandler|Received HTTP response headers after 17.6523ms - 200
2023-11-25 02:39:32.6267|TRACE|System.Net.Http.HttpClient.general.ClientHandler|Response Headers:
Date: Sat, 25 Nov 2023 02:39:32 GMT
Connection: keep-alive
ETag: 0x8DBE5409B87EDB9
x-ms-request-id: a5f9c516-801e-004f-1f4e-197909000000
x-ms-version: 2009-09-19
x-ms-meta-Branch: add-new-python-versions-2023-11-02
x-ms-meta-Buildnumber: 20231102.4
x-ms-meta-Checksum: 67c9d6451af9c2a2b930090cb94b4b174eccaa62131e42323ac279f5b6bdcfb850fa241256dca1c6bcd94a4fad114a3d1050bb610bbee5293a9b0b9572d63c70
x-ms-meta-Commit: b1894b18f583b639667c82645126310d46235dae
x-ms-lease-status: unlocked
x-ms-blob-type: BlockBlob
x-azure-ref: 20231125T023932Z-5r19zpufdx7pz0p80uhsd2665w0000000d20000000032b44
X-Cache: TCP_HIT
Accept-Ranges: bytes
Content-Type: text/plain
Content-Length: 4
Last-Modified: Tue, 14 Nov 2023 18:36:25 GMT

2023-11-25 02:39:32.6267|INFO|System.Net.Http.HttpClient.general.LogicalHandler|End processing HTTP request after 18.4726ms - 200
2023-11-25 02:39:32.6267|TRACE|System.Net.Http.HttpClient.general.LogicalHandler|Response Headers:
Date: Sat, 25 Nov 2023 02:39:32 GMT
Connection: keep-alive
ETag: 0x8DBE5409B87EDB9
x-ms-request-id: a5f9c516-801e-004f-1f4e-197909000000
x-ms-version: 2009-09-19
x-ms-meta-Branch: add-new-python-versions-2023-11-02
x-ms-meta-Buildnumber: 20231102.4
x-ms-meta-Checksum: 67c9d6451af9c2a2b930090cb94b4b174eccaa62131e42323ac279f5b6bdcfb850fa241256dca1c6bcd94a4fad114a3d1050bb610bbee5293a9b0b9572d63c70
x-ms-meta-Commit: b1894b18f583b639667c82645126310d46235dae
x-ms-lease-status: unlocked
x-ms-blob-type: BlockBlob
x-azure-ref: 20231125T023932Z-5r19zpufdx7pz0p80uhsd2665w0000000d20000000032b44
X-Cache: TCP_HIT
Accept-Ranges: bytes
Content-Type: text/plain
Content-Length: 4
Last-Modified: Tue, 14 Nov 2023 18:36:25 GMT

2023-11-25 02:39:32.6267|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonSdkStorageVersionProvider|Got the default version for python as 3.8.
2023-11-25 02:39:32.6984|DEBUG|Microsoft.Oryx.Detector.DotNetCore.ExplicitProjectFileProvider|No request to build a particular project file explicitly using the PROJECT environment variable
2023-11-25 02:39:32.7153|DEBUG|Microsoft.Oryx.Detector.DotNetCore.ProbeAndFindProjectFileProvider|Could not find any files with extension 'csproj' in repo.
2023-11-25 02:39:32.7153|DEBUG|Microsoft.Oryx.Detector.DotNetCore.ProbeAndFindProjectFileProvider|Could not find any files with extension 'fsproj' in repo.
2023-11-25 02:39:32.7153|DEBUG|Microsoft.Oryx.Detector.Php.PhpDetector|File 'composer.json' does not exist in source repo
2023-11-25 02:39:32.7252|INFO|Microsoft.Oryx.Detector.Php.PhpDetector|Could not find any file with extension '*.php' in the repo.
2023-11-25 02:39:32.7269|DEBUG|Microsoft.Oryx.Detector.Ruby.RubyDetector|Could not find Gemfile in repo
2023-11-25 02:39:32.7269|DEBUG|Microsoft.Oryx.Detector.Ruby.RubyDetector|Could not find typical Ruby files in repo
2023-11-25 02:39:32.7269|DEBUG|Microsoft.Oryx.Detector.Ruby.RubyDetector|App in repo is not a Ruby app
2023-11-25 02:39:32.7269|ERROR|Microsoft.Oryx.Detector.Golang.GolangDetector|Could not find go.mod in repo
2023-11-25 02:39:32.7372|DEBUG|Microsoft.Oryx.Detector.Java.JavaDetector|Could not find any files with the following extensions in the repo: java, jsp
2023-11-25 02:39:32.7463|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatform|Dynamic install is enabled.
2023-11-25 02:39:32.7560|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatformInstaller|Version 3.12.0 was not found to be installed at /opt/python/ or /tmp/oryx/platforms/python
2023-11-25 02:39:32.7560|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatform|Python version 3.12.0 is not installed. So generating an installation script snippet for it.
2023-11-25 02:39:32.7653|INFO|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|If python is not set as environment, it'll be set to 3.12.0 via benv
2023-11-25 02:39:32.7752|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultCompatiblePlatformDetector|Detected platform 'python' with version '3.12.0'.
2023-11-25 02:39:32.7829|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Repo is clean for python
2023-11-25 02:39:32.7829|INFO|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatform|context buildcommandsfilename: oryx-build-commands.txt
2023-11-25 02:39:32.7829|INFO|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatform|common option buildcommandsfilename: oryx-build-commands.txt
2023-11-25 02:39:32.7829|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatform|Selected Python version: 3.12.0
2023-11-25 02:39:32.7829|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonPlatform|Using virtual environment antenv, module venv
2023-11-25 02:39:33.2374|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Platform python with version 3.12.0 was used.
2023-11-25 02:39:33.2374|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Running checkers
2023-11-25 02:39:33.2464|INFO|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Running 1 applicable checkers for 1 tools: python
2023-11-25 02:39:33.2464|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonVersionChecker|SemanticVersionResolver.CompareVersions returned 1
2023-11-25 02:39:33.2464|DEBUG|Microsoft.Oryx.BuildScriptGenerator.Python.PythonVersionChecker|SemanticVersionResolver.CompareVersions returned 1
2023-11-25 02:39:33.2753|INFO|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Build Property Key:PlatformName value: python is written into manifest
2023-11-25 02:39:33.2753|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|Path to appsvc.yaml /tmp/zipdeploy/extracted/appsvc.yaml
2023-11-25 02:39:33.2753|DEBUG|Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator|No appsvc.yaml found
2023-11-25 02:39:33.3229|DEBUG|Microsoft.Oryx.BuildScriptGeneratorCli.BuildCommand|No checker messages emitted
```
</details>

:::note info
oryx-cdn.microsoft.io について
nslookup を用いることで Azure FrontDoor と TrafficManager が利用されていることが推測できます。
https://github.com/microsoft/Oryx/issues/1585
:::


### リモートビルドの成果物

リモートビルドをした結果どのような状況になるのかを確認します。
Kudu FileManager から確認すると `/home/site/wwwroot` 配下には以下の 3 つのファイルが生成されています。

 - `.ostype`
 - `oryx-manifest.toml`
 - `output.tar.gz`

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/4914/d18a1556-473d-1ccf-79f3-e39523aa1d11.png)


長くなったので、いったんここまで。
次回は、アプリケーションコンテナ起動時に上記の 3 つのファイルがどう扱われているかを書きます。

https://qiita.com/georgeOsdDev@github/items/d4f31dfa5bd1de362dd6