skills/pac-auth/SKILL.md
Manage Power Platform CLI (pac) authentication profiles — create, list, switch, and delete auth connections to Dynamics 365 environments. Use when asked "connect pac to environment", "switch pac environment", "authenticate pac CLI".
npx skillsauth add nickmeron/Dataverse-MCP-Server skills/pac-authInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The user wants to manage PAC CLI authentication.
Argument provided: $ARGUMENTS
Step 1 — Check if pac is already installed:
pac help || ~/.dotnet/tools/pac help
If either prints the command list, skip to the Workflows section. If only the second worked, pac is installed but ~/.dotnet/tools is missing from PATH — add export PATH="$HOME/.dotnet/tools:$PATH" to ~/.zshrc (or ~/.bashrc) so future sessions resolve pac directly.
Step 2 — Install pac (if not found):
macOS / Linux:
# Requires .NET 9+
dotnet --version
# If dotnet is not installed: brew install dotnet
# PAC CLI 2.x has a broken NuGet package on macOS — use 1.52.1
dotnet tool install --global Microsoft.PowerApps.CLI.Tool --version 1.52.1
Windows:
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
Or use the standalone MSI installer: https://aka.ms/PowerAppsCLI
Preferred — reuse MCP credentials: If the user already authenticated via the MCP authenticate tool, reuse those same credentials so they don't have to enter them again:
pac auth create \
--name MCP \
--url ACTIVE_ENVIRONMENT_URL \
--applicationId MCP_CLIENT_ID \
--clientSecret "MCP_CLIENT_SECRET" \
--tenant MCP_TENANT_ID
Replace the values with the credentials from the MCP authenticate call. To get the active environment URL, use the MCP auth_status tool.
Interactive (browser-based):
pac auth create --url https://yourorg.crm.dynamics.com
Opens a browser for Azure AD login. Best for human users.
Service principal (non-interactive, for CI/CD and automation):
pac auth create \
--url https://yourorg.crm.dynamics.com \
--applicationId YOUR_CLIENT_ID \
--clientSecret "YOUR_SECRET" \
--tenant YOUR_TENANT_ID
With certificate:
pac auth create \
--url https://yourorg.crm.dynamics.com \
--applicationId YOUR_CLIENT_ID \
--certificateThumbprint ABC123DEF456 \
--tenant YOUR_TENANT_ID
Create an auth profile for each environment. Use environment variables to avoid exposing secrets:
# Set credentials once
export CLIENT_ID="your-client-id"
export SECRET="your-client-secret"
export TENANT_ID="your-tenant-id"
# Create profiles for each environment
pac auth create --name DEV --url https://yourorg-dev.crm.dynamics.com --applicationId $CLIENT_ID --clientSecret $SECRET --tenant $TENANT_ID
pac auth create --name TEST --url https://yourorg-test.crm.dynamics.com --applicationId $CLIENT_ID --clientSecret $SECRET --tenant $TENANT_ID
pac auth create --name UAT --url https://yourorg-uat.crm.dynamics.com --applicationId $CLIENT_ID --clientSecret $SECRET --tenant $TENANT_ID
pac auth create --name PROD --url https://yourorg-prod.crm.dynamics.com --applicationId $CLIENT_ID --clientSecret $SECRET --tenant $TENANT_ID
pac auth list
Shows all profiles with index, name, environment URL, and active status.
pac auth select --index 2
# or
pac auth select --name TEST
pac auth delete --index 3
pac auth clear
pac auth who
In GitHub Actions or Azure DevOps, always use service principal auth with secrets:
- name: PAC Auth
run: |
pac auth create \
--url ${{ secrets.D365_URL }} \
--applicationId ${{ secrets.CLIENT_ID }} \
--clientSecret ${{ secrets.CLIENT_SECRET }} \
--tenant ${{ secrets.TENANT_ID }}
~/.dotnet/tools/pac help. If that works, pac is installed but ~/.dotnet/tools is missing from PATH — add export PATH="$HOME/.dotnet/tools:$PATH" to ~/.zshrc (or ~/.bashrc). Otherwise see install steps; macOS requires --version 1.52.1.--version 1.52.1 instead.pac auth select to explicitly choose before running commandspac auth delete --index N && pac auth create ...testing
Create, monitor, and manage bulk deletion jobs in Dynamics 365. Use when asked "bulk delete", "delete all records of type X", "create a bulk delete job", "check bulk delete status", "cancel bulk delete", "why did bulk delete fail".
data-ai
Produce a business-readable summary of a Dynamics 365 record or set of records. Uses metadata to understand the schema before querying.
testing
Investigate users, security roles, teams, and permissions in Dynamics 365. Use when asked "who has access to...", "what roles does X have?", "compare roles", or "show me users".
data-ai
Query Dynamics 365 records using natural language. Translates questions into OData queries with metadata-aware field selection.