[Issue] azd deploy fails with "multiple Azure Bots are bound to the same MsaAppID" because botServices list API returns duplicate entries
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #10367 de @mvanhorn — cerrado sin fusionar
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
Línea de trabajo
Busca en el código base el mensaje de error 'Resolving Activity bot configuration' para localizar el código que gestiona el servicio del bot. Añade la eliminación de duplicados de la lista botServices por ID de recurso (sin distinguir entre mayúsculas y minúsculas) antes de la comprobación de MsaAppID. Verifica la corrección ejecutando las pruebas pertinentes del servicio del bot o reproduciendo el escenario de deploy.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- 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.
- Lenguaje dominante
- Go
- Estrellas
- 573
- Forks
- 387
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 196
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/azure-dev
-
bug customer-reported ext-agents
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area/docs area/environment area/public-docs engineering item
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Bundle the evaluations and dataset extensions in the Foundry meta-packageQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Map invocation lifecycle files to CLI regression scenariosQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoarea/docs engineering item ext-agents test automation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
enhancement ext-agents
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
Todos los issues de Azure/azure-dev
Issues similares
-
0.kind: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
automated-triage type/bug type/ci
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
hashicorp/terraform-provider-google#30678 ·
Los mantenedores suelen responder en 1 día
-
effort:s impact:low raised-by:worker risk:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
medici-finance/assay#6323 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
ethereum-optimism/optimism#24120 ·
Los mantenedores suelen responder en 1 día