[azure.ai.agents] azd up-generated Teams package ignores agentDisplayName
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
## Summary
The automatic `appPackage.zip` generated during `azd up` / `azd deploy` for a simple Activity agent ignores `activity.publish.agentDisplayName` from `azure.yaml`. It uses the deployed agent name for `manifest.json`'s `name.short` and `name.full` instead.
The generated package should use `activity.publish.agentDisplayName` by default, matching the explicit `azd ai agent pack` and `azd ai agent publish` paths, and fall back to the deployed agent name only when `agentDisplayName` is unset.
Related to #9333, which added automatic ready-to-sideload package generation during deploy.
## Environment
```text
azd: 1.31.2
azure.ai.agents: 1.0.0-beta.11
OS: Windows
```
## Reproduction
Use a simple Activity agent with a service key/name that differs from its intended Teams display name:
```yaml
services:
chief-of-staff:
host: azure.ai.agent
# ...
activity:
useCase: simple
publish:
publishScope: shared
appVersion: "1.0.0"
agentDisplayName: Chief of Staff
name: chief-of-staff
protocols:
- protocol: activity
version: 2.0.0
```
Run:
```powershell
azd up
```
Inspect the automatically generated `appPackage.zip`. The package has the azd ownership marker `.appPackage.zip.azd-generated`, confirming it came from the post-deploy hook.
## Actual behavior
`manifest.json` contains:
```json
{
"name": {
"short": "chief-of-staff",
"full": "chief-of-staff"
}
}
```
## Expected behavior
`manifest.json` should contain:
```json
{
"name": {
"short": "Chief of Staff",
"full": "Chief of Staff"
}
}
```
Expected precedence should match the explicit pack/publish path:
1. Explicit CLI `--display-name`, where applicable
2. `activity.publish.agentDisplayName`
3. Deployed agent name
4. `Agent`
For automatic post-deploy packaging, there is no CLI override, so `activity.publish.agentDisplayName` should be used when configured.
## Source-level cause
The automatic post-deploy path calls `writeTeamsAppPackage` in:
```text
cli/azd/extensions/azure.ai.agents/internal/cmd/listen_activity.go
```
That function constructs `TeamsAppPackageRequest` with:
```go
AgentDisplayName: agentName,
```
It does not load or apply `activity.publish.agentDisplayName`.
By contrast, explicit `azd ai agent pack` and `azd ai agent publish` use `buildTeamsAppPackageRequest` in `teams_pack.go`, which correctly resolves `publish.AgentDisplayName` before falling back to `agentName`.
The automatic package path should reuse the same request builder/config resolution so generated packages are consistent with explicit pack and publish operations.
Contributor guide
Assessment
This issue has not been assessed yet.