az webapp identity assign でマネージドIDを有効化→ az role assignment create で当該IDにロール付与→ Web AppのApp Settingsに @Microsoft.KeyVault(SecretUri=...) を設定すると、シークレットが展開される(ただし、権限不足やロール割り当ての待ち時間などで即時に反映されないケースがある)。
>An existing resource with ID '...kouchou-ai-openai' has been soft-deleted. To restore the resource, you must specify 'restore' to be 'true' in the property. If you don't want to restore existing resource, please purge it first.
>WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
そりゃそうだ
>pydantic_core._pydantic_core.ValidationError: 2 validation errors for Settings
Could not connect to the registry login server 'kouchouaiacr.azurecr.io'. Please verify that the registry exists and the URL 'https://kouchouaiacr.azurecr.io/v2/' is reachable from your environment.
Try running 'az acr check-health -n kouchouaiacr --yes' to diagnose this issue.
%az acr check-health -n kouchouaiacr --yes
Docker daemon status: available
Docker version: 'Docker version 20.10.22, build 42c8b31, platform linux/arm64'
Docker pull of 'mcr.microsoft.com/mcr/hello-world:latest' : OK
Azure CLI version: 2.70.0
2025-03-17 08:23:50.591717 An error occurred: CONNECTIVITY_DNS_ERROR
Failed to reach DNS for registry 'kouchouaiacr.azurecr.io'. Please check if the spelling is correct, if the CLI environment is on correct cloud and your network connectivity.
2025-03-17T08:52:06 Welcome, you are now connected to log-streaming service.Starting Log Tail -n 10 of existing logs ----/appsvctmp/volatile/logs/runtime/container.log
2025-03-17T08:51:15.3231533Z Configure Services : 08.51.15.322864
2025-03-17T08:51:16.7442581Z Configure : 08.51.16.743970
2025-03-17T08:51:17.6208151Z Setting Up Routes : 08.51.17.620555
2025-03-17T08:51:18.2362864Z Exiting Configure : 08.51.18.236021
2025-03-17T08:51:18.6132403Z [40m[1m[33mwarn[39m[22m[49m: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
2025-03-17T08:51:18.6133451Z No XML encryptor configured. Key {fdf3c2ce-05ea-4c38-a6ba-9cffe3df9d1b} may be persisted to storage in unencrypted form.
2025-03-17T08:51:18.8348701Z Hosting environment: Production
2025-03-17T08:51:18.8359212Z Content root path: /opt/Kudu
2025-03-17T08:51:18.8533469Z Now listening on: http://0.0.0.0:8181
2025-03-17T08:51:18.8534039Z Application started. Press Ctrl+C to shut down.Ending Log Tail of existing logs ---Starting Live Log Stream ---
2025-03-17T08:53:06 No new trace in the past 1 min(s).
2025-03-17T08:53:50.5848228Z
2025-03-17T08:53:50.7628783Z > kouchou-ai-client-admin@0.1.0 start
2025-03-17T08:53:50.7629743Z > next start -p 4000
2025-03-17T08:53:50.7629784Z
2025-03-17T08:53:54.5458289Z ▲ Next.js 15.1.6
2025-03-17T08:53:54.5460079Z - Local: http://localhost:4000
2025-03-17T08:53:54.5460176Z - Network: http://169.254.132.3:4000
2025-03-17T08:53:54.5460215Z
2025-03-17T08:53:54.5460243Z ✓ Starting...
2025-03-17T08:53:56.3796807Z ✓ Ready in 3.9s
2025-03-17T08:55:06 No new trace in the past 1 min(s).
client
2025-03-17T08:48:53 Welcome, you are now connected to log-streaming service.Starting Log Tail -n 10 of existing logs ----/home/LogFiles/__lastCheckTime.txt (https://kouchou-ai-client.scm.azurewebsites.net/api/vfs/LogFiles/__lastCheckTime.txt)03/17/2025 08:47:13/home/LogFiles/kudu/trace/c2a2216e2cb4-c522ab4a-31c3-44b4-8dae-bd0dd87d61cf.txt (https://kouchou-ai-client.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/c2a2216e2cb4-c522ab4a-31c3-44b4-8dae-bd0dd87d61cf.txt)
2025-03-17T08:48:52 Startup Request, url: /api/logstream/, method: GET, type: request, pid: 776,1,5, ScmType: None/home/LogFiles/2025_03_17_lw1sdlwk000C43_default_docker.log (https://kouchou-ai-client.scm.azurewebsites.net/api/vfs/LogFiles/2025_03_17_lw1sdlwk000C43_default_docker.log)
2025-03-17T08:44:56.888979144Z
2025-03-17T08:44:56.889594374Z > kouchou-ai-client@0.1.0 build
2025-03-17T08:44:56.889598946Z > next build
2025-03-17T08:44:56.889601478Z
2025-03-17T08:45:09.723432943Z ??? Next.js 15.1.6
2025-03-17T08:45:09.743210166Z
2025-03-17T08:45:09.834319984Z Creating an optimized production build .../home/LogFiles/2025_03_17_lw1sdlwk000C43_docker.log (https://kouchou-ai-client.scm.azurewebsites.net/api/vfs/LogFiles/2025_03_17_lw1sdlwk000C43_docker.log)
2025-03-17T08:46:31.303Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 100.3545987 sec
2025-03-17T08:46:48.895Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 117.9464186 sec
2025-03-17T08:47:05.550Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 134.6007097 sec
2025-03-17T08:47:27.022Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 156.0733663 sec
2025-03-17T08:47:49.023Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 178.0737392 sec
2025-03-17T08:48:14.332Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 203.3826478 sec
2025-03-17T08:48:31.846Z INFO - Waiting for response to warmup request for container kouchou-ai-client_0_4abf5642. Elapsed time = 220.8968595 sec
2025-03-17T08:48:42.925Z ERROR - Container kouchou-ai-client_0_4abf5642 for site kouchou-ai-client did not start within expected time limit. Elapsed time = 231.948246 sec
2025-03-17T08:48:43.097Z ERROR - Container kouchou-ai-client_0_4abf5642 didn't respond to HTTP pings on port: 3000, failing site start. See container logs for debugging.
2025-03-17T08:48:43.347Z INFO - Stopping site kouchou-ai-client because it failed during startup.Ending Log Tail of existing logs ---Starting Live Log Stream ---
2025-03-17T08:49:54 No new trace in the past 1 min(s).
>Attaching to kouchou-ai-api-1, kouchou-ai-client-1, kouchou-ai-client-admin-1
> Error response from daemon: driver failed programming external connectivity on endpoint kouchou-ai-api-1 (0ad5b0eeabca84ef698349ed3093339034298f7711c03d847781b61a2b7a55d4): Bind for 0.0.0.0:8000 failed: port is already allocated