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 Pipelines: Azure DevOps で失敗だが、App Service では成功となってるときは、env: 入れれば回避出来る?

Last updated at Posted at 2024-07-09

背景

Azure Pipelines で デプロイした際に以下症状が発生した際の備忘録

  • 以下エラーが発生

    ERROR: failed deploying service 'backend': deploying service backend: Deployment failed because the runtime process failed. In progress instances: 0, Successful instances: 0, Failed Instances: 1
    Error: Deployment for site 'app-backend-{app name}' with DeploymentId '{DeploymentId}' failed because the worker proccess failed to start within the allotted time.
    Please check the runtime logs for more info: https://app-backend-aldu4ll5etr7a.scm.azurewebsites.net/api/logs/docker
    Trace ID: {Trace ID}

  • 16h ぐらいエラーにならず log 垂れ流し

    • 30 min で timeout 設定済

解決したかと思ったら、何故か再発。
yaml を元に戻しても同じなので、ネットワークなど別の原因なのかも・・ :sweat_smile:

現象調査

  • 以下のように、deployment Id で確認したところ
    • Azure DevOps では失敗
    • App Service では成功

ということで、Azure DevOps - Azure App Service との同期が上手くいっていない?

image.png

回避策

色々試してみたところ、Azure CLI task で、env: に以下を設定しておくと問題が起きない様子(100%なのか確証が持てない)

  • AZURE_SUBSCRIPTION_ID: デプロイ先の Subscription ID
  • AZD_AZURE_ENV_NAME: デプロイ時の azd env name. .azure/{azd env name}

どちらも、azd .env に保存されている筈

回避策
- task: AzureCLI@2
  env:
    AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
    AZURE_ENV_NAME: $(AZD_AZURE_ENV_NAME)

azd env は、以下構成。azd 実行環境で探せば見つかる。

.azure/{azd env name}/

  • .env
  • config.json

あとがき

env: で設定しているのは、az cli env であるので、deploy log などの取得時に利用しているのかもしれない

にしても、何故 AzureDeveloperCli task がないのか?

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?