microsoft / microsoft/Dataverse-skills

Retire PAC CLI auth dependency once DV CLI ships solution + admin lifecycle commands

Open
#77 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
No language data
Stars
226
Forks
61
Avg merge
3d 9h
Merged PRs (30d)
7

Description

## Goal

Eliminate the PAC CLI auth dependency from `dv-connect` Step 2b so a user signs in **once** at connect time instead of twice.

## Context

PR #68 introduces a two-tool / two-cache auth model:

| Tool | App registration | Cache file |
|---|---|---|
| DV CLI + MCP stdio proxy + Python (`scripts/auth.py` via shared MSAL cache) | `0c412cc3-0dd6-449b-987f-05b053db9457` (DV CLI app) | `%LocalAppData%\Microsoft\DataverseCli\tokencache_msalv3.dat` |
| PAC CLI (`pac solution …`, `pac admin …`) | PAC's own AAD app | `%LocalAppData%\Microsoft\PowerAppsCli\…` |

PAC cannot reuse the DV CLI cache because AAD refresh tokens are scoped per client ID. Today, `dv-connect` Step 2b therefore runs `pac auth create` back-to-back with `dataverse auth create` so the user signs in twice up front and never sees a prompt later. The only reason PAC stays in the connect path is that `dv-solution` and `dv-admin` still call PAC for solution lifecycle and environment management.

## Action

Once the **Dataverse CLI** ([microsoft.ghe.com/bic/DataverseCLI](https://microsoft.ghe.com/bic/DataverseCLI)) grows native equivalents of the PAC verbs we depend on, the plugin can drop PAC from the auth path and connect drops back to one prompt.

### DV CLI commands needed

Minimum surface to retire PAC in this plugin:

**Solution lifecycle** (used by `dv-solution`)
- `dataverse solution list`
- `dataverse solution export`
- `dataverse solution import`
- `dataverse solution pack`
- `dataverse solution unpack`
- `dataverse solution publish`
- `dataverse solution clone`
- `dataverse solution version`

**Admin / environment** (used by `dv-admin` and `dv-connect` Step 2)
- `dataverse admin env list`
- `dataverse admin env create`
- `dataverse admin env delete`
- `dataverse admin env reset`
- `dataverse admin env backup`
- `dataverse admin org settings get/set` (org settings + `orgdborgsettings` XML)
- `dataverse admin user assign-role`
- `dataverse admin user self-elevate`

**Bulk delete / retention** (used by `dv-admin`)
- `dataverse data bulk-delete`
- `dataverse data retention get/set`

## What changes in `Dataverse-skills` once DV CLI ships these

1. **`scripts/auth.py`** — no change (already DV-CLI-cache-aware).
2. **`dv-connect/SKILL.md`** — remove Step 2b entirely; update Step 0 / Step 5 to verify only `dataverse auth who` (drop `pac org who`).
3. **`dv-solution/SKILL.md`** — swap every `pac solution …` for the DV CLI equivalent.
4. **`dv-admin/SKILL.md`** — swap every `pac admin …` / `pac data …` for the DV CLI equivalent.
5. **`dv-security/SKILL.md`** — swap `pac admin assign-user` / `pac admin self-elevate` for the DV CLI equivalent.
6. **`dv-overview/SKILL.md`** — update the *Tool Capabilities* table to mark PAC CLI as deprecated / removed.
7. **Step 1 (tool install)** — `pac` can become optional (only needed if the user explicitly wants the PAC fallback).

## Acceptance criteria

- `dv-connect` issues exactly **one** interactive prompt (`dataverse auth create`) end-to-end.
- All 8 skills (`dv-connect`, `dv-data`, `dv-query`, `dv-metadata`, `dv-solution`, `dv-admin`, `dv-security`, `dv-overview`) pass static eval with PAC removed from documented commands.
- Existing workspaces (with PAC still installed and authed) continue to work — PAC paths can stay as a documented fallback for transition.

## Blocked on

Solution lifecycle and admin commands in [microsoft.ghe.com/bic/DataverseCLI](https://microsoft.ghe.com/bic/DataverseCLI) (track upstream; file there once that work has a target).

## Related

- PR #68 — introduced the two-cache auth model and Step 2b
- PR #68 description — *Two-tool / two-cache reality (and roadmap to one)* section
- #76 — README Cursor install (separate follow-up)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

This work is blocked on the Dataverse CLI gaining the listed solution and admin commands. When available, read PR #68, scripts/auth.py, and the SKILL.md files named in the issue; then run the static evaluations. Done means one dataverse auth prompt, PAC removed from documented commands, and existing PAC fallback paths preserved.

Written by the indexing model from the issue text.

Assessment

Domain
authentication, cli, documentation, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.