Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug: Cognitive Services OpenAI User role not assigned to managed identity — 401 on all chat completions

未关闭
#23 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
azure

调研方向

定位用于设置容器应用系统分配的托管标识和 AZURE_OPENAI_AUTH=managed-identity 的 Bicep 配置;首先跟踪 Azure OpenAI 资源和容器应用的依赖关系。添加 Cognitive Services OpenAI User 角色分配,并按要求进行排序,然后验证已部署的应用在 RBAC 传播后可以完成聊天请求。

由索引模型根据 Issue 内容生成。

描述

Summary

After a successful devclaw up / devclaw deploy, the container starts and the gateway reports ready — but every chat message fails with a 401. The container app's managed identity is never granted the Cognitive Services OpenAI User role on the Azure OpenAI resource.

Error seen in container logs

[agent/embedded] embedded run agent end: isError=true model=gpt-5.4-mini
error=LLM request failed. rawError=401 The principal `<principalId>` lacks
the required data action `Microsoft.CognitiveServices/accounts/OpenAI/
deployments/chat/completions/action` to perform
`POST /openai/v1/chat/completions` operation.

Steps to reproduce

  1. Complete devclaw up (even successfully)
  2. Open the WebChat UI — gateway shows Online, model shows gpt-5.4-mini
  3. Send any message
  4. Assistant returns [assistant turn failed before producing content]
  5. Container logs show 401 on every /openai/v1/chat/completions call

Root cause

Same pattern as the AcrPull gap. Bicep configures the container app to use AZURE_OPENAI_AUTH=managed-identity but does not create the Cognitive Services OpenAI User role assignment on the Azure OpenAI resource for the container app's principalId. The gateway has no API key to fall back to (by design), so every model call fails.

Expected behaviour

Bicep should create a Cognitive Services OpenAI User role assignment on the Azure OpenAI resource for the container app's system-assigned managed identity, with correct dependsOn so it is in place before the first request.

Manual workaround

PRINCIPAL_ID=$(az containerapp show -n <app> -g <rg> --query 'identity.principalId' -o tsv)
OPENAI_ID=$(az cognitiveservices account list -g <rg> --query '[0].id' -o tsv)
az role assignment create \
  --assignee-object-id $PRINCIPAL_ID \
  --assignee-principal-type ServicePrincipal \
  --role "Cognitive Services OpenAI User" \
  --scope $OPENAI_ID

Note: RBAC propagation takes ~90 seconds after assignment. The gateway does not need to be restarted.

Related

Same root cause as #22 (AcrPull not assigned). Both point to Bicep RBAC sequencing gaps that surface when azd up exits before full propagation.

Environment

  • Region: southindia
  • Restricted corporate subscription with Azure Policy assignments active
主要语言
Shell
星标
25
派生
3
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/openclaw-dev 的其他 Issue

查看 microsoft/openclaw-dev 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。