You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on multiple Power Platform projects concurrently, it's common for developers to switch frequently between environments that require different authentication profiles.
Currently, the Power Platform CLI uses a global default profile for authentication, which often leads to the need to repeatedly run pac auth select to switch context depending on the project being worked on. This workflow is error-prone and can quickly become frustrating, especially when switching between solutions or environments throughout the day.
Developers typically organize their work using separate root folders for each project (e.g., one folder per solution or environment). However, since the CLI does not associate any auth profile with a specific working directory, it lacks context-awareness. As a result, developers must manually manage the active authentication profile, which introduces friction and increases the risk of mistakenly deploying to the wrong environment.
Proposed Solution
Introduce support for project-scoped authentication defaults. Specifically, allow the CLI to recognize the working directory and automatically use a locally defined default authentication profile (if present), falling back to the global default if not.
This could be implemented by providing a command such as:
This command would create a metadata file (e.g., .pac-config.json) in the root of the current folder, storing the specified default profile for that folder (only the name). When executing pac commands inside this directory (or its subfolders), the CLI would prioritize the local profile automatically.
This feature would significantly reduce cognitive load and risk of mistakes for developers juggling multiple environments, and would align with behavior already familiar to many developers (e.g., .npmrc, .env, or .git scoped configurations).
An example of a similar concept is implemented in the pacx tool via its pacx project-init command, which creates a .pacxproj file to track context.
Benefits
Smoother experience when working on multiple projects
Fewer manual context switches and authentication errors
More reliable and environment-safe scripting and automation
Would love to hear your thoughts on this — happy to provide further suggestions or help collaborate on the implementation if the idea is of interest!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The problem
When working on multiple Power Platform projects concurrently, it's common for developers to switch frequently between environments that require different authentication profiles.
Currently, the Power Platform CLI uses a global default profile for authentication, which often leads to the need to repeatedly run
pac auth select
to switch context depending on the project being worked on. This workflow is error-prone and can quickly become frustrating, especially when switching between solutions or environments throughout the day.Developers typically organize their work using separate root folders for each project (e.g., one folder per solution or environment). However, since the CLI does not associate any auth profile with a specific working directory, it lacks context-awareness. As a result, developers must manually manage the active authentication profile, which introduces friction and increases the risk of mistakenly deploying to the wrong environment.
Proposed Solution
Introduce support for project-scoped authentication defaults. Specifically, allow the CLI to recognize the working directory and automatically use a locally defined default authentication profile (if present), falling back to the global default if not.
This could be implemented by providing a command such as:
This command would create a metadata file (e.g.,
.pac-config.json
) in the root of the current folder, storing the specified default profile for that folder (only the name). When executingpac
commands inside this directory (or its subfolders), the CLI would prioritize the local profile automatically.This feature would significantly reduce cognitive load and risk of mistakes for developers juggling multiple environments, and would align with behavior already familiar to many developers (e.g.,
.npmrc
,.env
, or.git
scoped configurations).An example of a similar concept is implemented in the pacx tool via its
pacx project-init
command, which creates a.pacxproj
file to track context.Benefits
Would love to hear your thoughts on this — happy to provide further suggestions or help collaborate on the implementation if the idea is of interest!
Beta Was this translation helpful? Give feedback.
All reactions