Skip to content

Stop requesting Observability API permissions for blueprint agents by default - #501

Open
Krishnadheeraj (DheerajPannala) wants to merge 19 commits into
mainfrom
users/DheerajPannala/skip-observability-permissions
Open

Krishnadheeraj (DheerajPannala) wants to merge 19 commits into
mainfrom
users/DheerajPannala/skip-observability-permissions

Conversation

@DheerajPannala

@DheerajPannala Krishnadheeraj (DheerajPannala) commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge gate: hold this PR until the SDK 2.0.0 release containing microsoft/Agent365-nodejs#290 ships, and merge it together with microsoft/Agent365-Samples#339 and microsoft/agent365-skills#84. Until then the distros still default to the delegated route, so a new blueprint agent that doesn't opt in to S2S would lose telemetry.

Summary

a365 setup all no longer requests Observability API (Agent365.Observability.OtelWrite) permissions for blueprint agents in any auth mode, so those agents need no Observability admin consent. Registration becomes their only Observability authorization, so a failed or unverifiable registration now fails setup (exit 1).

This follows the 3P Dev Scale scrum decision to make the no-consent flow the main path rather than an opt-in flag. The PR originally added --skip-observability-permissions; that flag is gone.

Why

With microsoft/Agent365-nodejs#290 and microsoft/Agent365-Samples#339, agents export telemetry to the S2S endpoint with an app-only token for their own agent identity. The endpoint authorizes a token without OtelWrite when the agent is registered, which setup all already does for blueprint agents. Requesting OtelWrite (and its admin consent) is therefore unnecessary.

Validated live (dom97), sending through the real @microsoft/opentelemetry S2S exporter:

Agent identity Token Result
Registered, no role idtyp=app, roles=[], no scp 200, delivered to all sinks
Unregistered, no role same 403 insufficient_scope
Unregistered, OtelWrite role roles=[OtelWrite] 200

Behavior

  • Blueprint agents, every auth mode (obo, s2s, both) and every cloud: no Observability API in inheritable permissions, app-role grants, or admin consent URLs. The dry run and setup output say so. Registration is then the agent's only Observability authorization, so a registration failure is an error (exit 1).
  • --authmode s2s|both: still grant any other app-role specs (for example Defender, once Add Defender permissions part of "a365 setup all" #485 lands), but not OtelWrite; the S2S endpoint authorizes registered agents without it in every mode.
  • AI Teammate setup: unchanged. Instance creation in the admin center couldn't be validated end to end in the test tenant (it fails tenant-wide for unrelated agents too).
  • Registration: main (Add cloud-aware endpoints and harden GCC blueprint setup #478) already makes --agent-registration-only exit 1 when registration fails. This PR also exits 1 when an existing registration can't be verified, and for full setup of blueprint agents, including when a missing blueprint client secret prevents identity creation.
  • Re-running setup does not revoke permissions granted earlier.

Upgrade note

Agents on older SDKs that export through the delegated route need OtelWrite. The CHANGELOG upgrade note covers existing blueprints (Entra portal) and new ones (a365 setup permissions custom --resource-app-id <Observability app ID for your cloud> --scopes Agent365.Observability.OtelWrite).

Testing

  • Full suite after merging main (Add cloud-aware endpoints and harden GCC blueprint setup #478): 2289 passed, 12 skipped (pre-existing), 0 failed. The Release build has 0 warnings.
  • New and updated tests cover the default plan (omits Observability), s2s/both from the flag or config (keeps it), AI Teammate (keeps it), spec and consent-URL wiring, registration severity, and the summary. Each new test fails against a mutation of the line it guards. GCC cases pin the skip filter and consent-URL clear across clouds.

Follow-ups

  • Decide the AI Teammate default once admin-center instance creation can be validated.
  • a365 setup permissions bot still configures Observability API.
  • Track pending S2S app roles per role and after the az rest fallback (deferred; no spec carries more than one app role today).
  • SDK: make the exporter's 403 log point to registration.

Blueprint agents that export telemetry through the app-only S2S endpoint
(microsoft/Agent365-nodejs#290, microsoft/Agent365-Samples#339) are
authorized by their agent registration, so the Observability API OtelWrite
permission, and the admin consent it needs, is unnecessary for them.

- New opt-in `setup all --skip-observability-permissions` omits Observability
  API from the permission specs (inheritable permissions, app role grants,
  batch consent) and from the per-resource and combined admin consent URLs.
  Defaults are unchanged: the published SDKs still export to the non-S2S
  endpoint by default.
- The flag fails fast for AI Teammate agents and with authMode s2s/both,
  since OtelWrite is the only app role those modes grant. A contradicting
  --authmode flag is rejected before bootstrap signs in.
- With the flag, a failed agent registration is an error (exit 1), because
  registration is then the agent's only Observability authorization.
- Fix: `setup all --agent-registration-only` exited 0 when registration failed.
- Dry run plan, setup summary, CHANGELOG, and docs updated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
Copilot AI lite review requested due to automatic review settings September 23, 2026 11:45
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 23, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Unresolved validation, failure-handling, persisted-consent, custom-permission, and route-documentation issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Adds --skip-observability-permissions for blueprint setup and fixes registration-only failure handling.

Changes:

  • Adds permission, consent, validation, dry-run, and summary handling.
  • Updates registration failure severity and related tests.
  • Updates documentation and changelog.
File Description
src/​Tests/​Microsoft.Agents.A365.DevTools.Cli.Tests/​Helpers/​SetupHelpersDisplaySetupSummaryTests.cs Tests summary behavior.
src/​Tests/​Microsoft.Agents.A365.DevTools.Cli.Tests/​Commands/​SetupSubcommands/​PermissionSpecsTests.cs Tests permission specifications.
src/​Tests/​Microsoft.Agents.A365.DevTools.Cli.Tests/​Commands/​SetupCommandTests.cs Tests validation and dry-run behavior.
src/​Tests/​Microsoft.Agents.A365.DevTools.Cli.Tests/​Commands/​NonDwBlueprintSetupOrchestratorExecuteTests.cs Tests registration failure handling.
src/​Tests/​Microsoft.Agents.A365.DevTools.Cli.Tests/​Commands/​AllSubcommandTests.cs Tests permission and consent wiring.
src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​SetupResults.cs Tracks skipped permissions.
src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​SetupHelpers.cs Handles permissions and consent URLs.
src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​SetupContext.cs Stores setup options.
src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​README.md Documents the option.
src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​NonDwBlueprintSetupOrchestrator.cs Applies skip behavior and failure handling.
src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​AllSubcommand.cs Adds and validates the CLI option.
docs/​agent365-guided-setup/​a365-observability-instructions.md Updates observability guidance.
CHANGELOG.md Records the feature and fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The flag is well scoped and the incompatible-combination guards look right, but two gaps undercut the contract the docs promise ("setup exits with code 1 if registration fails"). Details inline. Both need a regression test.

Per 3P Dev Scale scrum feedback, the no-consent flow becomes the main
path instead of an opt-in flag.

- Remove --skip-observability-permissions. Blueprint agents in the
  default (obo) auth mode no longer request Observability API
  permissions; registered agents export telemetry with an app-only
  token over the S2S endpoint.
- authMode s2s/both keep requesting OtelWrite, the only app role those
  modes grant; `both` also covers agents whose SDK still exports
  through the delegated (OBO) route.
- AI Teammate setup is unchanged until instance creation can be
  validated end to end.
- Registration failure stays an error on the default path.
- Tests: the default plan omits Observability; s2s/both (flag or
  config) keep it; AI Teammate keeps it. Mutation-checked.

Validated live: a roleless app-only token for a registered agent
identity exports 200 on S2S; an unregistered identity gets 403
insufficient_scope.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
Copilot AI review requested due to automatic review settings September 24, 2026 00:46
@DheerajPannala Krishnadheeraj (DheerajPannala) changed the title Add --skip-observability-permissions to setup all Stop requesting Observability API permissions for blueprint agents by default Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
Previously missed (1)

In code that hasn't changed since last review

Low severity Complete Observability API documentation sentence

src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​SetupHelpers.cs:1090

The generated API documentation is grammatically incomplete here: it renders as “Observability API unless ...” because the new text omits “is included.”

Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs Outdated
Comment thread docs/agent365-guided-setup/a365-observability-instructions.md Outdated
The S2S endpoint authorizes registered agents without OtelWrite whatever
the auth mode, so s2s/both no longer request it either. They still grant
any other app-role specs (e.g. Defender once #485 lands). Agents whose SDK
still exports through the delegated route grant OtelWrite manually, as the
CHANGELOG upgrade note describes. AI Teammate setup is unchanged.

Tests encode the changed requirement for s2s/both (flag or config) and are
mutation-checked.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Unresolved moderate findings affect documentation, AI Teammate dry-run behavior, and failure remediation.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
Previously missed (1)

In code that hasn't changed since last review

Low severity Document conditional Observability exclusion in Step 4

src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​NonDwBlueprintSetupOrchestrator.cs:372

The Step 4 comment still says the permission-spec build stamps Observability, but this branch intentionally excludes it when SkipObservabilityPermissions is true. Keeping that description here makes the implementation contract misleading for future changes; state the conditional explicitly.

- When registration is required (--agent-registration-only, or Observability
  permissions not requested), an inconclusive registration check now fails
  setup instead of passing. The stored ID is kept and no duplicate
  registration is created. The optional path still retains the stored ID.
- When Observability is not included, drop an Observability consent entry
  saved by an earlier run so the admin is not asked for it.
- Keep Observability for an AI Teammate config retained for a dry run (skip
  only for an effective blueprint selection).
- Scope the guided-setup OtelWrite grant steps to AI Teammates and SDKs that
  still export through the delegated route; fix two stale doc comments.

Regression tests cover each case and are mutation-checked.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
@DheerajPannala

Copy link
Copy Markdown
Contributor Author

Review feedback addressed in 9e72b1b:

  • Registration (Rick): an inconclusive registration check now fails setup when registration is required, keeping the stored ID and not re-registering.
  • Consent (Rick): a stale Observability consent entry from an earlier run is removed when Observability isn't requested.
  • AI Teammate dry run (Copilot): Observability is still requested for AI Teammate configs, including those kept for a dry run.
  • Docs (Copilot): the guided-setup grant steps are scoped to AI Teammates and older delegated-route SDKs. The two stale doc comments are fixed.

Each fix has a regression test that fails against a mutation of the fix. Full suite: 2030 passed, 12 skipped (pre-existing), 0 failed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Low severity

Open (2)
Resolved since last review (2)

Comment thread CHANGELOG.md Outdated
Make the upgrade note one consumer-facing sentence, and update the Fixed
entry: setup exits 1 when registration fails or cannot be verified for
blueprint agents as well as with --agent-registration-only. Replace
"without the flag" in a registration test, since the flag was removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A moderate stale-consent cleanup issue remains, along with two documentation/comment nits.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Remove stale Observability consent URLs before early return

src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​SetupHelpers.cs:1451

When a prior non-admin run persisted an Observability consent URL, a subsequent run with Observability skipped can leave that stale entry behind whenever TenantWideConsentOutcome is Granted (or the blueprint ID is absent), because this method returns before PopulateAdminConsentUrls performs the removal. The generated config can therefore still advertise an admin-consent URL for a permission this run did not request; move the stale-entry cleanup before this early return (while preserving any intentional record-retention policy).

Comment thread CHANGELOG.md Outdated
The upgrade note opened by saying every existing agent needs the
Observability permissions, which contradicted the S2S exception. Scope
the heading and requirement to agents that export through the delegated
(OBO) route.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
Copilot AI review requested due to automatic review settings September 24, 2026 13:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Dry-run/help behavior conflicts with retained app roles, and the release guidance contains contradictory permission instructions.

Review effort: Balanced
Findings: 3 Medium severity · 3 Low severity

Open (6)
Resolved since last review (1)

Comment thread CHANGELOG.md Outdated
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/AllSubcommand.cs Outdated
…y-permissions

Conflict resolutions:
- GetFixedApiPermissionSpecs / admin-consent URL builders take both the
  cloud environment (#478) and includeObservability (#501); the skipped
  Observability spec, URL, and combined-URL scope stay omitted in every cloud.
- Portal walkthrough filter and ClearSkippedObservabilityConsentUrl match any
  cloud's Observability app ID (ConfigConstants.IsObservabilityApiAppId).
- S2S PowerShell keeps the spec-driven per-target block (resource IDs come from
  the cloud-aware specs); delegated Observability block keeps the skip gate and
  uses #478's cloud resource ID and Graph base URL.
- Registration failure keeps RecordRegistrationFailure (a superset of #478's
  --agent-registration-only error); #478's registration-only test now accepts
  the longer message, and #501's duplicate registration-only test is removed.
- CHANGELOG: kept all #478 entries, dropped the "full setup continues to treat
  registration as best-effort" clause that #501 changes for blueprint agents,
  and pointed Option B at the Observability app ID for the user's cloud.
- Tests: GCC cases pin the cross-cloud skip filter and consent-URL clear.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
After merging #478, sovereign clouds use their own Observability app IDs, so
the README's opt-back-in command no longer hard-codes the commercial ID.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/agent365-guided-setup/a365-observability-instructions.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread docs/agent365-guided-setup/references/dotnet-observability.md Outdated
Comment thread docs/agent365-guided-setup/references/nodejs-observability.md Outdated
Comment thread docs/agent365-guided-setup/references/python-observability.md Outdated
Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Explicit custom Observability opt-ins are misclassified as skipped, and several updated setup instructions remain incorrect.

Review effort: Balanced
Findings: 3 Medium severity · 6 Low severity

Open (9)
Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Install S2S dependencies for all non-AI-Teammate blueprints

docs/​agent365-guided-setup/​a365-observability-instructions.md:82

The new rule says every blueprint agent must use app-only S2S telemetry, but Phase 2 still branches on workload authMode: its OBO branch installs the delegated Hosting/Runtime packages and Python says S2S dependencies are optional. An OBO blueprint therefore reaches Phases 3–5 without the dependencies required by the mandated app-only resolver. Update Phase 2 for non-AI-Teammate blueprints to install the S2S dependency set regardless of workload auth mode.

@DheerajPannala

Copy link
Copy Markdown
Contributor Author

Thanks, Rick. I've replied on every inline thread. The fixes are in e88c109, 5ebda8f, f33cfda and 39b2b3c, with a merge of main (#478) in d81c735.

Inline threads

  • The guided-setup docs now point blueprint agents to the agent365-skills instrument-observability skill (S2S with an app-only resolver, and registration as the first fix for a 403).
  • The CHANGELOG line uses your wording. The upgrade note limits Option A to existing blueprints and gives a365 setup permissions custom for new ones.
  • A missing blueprint client secret now exits 1.
  • The dry run and the --authmode help say that blueprint agents are granted no S2S app roles by default.
  • The delegated PowerShell block is gated on the Observability skip.
  • Copilot's comment and blueprint-SP threads are fixed. The two per-role tracking threads are deferred, as you suggested, with replies.

Your questions

  • --authmode s2s for blueprint agents: right, it grants nothing today. OtelWrite was the only app role setup requested, and custom permissions carry delegated scopes only. It stays accepted, and the help text, dry run and summary now say so ("blueprint agents grant none by default", "not required (no S2S app roles to grant)"). Whether to deprecate it for blueprint agents can be a follow-up.
  • Registration permission: the call uses the CLI client app's delegated Graph token and needs Microsoft Graph AgentRegistration.ReadWrite.All consented on that app; setup checks that consent before registering. The failure message now names the permission. I haven't found a documented directory-role requirement beyond it, so the message doesn't name a role.
  • Opting back in with customBlueprintPermissions: Commands/SetupSubcommands/README.md now has a line for it. It notes that custom permissions need admin-run consent, because they aren't in the non-admin combined consent URL.

Nits: the design.md table (Non-DW Observability is now "—"), the closing-line rule ("granted or not required") and the one-line comment are fixed.

Merge with main (#478, cloud-aware endpoints)

  • Observability specs, consent URLs and PowerShell now use each cloud's Observability app ID. Blueprint agents still skip Observability in every cloud.
  • The portal-walkthrough filter and ClearSkippedObservabilityConsentUrl match any cloud's Observability app ID. New GCC test cases pin both and fail when the filters are narrowed to the commercial ID.
  • Registration failures still go through RecordRegistrationFailure, which covers Add cloud-aware endpoints and harden GCC blueprint setup #478's --agent-registration-only error. Add cloud-aware endpoints and harden GCC blueprint setup #478's registration-only test now accepts the longer message, and I dropped this PR's duplicate of that test.
  • CHANGELOG: I kept all Add cloud-aware endpoints and harden GCC blueprint setup #478 entries but dropped its "full setup continues to treat registration as best-effort" clause, since this PR makes registration failure exit 1 for blueprint agents. The upgrade note and README now use the Observability app ID for the user's cloud.
  • Full suite: 2289 passed, 12 skipped (the same pre-existing skips), 0 failed.

Merge gate: agreed. This stays unmerged until the SDK 2.0.0 release containing microsoft/Agent365-nodejs#290 ships, and merges together with microsoft/Agent365-Samples#339 and microsoft/agent365-skills#84. The description now says so.

Cross-PR: I've noted the SDK exporter's generic 403 log as a follow-up in the description. agent365-skills#84 now explains that its application-only OtelWrite fallback is for the S2S route, while this CHANGELOG note covers the delegated route.

Separate default Observability omission from effective requested permissions when custom Observability permissions are configured, and update dry-run/help/docs for cloud-aware S2S guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
@DheerajPannala

Copy link
Copy Markdown
Contributor Author

Pushed 69fb074 for Copilot's re-review after the merge. I replied on each thread. In summary:

  • A custom Observability opt-back-in (customBlueprintPermissions or a365 setup permissions custom) is no longer treated as skipped. It keeps its saved consent URL, and a registration failure stays a warning for it.
  • The dry-run S2S rows and the --authmode help now depend on the app roles actually requested, so they stay correct once Add Defender permissions part of "a365 setup all" #485 adds a default Defender role.
  • The CHANGELOG entry is one sentence.
  • The guided-setup docs no longer hard-code the commercial Observability ID or a tenant-specific service-principal object ID.
  • Phase 2 now installs the app-only S2S dependencies for every non-AI-Teammate blueprint agent, regardless of workload auth mode. Copilot flagged this as "previously missed".

Full suite: 2293 passed, 12 skipped, 0 failed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Registration severity, summary state, custom opt-in validation, and delegated-consent documentation still have correctness issues.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (9)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Display identity failures under errors, not warnings

src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​NonDwBlueprintSetupOrchestrator.cs:512

This branch records the identity failure only in Errors, but DisplaySetupSummary renders every AgentIdentityFailed row as failed — see warnings. For the missing-secret path the summary therefore points users to a warning list that does not contain the failure. Track the failure severity explicitly or update the renderer so this row points to errors.

This issue also appears in the following locations of the same file:

  • line 577
  • line 714

Comment thread src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/SetupHelpers.cs Outdated
Comment thread docs/agent365-guided-setup/a365-observability-instructions.md Outdated
Require custom Observability opt-back-in to target the configured cloud and OtelWrite, track identity and registration failure severity explicitly, and clarify delegated-route documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
Copilot AI review requested due to automatic review settings September 28, 2026 19:07
@DheerajPannala

Copy link
Copy Markdown
Contributor Author

Pushed 6b0a0fd for Copilot's latest pass:

  • A custom Observability opt-back-in must now name the configured cloud's Observability app ID and request Agent365.Observability.OtelWrite. A wrong-cloud ID or other scope no longer counts.
  • The setup summary now tracks the severity of agent identity and registration failures explicitly, so each failed row points to the list that actually holds the failure. This was the "previously missed" item: before, the missing-blueprint-secret path said "see warnings" but recorded an error. Registration now follows where the failure was recorded instead of inferring it from the Observability skip.
  • In the guided-setup docs, the PowerShell app-role alternative is now limited to AI Teammates. Blueprint agents on the delegated route are pointed to a365 setup permissions custom.

Full suite: 2301 passed, 12 skipped, 0 failed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

S2S summary state is incorrect when agent identity creation fails, and the coordinated rollout remains externally gated.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Initialize no-S2S-app-roles state before identity-existence gate

src/​Microsoft.Agents.A365.DevTools.Cli/​Commands/​SetupSubcommands/​NonDwBlueprintSetupOrchestrator.cs:723

NoS2SAppRolesToGrant is initialized only when this method runs, but the caller invokes it only after an agent identity exists. If identity creation fails (including the new missing-secret error path), an s2s/both run with no app-role specs leaves this flag false, so the summary can report PENDING or a tenant-wide delegated grant instead of “no S2S app roles to grant.” Derive this state from specs before the identity-existence gate so failure summaries remain accurate.

EffectiveAuthMode and NoS2SAppRolesToGrant were set only after an agent
identity existed, so when identity creation failed an s2s/both run with no
app roles to grant could be summarized as a pending or delegated grant
instead of "no S2S app roles to grant".

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5cbf5f6b-cc40-4b7e-a591-65848db73a12
@DheerajPannala

Copy link
Copy Markdown
Contributor Author

Pushed b21addd for the item Copilot's latest pass flagged as "previously missed". The auth mode and whether any S2S app role is requested are now recorded before the agent identity step. Before, they were set only after an identity existed, so an s2s run whose identity creation failed could be summarized with delegated-consent wording instead of "not required (no S2S app roles to grant)". A new end-to-end test covers this: an s2s run with a missing blueprint secret, checked through DisplaySetupSummary. Full suite: 2302 passed, 12 skipped, 0 failed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants