feat(onboarding): admin-consent link + bring-your-own-app guidance + restart-after-az-login - #37
Merged
Gregory Joseph (gnjoseph) merged 1 commit intoJul 9, 2026
Conversation
…restart-after-az-login Addresses PR #3 review comments on the owning-app onboarding flow: - create-app: after the owning app is created (or reused) and its SPE permissions are requested, append a copy-paste tenant-wide admin-consent link (https://login.microsoftonline.com/{tenantId}/adminconsent?client_id={appId}) built from the real signed-in tenant id + the app's public client id. Explains the Global-Admin (grant tenant-wide) vs non-admin (forward the link) paths. Non-blocking/informational: no browser is opened, provisioning is never gated on consent, and the URL carries no secret. - create-app: remove the dangling "full-setup skill 02-app.ps1" reference (no public URL to point at, so removed rather than invented). - index.ts: clarify the config.clientId branch is the bring-your-own-app path (a pre-created owning app supplied via --client-id / SPE_CLIENT_ID) and emit an explicit startup line saying no owning app will be provisioned. - index.ts: extend the bootstrap "not signed in" message to instruct users to RESTART the server after `az login`, since auth/session state is stamped at startup (a restart begins a fresh session and re-primes auth). - New src/onboarding-messages.ts houses the pure message builders with the missing-tenant fallback (organizations) + unit tests; extend create-app tests to assert the URL, admin/non-admin copy, no-secret guarantee, and skill-ref removal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Gregory Joseph (gnjoseph)
merged commit Jul 9, 2026
e6ec51e
into
feat/spe-mcp-server
5 checks passed
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.
Implements the owning-app consent & bring-your-own-app onboarding improvements from the PR #3 review.
What changed
1. Copy-paste admin-consent link (
src/tools/create-app.ts)After the owning app is created (or reused) and its SPE permissions are requested, the tool output now appends a Grant admin consent section with a copy-paste tenant-wide admin-consent URL:
{tenantId}= the real signed-in tenant id (identity.tenantId);{appClientId}= the newly created/reused app's public client id (app.appId).organizationsand the section notes it.2. Skill reference removed (
src/tools/create-app.ts)Removed the dangling
Ports the full-setup skill \02-app.ps1`` comment. There is no appropriate public URL to point at, so it was removed rather than inventing one.3. Bring-your-own-app clarification (
src/index.ts)The
config.clientIdstartup branch now clearly documents that this is the bring-your-own-app path — the caller has already pre-created an owning app (via--client-id/SPE_CLIENT_ID) and the server signs in as that app (no owning app is provisioned). A new startup line makes this explicit on stderr.4. Restart-after-
az loginguidance (src/index.ts)The bootstrap "not signed in" message now tells users to restart the MCP server after
az login, because auth/session state is stamped at startup (a restart begins a fresh session and re-primes authentication).5. New pure module + tests
src/onboarding-messages.tshouses the message builders (adminConsentUrl,adminConsentSection,byoAppStartupNote,azLoginNotSignedInMessage) so the copy is unit-tested in one place.Test evidence
npm run lint✅ ·npm run typecheck✅ ·npm run build✅npm test✅ — 713 passed | 3 skipped (baseline ~698 + 15 new tests).{tenantId}+client_id={appId}), the admin-vs-non-admin explanation, non-blocking wording, the missing-tenant fallback, no secret/token in the URL (onlyclient_id), and that the vague skill reference is gone.Guardrails