[Issue] azd deploy fails with "multiple Azure Bots are bound to the same MsaAppID" because botServices list API returns duplicate entries
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #10367 của @mvanhorn — đã đóng, không merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 70/100
Hướng nghiên cứu
Tìm kiếm trong codebase thông báo lỗi 'Resolving Activity bot configuration' để xác định đoạn mã xử lý dịch vụ bot. Thêm bước loại bỏ trùng lặp trong danh sách botServices theo ID tài nguyên (không phân biệt chữ hoa chữ thường) trước khi kiểm tra MsaAppID. Xác minh bản sửa bằng cách chạy các bài kiểm thử dịch vụ bot liên quan hoặc tái hiện tình huống deploy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Make sure you've installed the latest version using instructions
Output from azd version
azd version 1.35.0 (commit 170ebb858071da353cc9bf8657a377bff268ba36) (stable)
Extension: azure.ai.agents 1.0.0-beta.18 (also reproduced with azd 1.34.2 + azure.ai.agents 1.0.0-beta.17)
Describe the bug
azd deploy for a hosted agent with the Activity protocol always fails in the step "Resolving Activity bot configuration":
ERROR: botservice: multiple Azure Bots are bound to the same MsaAppID
Suggestion: keep only one Azure Bot bound to this MsaAppID, then retry
Only one Azure Bot is bound to that MsaAppID. The cause appears to be that the Bot Service list endpoint returns every bot twice, and the extension does not deduplicate the results by resource ID before the MsaAppID check.
-
Only one bot uses the MsaAppID (Resource Graph). This query returns
count: 1; all other bots in the subscription have different MsaAppIDs:resources | where type =~ 'microsoft.botservice/botservices' | where tolower(tostring(properties.msaAppId)) == '<agent-instance-identity-client-id>' -
The botServices list API returns every bot twice:
az rest --method get --url "https://management.azure.com/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.BotService/botServices?api-version=2022-09-15"- Result: 2N entries for N distinct resource IDs. Every bot in the resource group appears twice with an identical
idandetag, not only the agent's bot. - The subscription-level list (
/subscriptions/<sub>/providers/Microsoft.BotService/botServices) behaves the same way. - It happens with all available api-versions:
2017-12-01,2018-07-12,2020-06-02,2021-03-01,2021-05-01-preview,2022-06-15-preview,2022-09-15,2023-09-15-preview. nextLinkis empty, so this is not a paging overlap.
Example (the agent's bot):
/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.BotService/botServices/<agent>-bot-xxxxxxxx | location=global | etag="<same-etag>" /subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.BotService/botServices/<agent>-bot-xxxxxxxx | location=global | etag="<same-etag>" - Result: 2N entries for N distinct resource IDs. Every bot in the resource group appears twice with an identical
-
Setting the bot name explicitly does not help. After
azd env set AGENT_<NAME>_BOT_NAME <existing-bot-name>(the existing azd-created bot), the deploy still fails with the same error.AGENT_<NAME>_BOT_OWNED=trueandAGENT_<NAME>_BOT_RESOURCE_GROUPwere already set.
The hosted agent itself is updated before the failure (new agent versions are created and become active), so in practice only the exit code is wrong. However, this breaks scripted/CI deploys, and there is no option to skip the bot step.
To Reproduce
- Deploy a hosted agent with protocols
responses+activityviaazd deploy(code deploy). The Azure Bot is created by azd on the first deploy (tagazd-created,kind: azurebot,location: global,msaAppType: SingleTenant). - Make sure the botServices list endpoint for the resource group/subscription returns duplicate entries (see the
az restcall above). - Run
azd deploy --no-promptagain. - The deploy fails at "Resolving Activity bot configuration" with
botservice: multiple Azure Bots are bound to the same MsaAppID.
Expected behavior
- The extension deduplicates the bot list by resource ID (case-insensitive) before counting bots bound to the MsaAppID, and the deploy succeeds by reusing the existing bot.
- Optionally, a way to skip Activity bot resolution on deploy when the bot already exists (e.g.
AZD_AGENT_SKIP_BOT=true), similar toAZD_AGENT_SKIP_ACR/AZD_AGENT_SKIP_ROLE_ASSIGNMENTS.
Environment
Information on your environment:
* Language name and version: Python 3.13 (hosted agent runtime python_3_13, code deploy with remote_build)
* IDE and version: N/A, azd run from PowerShell on Windows
Additional context
- The duplicate list entries are probably also a Bot Service API issue. I'm reporting it here because the extension could easily be robust against it.
- The current suggestion ("keep only one Azure Bot bound to this MsaAppID" / "remove that Bot") points users toward deleting a production bot that is actually unique.
- Ngôn ngữ chính
- Go
- Star
- 573
- Fork
- 387
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 196
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-dev
-
bug customer-reported ext-agents
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/docs area/environment area/public-docs engineering item
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bundle the evaluations and dataset extensions in the Foundry meta-packageCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Map invocation lifecycle files to CLI regression scenariosCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởarea/docs engineering item ext-agents test automation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ext-agents
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Azure/azure-dev
Issue tương tự
-
0.kind: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated-triage type/bug type/ci
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
hashicorp/terraform-provider-google#30678 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:s impact:low raised-by:worker risk:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
medici-finance/assay#6323 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
ethereum-optimism/optimism#24120 ·
Maintainer thường phản hồi trong vòng 1 ngày