Sync PAC CLI auth state before showing "auth profile not found" prompt#1543
Draft
Sync PAC CLI auth state before showing "auth profile not found" prompt#1543
Conversation
…ut box When the user clicks Login in Actions Hub but PacContext hasn't been populated yet, the handler now checks PAC CLI directly for an active auth profile before falling back to showing the "enter environment URL" input box. This prevents the confusing "auth profile not found" prompt when the user has already authenticated via PAC CLI. Agent-Logs-Url: https://github.com/microsoft/powerplatform-vscode/sessions/c26b8917-62e6-4e1c-a2d0-39b52ddf5cb5 Co-authored-by: amitjoshi438 <54068463+amitjoshi438@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/powerplatform-vscode/sessions/c26b8917-62e6-4e1c-a2d0-39b52ddf5cb5 Co-authored-by: amitjoshi438 <54068463+amitjoshi438@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix auth profile not found issue in Power Pages CodeQL
Sync PAC CLI auth state before showing "auth profile not found" prompt
Apr 8, 2026
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.
When clicking Login in the Power Pages Actions Hub, users with an existing PAC CLI auth profile were shown a confusing "Active auth profile is not found or has expired" input box. This happens because
createNewAuthProfileonly checkedPacContext(which relies on a file watcher chain) rather than querying PAC CLI directly.Changes
CreateNewAuthProfileHandler.ts: AddedsyncAuthFromPacCli()that queries PAC CLI viaactiveAuth()/activeOrg()and populatesPacContextbefore falling back to the input box flow. The login handler now follows this priority:PacContext.OrgInfo.OrgUrlalready set → authenticate in VS CodePacContext, then authenticate in VS CodeConstants.ts: AddedACTIONS_HUB_AUTH_SYNCED_FROM_PAC_CLItelemetry eventCreateNewAuthProfileHandler.test.ts: 8 new tests covering sync success, PAC CLI failures, org fetch failures, and fallthrough to existing flowWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node node_modules/gulp/bin/gulp.js testDesktopInt(dns block)If you need me to access, download, or install something from one of these locations, you can either: