Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug: AcrPull role not assigned to container app managed identity — image pull 401 on partial first deploy

オープン
#22 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
azure

調査の方向性

説明されている Azure 環境で devclaw up に続けて devclaw deploy を実行して失敗を再現し、その後、ACR とコンテナー アプリをプロビジョニングする Bicep リソースを調査します。マネージド ID、ACR スコープ、AcrPull ロールの割り当て、依存関係の順序を検証します。最初のデプロイが部分的に完了した後に deploy を実行すると、ACR 401 が発生せずにコンテナーが起動することを完了条件とします。

索引モデルが issue の本文から書いたものです。

説明

Summary

On a first devclaw up where the ACA revision activation times out (Operation expired), the container app's system-assigned managed identity never gets the AcrPull role on ACR. Subsequent devclaw deploy calls push the image successfully but the container fails to start with a persistent 401.

Error seen in container system logs

Failed to construct registry secret for registry 'acrXXXXX.azurecr.io'
Error: ACR token exchange endpoint returned error status: 401

Steps to reproduce

  1. Run devclaw up in a region/subscription where ACA revision activation times out on first run (e.g. southindia with a cold ACA environment, or any restricted corporate subscription)
  2. Provision completes (ACR ✓, OpenAI ✓, Storage ✓, ACA env ✓) but revision fails with Operation expired
  3. Run devclaw deploy — image is pushed to ACR but container immediately fails with ACR 401

Root cause

Bicep provisions ACR with adminUserEnabled: false (correct) and the container app is configured to pull via system-assigned managed identity — but the AcrPull role assignment on ACR for the container app's principalId is either missing or not yet propagated when the first revision activation is attempted. When the first azd up doesn't complete cleanly, this RBAC gap is never resolved.

Expected behaviour

Bicep should create an explicit AcrPull role assignment resource scoped to the ACR for the container app's managed identity, with correct dependsOn sequencing so the role is in place before the first revision is activated.

Manual workaround

PRINCIPAL_ID=$(az containerapp show -n <app> -g <rg> --query 'identity.principalId' -o tsv)
ACR_ID=$(az acr show -n <acr> -g <rg> --query 'id' -o tsv)
az role assignment create \
  --assignee-object-id $PRINCIPAL_ID \
  --assignee-principal-type ServicePrincipal \
  --role AcrPull \
  --scope $ACR_ID

Environment

  • Region: southindia
  • Restricted corporate subscription with Azure Policy assignments active
  • azd version: latest, az CLI: latest
主要言語
Shell
スター
25
フォーク
3
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/openclaw-dev のほかの issue

microsoft/openclaw-dev の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。