feat(azure.ai.agents): update digital worker contracts - #9789
Conversation
Use the service-side m365 classification for deployment and publishing, adopt the updated Microsoft 365 publish body, and expose optional permission scopes and developer access boundaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 94d6462f-4a98-46bc-a96e-c6a6e0282d95
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 94d6462f-4a98-46bc-a96e-c6a6e0282d95
Scope the DigitalWorker preview feature to Digital Worker requests, validate Digital Worker-only publish fields in schema, and use BotServiceTenant for Digital Worker activity endpoints. Digital Worker deploy now declares digital_worker_type=m365, so the endpoint authorization scheme must also use the tenant-based Digital Worker path. Leaving BotServiceRbac on the endpoint causes the runtime to call Azure Authorization checkaccess during user conversations, which fails for Agent 365 instances.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 20 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Aligns Digital Worker deployment and Microsoft 365 publishing with the service-side m365 contract.
Changes:
- Selects tenant authorization for Digital Worker endpoints.
- Adds service-side type reconciliation and preview headers.
- Adds permission-scope/access-boundary configuration, flags, validation, and tests.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
schemas/azure.ai.agent.json |
Updates Digital Worker schema. |
README.md |
Documents configuration and flags. |
internal/project/service_target_agent.go |
Updates deployment and endpoint authorization. |
internal/project/service_target_agent_test.go |
Tests endpoint authorization selection. |
internal/project/doc_examples_test.go |
Tests documented schema fields. |
internal/project/config.go |
Adds publish configuration types. |
internal/project/activity_profile.go |
Reconciles and validates Digital Worker profiles. |
internal/project/activity_profile_test.go |
Tests profile resolution and validation. |
internal/pkg/agents/agent_api/operations.go |
Scopes preview headers to API operations. |
internal/pkg/agents/agent_api/operations_test.go |
Tests request headers and payloads. |
internal/pkg/agents/agent_api/models.go |
Adds Digital Worker API fields. |
internal/pkg/agents/agent_api/models_test.go |
Tests model serialization. |
internal/pkg/agents/agent_api/microsoft365.go |
Updates Microsoft 365 request contract. |
internal/pkg/agents/agent_api/microsoft365_test.go |
Tests publish contract and tri-state boundaries. |
internal/cmd/teams_pack.go |
Uses deployed service classification. |
internal/cmd/teams_pack_test.go |
Tests Digital Worker package requests. |
internal/cmd/publish.go |
Adds publish flags and input resolution. |
internal/cmd/publish_test.go |
Tests new publish inputs. |
internal/cmd/listen_activity_test.go |
Updates Digital Worker fixtures. |
CHANGELOG.md |
Adds the change to release history. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.
Suppressed comments (3)
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go:1569
ResolveDeployedActivityProfilecan promote a locally simple Activity agent todigital_workerfrom the service response, butresult.request.AgentEndpointstill contains theBotServiceRbacscheme chosen earlier from local configuration. The subsequent patch therefore restores RBAC on a service-classified M365 worker and reproduces thecheckaccessfailure this change targets. Reconcile the endpoint scheme from the resolved profile before patching it.
activityProfile, err = ResolveDeployedActivityProfile(activityProfile, deployedVersion.DigitalWorkerType)
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go:3060
- Clearing
DigitalWorkerTypemakes migration impossible for an existing code-deployed agent created under the old contract. Such an agent has no service-side type; this update omits the only new classification field, and the post-deploy reconciliation then fails on the still-empty type. Retryingazd deployrepeats the same update path, so either update the classification through a supported API or fail before upload with an actionable delete/recreate migration.
updateVersionRequest.DigitalWorkerType = ""
cli/azd/extensions/azure.ai.agents/CHANGELOG.md:7
- This adds the open PR to the already released
1.0.0-beta.13 (2026-08-27)section, making release history claim the change shipped before it merged. Percli/azd/AGENTS.md:253-259and this extension's release process incli/azd/extensions/azure.ai.agents/AGENTS.md:164-172, defer this entry to the release/version-bump PR.
- [[#9776]](https://github.com/Azure/azure-dev/pull/9776) Update Digital Worker agent and Microsoft 365 publish contracts with service-side type detection, optional permission scopes, and access boundaries.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
cli/azd/extensions/azure.ai.agents/internal/cmd/publish.go:228
- Configured boundaries are validated after trimming, but this copy preserves the original whitespace and sends it to Microsoft 365. For example,
" read.1on1.developers "passes runtime validation and then produces an unsupported wire value. Normalize these values just like permission scopes and CLI boundary values.
if publish.AccessBoundaries != nil {
values := make([]string, len(*publish.AccessBoundaries))
copy(values, *publish.AccessBoundaries)
boundaries = &values
cli/azd/extensions/azure.ai.agents/internal/project/direct_deploy.go:309
- A deployed Digital Worker can resolve to an Activity profile while the local standalone definition leaves
agentEndpointunset. This call then no-ops, so the deployedBotServiceRbacendpoint is never corrected toBotServiceTenant. Fall back to the endpoint returned byGetAgentbefore normalizing it, preserving its other protocols and schemes.
EnsureActivityEndpointAuthSchemeForProfile(request.AgentEndpoint, resolvedProfile)
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
Replace activity.useCase with activity.digitalWorkerType in azure.yaml. Omitted values retain simple Activity behavior, while m365 maps to the service digital_worker_type contract. Reject the removed field to prevent silent fallback. Authored-by: GitHub Copilot for VS Code Model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reject Digital Worker-only permission scopes and access boundaries when digitalWorkerType is omitted, including explicitly empty arrays, so runtime validation matches the schema. Authored-by: GitHub Copilot for VS Code Model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Always read and reconcile the deployed Digital Worker classification for existing standalone agents. Normalize configured access boundaries before sending the Microsoft 365 publish request. Authored-by: GitHub Copilot for VS Code Model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate Activity classification from Digital Worker publish validation so publish flags can replace invalid configured values. Keep eager validation on deploy paths and cover the full publish resolution order. Authored-by: GitHub Copilot for VS Code Model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Standalone reconciliation can leave legacy authorization unchanged when no local endpoint exists, and one immutable-type recovery message recommends an ineffective redeploy.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go:1577
digital_worker_typeis immutable for container agents too, so a normal redeploy cannot resolve this mismatch; it only creates another version and the next reconciliation will fail again. Give the same delete/recreate guidance used by both update paths.
- Files reviewed: 33/33 changed files
- Comments generated: 1
- Review effort level: Balanced
Create a missing standalone endpoint before applying the deployed Digital Worker authorization profile. Direct all immutable digital worker type mismatches to delete and recreate the agent instead of retrying deployment. Authored-by: GitHub Copilot for VS Code Model: GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
YAML permission scopes are not grouped by resource application, and create/update reconciliation lacks direct coverage.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
cli/azd/extensions/azure.ai.agents/internal/cmd/publish.go:213
- Configured permission scopes are copied one entry at a time, so repeated
resourceAppIdvalues inazure.yamlproduce multiple payload entries for the same resource. The new contract requires scopes to be grouped by resource application, and the flag path already performs that grouping. Merge scopes by trimmed resource app ID here, or reject duplicate resource IDs during validation.
cli/azd/extensions/azure.ai.agents/internal/project/service_target_agent.go:3521 - The create/update reconciliation branch has no direct test coverage. Add transport-backed tests that verify a 404 retains
DigitalWorkerTypefor creation, an existing matching agent clears the immutable field for version updates, mismatches are rejected, and non-404 failures propagate; otherwise regressions can silently drop classification on create or resend it on update.
- Files reviewed: 33/33 changed files
- Comments generated: 0 new
- Review effort level: Balanced
azure.ai.agents PR buildNote This is an unsigned development build. Install it only if you trust this PR. Install the extension: azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/9789/azure-ai-agents.zip"
|
Summary
Updates the
azure.ai.agentsextension to support the latest Digital Worker agent and Microsoft 365 publish contracts.activity.digitalWorkerType: m365inazure.yaml, mapped to the service-sidedigital_worker_type=m365contract, and reconciles it with the deployed immutable type.DigitalWorker=V1Previewfeature to the agent operations that require the Digital Worker contract.optionalPermissionScopesandaccessBoundaries.azure.yamlschema/runtime validation andazd ai agent publishflags for permission scopes, access boundaries, and explicit boundary clearing.BotServiceTenantfor Digital Worker Activity endpoints while preservingBotServiceRbacfor simple Activity agents.Why
The previous flow relied on the legacy Microsoft 365 publish payload (
publishAsAutopilotand agentic-user-template fields) to identify and configure a Digital Worker. The updated service contract moves Digital Worker classification to the agent resource and exposes permission scopes and access boundaries directly in the publish request.The extension must treat that classification consistently throughout the lifecycle. In particular, leaving the Activity endpoint on the simple-agent
BotServiceRbacscheme after declaringdigital_worker_type=m365causes Agent 365 conversations to enter the Azure RBACcheckaccesspath and fail withMISE12042 / AzureAuthorizationModule / BadRequest. A live sample confirmed that changing the endpoint toBotServiceTenantrestores conversations.Contract changes
Agent deploy and discovery
digital_worker_typeon agent/version models.activity.digitalWorkerType: m365fromazure.yamlto the service-sidedigital_worker_type=m365contract.BotServiceTenantfor Digital Workers andBotServiceRbacfor simple Activity agents.Microsoft 365 publish
useAgenticUserTemplateandagenticUserTemplatefields.azure.yamlvalues.Configuration schema
For a Microsoft 365 Digital Worker, set
activity.digitalWorkerTypetom365:For a simple Activity agent, omit
digitalWorkerType:The schema accepts only
m365whendigitalWorkerTypeis present. An omitted value selects simple mode. The removedactivity.useCasefield is rejected by both schema and runtime validation so an existing Digital Worker configuration cannot silently fall back to simple mode.Validation
The endpoint authorization behavior was also validated with a deployed Digital Worker sample:
BotServiceRbacreproduced the conversation-time Azure Authorization failure, whileBotServiceTenantallowed conversations to proceed.Fixes #9790