Add a365 network gsa enable|disable|status - #495
Closed
Lala Sushant Srivastava (lasrivas) wants to merge 2 commits into
Closed
Lala Sushant Srivastava (lasrivas) wants to merge 2 commits into
Lala Sushant Srivastava (lasrivas) wants to merge 2 commits into
Conversation
Global Secure Access is a per-environment Power Platform setting, and Agent 365 does not publish the id of the managed environment it provisions, so the admin surfaces that take an environment id cannot reach it. The platform resolves the environment and applies the change; these commands carry no environment identifier at all. Two things that are not obvious from the diff: Power Platform applies the change asynchronously but issues no operation id for it, so unlike vnet there is no handle to poll. The CLI converges by re-reading the setting, which is why status takes no --operation-id. NotConfigured is reported distinctly from Disabled. A tenant that has never set the value has not turned it off, and the distinction changes what an admin should do next. Co-authored-by: Copilot <[email protected]>
Lala Sushant Srivastava (lasrivas)
requested review from
a team
as code owners
September 15, 2026 19:06
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Lala Sushant Srivastava (lasrivas)
changed the base branch from
main
to
feature/network-vnet-link
September 15, 2026 19:06
GsaService asked for a token with a login hint but no tenant, so the authority stayed `common`. The Windows broker ignores the hint in that case and returns whichever account Windows prefers; the resulting UPN mismatch is only logged at Debug, so a tenant-wide setting could be applied to the wrong tenant without any visible warning. Passing the tenant also arms the existing mismatch self-heal in AuthenticationService, which is inert while tenantId is null. Resolve both tenant and user from a single `az account show` via IAzureCliService - the same source `vnet link` already uses - rather than adding a --tenant-id option the user would have to keep in sync with their az context. No az login, or an account with no tenant, now fails with a clear message instead of silently guessing. Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
a365 network gsa enable,disable, andstatus, so a tenant admin can turn Global Secure Access on or off for the Agent 365 environment.Global Secure Access is a per-environment Power Platform setting, and Agent 365 does not publish the id of the managed environment it provisions, so the admin surfaces that take an environment id cannot reach it. The platform resolves the environment and applies the change; these commands carry no environment identifier at all.
Depends on the platform routes in bic/MCP-Platform#3686.
Stacked on #494 (
a365 network vnet), which it bases on forNetworkCommand.cs. Merge that one first.Summary
Services/GsaService.cs+IGsaService.cs— calls/agents/gsa/{enable,disable,status}; correlation id, typed error bodies, a wall-clock convergence wait, and tenant-targeted authentication resolved fromIAzureCliService.Models/GsaModels.cs—GsaStatusResponse,GsaErrorResponse.Commands/NetworkCommand.cs— agsasubcommand tree besidevnet, plusReportGsaAsyncas the testable seam holding the wait-and-exit-code logic.Program.cs— DI registration and the newCreateCommandargument.docs/commands/network-gsa.md, adocs/commands/README.mdrow, and a CHANGELOG entry.Services/GsaServiceTests.csand GSA cases inCommands/NetworkCommandTests.cs.Non-obvious decisions
Tokens are requested for the tenant of the current
az login, not just a login hint. A hint alone leaves the authority atcommon, and the Windows broker then ignores the hint and returns whichever account Windows prefers — silently, since the UPN mismatch is only logged at Debug. For a tenant-wide setting that means applying the change to the wrong tenant. Both the tenant and the user come from a singleaz account showviaIAzureCliService, the same sourcevnet linkalready uses, rather than a--tenant-idoption the caller would have to keep in sync with their az context. Passing the tenant also arms the mismatch self-heal already present inAuthenticationService, which is inert whiletenantIdis null. Noaz loginnow fails with a clear message instead of guessing.statustakes no--operation-id, unlikevnet status. Power Platform applies the change asynchronously but issues no operation id for it, so there is no handle to poll — the CLI converges by re-reading the setting instead.NotConfiguredis reported distinctly fromDisabled. A tenant that has never set the value has not turned it off, and the distinction changes what an admin should do next.A pending change exits 0. The platform accepted it and the environment is catching up; a non-zero exit would break scripts that chain on success.
--waitis how a caller blocks on convergence.409 gets its own message. A governing Power Platform policy owns the setting, and retrying cannot fix it, so the CLI says so rather than letting it read as transient.
Testing
Full CLI suite: 2120 passed, 0 failed, 12 skipped.
End to end against a real tenant, with the platform running locally on
feature/gsa-environment-setting:status→ Disabled,enable --wait→ Enabled,status→ Enabled,enableagain → Enabled (no-op),disable --wait→ Disabled,status→ Disabled,disableagain → Disabled (no-op). The environment was left in its originalDisabledstate.