PAC CLI와 Python SDK를 사용하여 Dataverse 솔루션의 생성, 내보내기, 언팩, 팩, 가져오기 등 솔루션 생명주기를 관리합니다.
- GitHub 스타
- 257
- 파일
- 1
- 마지막 커밋
- 2026년 11월 11일
- 라이선스
- MIT
- 허용된 도구
- —
dv-solution skill은 무엇을 하나요?
PAC CLI와 Python SDK를 사용하여 Dataverse 솔루션의 생성, 내보내기, 언팩, 팩, 가져오기 등 솔루션 생명주기를 관리합니다.
skill의 SKILL.md에서 생성된 요약입니다.
dv-solution skill 정보
Dataverse 솔루션의 생명주기를 관리하는 작업은 개발자가 커스텀 설정을 패키징하거나, 개발 환경과 운영 환경 간에 작업물을 이동하거나, 배포를 검증해야 할 때 수행합니다. 이 SKILL은 PAC CLI와 Python SDK를 사용하여 솔루션의 생성, 내보내기, 언팩, 팩, 가져오기 과정을 자동화합니다. 비관리형 솔루션 파일을 통해 깨끗한 소스 기준을 유지하면서 다양한 환경으로 변경 사항을 반영해야 하는 엔지니어를 위해 설계되었습니다.
사용자가 새로운 게시자를 생성하거나, 솔루션에 테이블 또는 폼과 같은 구성 요소를 추가하거나, 패키징된 솔루션을 대상 환경에 배포해야 할 때 에이전트가 이 SKILL을 로드해야 합니다. 이 SKILL은 파일 작업에는 PAC CLI를 사용하고, 솔루션 레코드 생성이나 가져오기 후 검증과 같은 Dataverse 레코드 상호작용에는 Python SDK를 사용합니다. 특히 테이블 존재 여부나 폼 게시 여부를 확인하는 구조화된 검증 단계를 제공하여 배포 성공 여부를 확실히 보장한다는 점이 특징입니다.
agent가 수행할 수 있는 작업
- 1새 솔루션 생성특정 커스텀 접두사를 가진 게시자를 먼저 찾거나 생성하여 새로운 Dataverse 솔루션을 설정합니다.
- 2환경 간 커스텀 설정 이동개발 환경에서 솔루션을 내보내고, 편집 가능한 파일로 언팩한 다음, 이를 팩하여 테스트 환경으로 가져옵니다.
- 3배포 성공 여부 확인가져오기 작업이 완료된 후 대상 환경에서 특정 테이블, 폼 또는 뷰가 활성화되어 정상적으로 작동하는지 확인합니다.
- 4솔루션에 구성 요소 추가구성 요소 유형 코드를 사용하여 기존 테이블, 뷰 또는 캔버스 앱을 특정 솔루션에 연결합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
dv-solution skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 dv-solution skill 설치
/plugin marketplace add microsoft/Dataverse-skills /plugin install dataverse@dataverse-skills
Claude Code에 dv-solution skill 설치
~/.claude/skills/dv-solution/SKILL.md
$ npx degit microsoft/Dataverse-skills/.github/plugins/dataverse/skills/dv-solution ~/.claude/skills/dv-solutionClaude Code (project)에 dv-solution skill 설치
.claude/skills/dv-solution/SKILL.md
$ npx degit microsoft/Dataverse-skills/.github/plugins/dataverse/skills/dv-solution .claude/skills/dv-solutionCodex에 dv-solution skill 설치
~/.agents/skills/dv-solution/SKILL.md
$ npx degit microsoft/Dataverse-skills/.github/plugins/dataverse/skills/dv-solution ~/.agents/skills/dv-solutionGemini CLI에 dv-solution skill 설치
~/.gemini/skills/dv-solution/SKILL.md
$ npx degit microsoft/Dataverse-skills/.github/plugins/dataverse/skills/dv-solution ~/.gemini/skills/dv-solutionClaude.ai에 dv-solution skill 설치
npx degit microsoft/Dataverse-skills/.github/plugins/dataverse/skills/dv-solution dv-solution && zip -r dv-solution.zip dv-solution # claude.ai → Customize → Skills → + → Create skill → Upload a skill → dv-solution.zip
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 보안 감사는 아닙니다. 에이전트가 실행하기 전에 스크립트를 읽어 보세요. 검사 방식
- 소스 저장소 연결 및 접근 가능microsoft/dataverse-skills/.github/plugins/dataverse/skills/dv-solution is public and reachablegithub.com/microsoft/dataverse-skills/tree/HEAD/.github/plug ↗통과
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit 2026-11-11github.com/microsoft/dataverse-skills/commits ↗통과
- 스크립트에 다운로드 후 실행이나 자격 증명 탈취가 없음No scripts in the skill folder통과
- SKILL.md에 숨겨진 지침 없음No override phrases, safeguard switches, credential requests or hidden charactersgithub.com/microsoft/dataverse-skills/blob/HEAD/.github/plug ↗통과
- 사전 허용 도구가 제한됨No pre-approved tools; the agent asks before using onegithub.com/microsoft/dataverse-skills/blob/HEAD/.github/plug ↗통과
- SKILL.md가 Agent Skills 형식을 따름Valid name and description; says when to use it; 333 linesgithub.com/microsoft/dataverse-skills/blob/HEAD/.github/plug ↗통과
SKILL.md
GitHub에서 보기Skill: Solution
Create, export, unpack, pack, import, and validate Dataverse solutions via PAC CLI. Includes post-import validation using the Python SDK.
Headless / restricted-egress hosts: use the raw Web API (
ExportSolution/ImportSolution) for the online steps.pac solution pack/unpackare local file operations (no auth) but need a host that can run PAC -- do them on a capable machine or CI runner. Verify egress withpython scripts/auth.py --check. Seedv-connect/references/headless-hosts.md.
Skill boundaries
| Need | Use instead |
|---|---|
| Create tables, columns, relationships, forms, views | dv-metadata |
| Create, update, or delete data records | dv-data |
| Query or read records | dv-query |
| Connect to Dataverse / set up MCP | dv-connect |
Create a New Solution
Use the Python SDK for publisher and solution record creation — not raw HTTP. Publishers and solutions are standard Dataverse tables. client.records.create() and client.records.list() handle auth, pagination, and error handling automatically, avoiding the URL encoding, header boilerplate, and GUID-parsing bugs that raw urllib calls introduce.
Step 1: Find or Create the Publisher
Every solution belongs to a publisher. The publisher's customizationprefix (e.g., contoso, sa, lit) is prepended to every custom table, column, and relationship schema name. This prefix is effectively permanent — existing components keep their prefix forever, even if you change the publisher later.
Never use the default new prefix. It provides no organizational identity, risks naming collisions, and signals the developer did not follow best practices.
Discovery flow — always run this before creating a publisher:
import os, sys
sys.path.insert(0, os.path.join(os.getcwd(), "scripts"))
from auth import get_client
# get_client sets a plugin attribution context on the User-Agent header.
# Do not modify the context value — it is a closed schema for server-side
# telemetry (app/skill/agent). Never include secrets or PII.
client = get_client("dv-solution")
# 1. Query for existing non-Microsoft publishers
publishers = client.records.list(
"publisher",
filter="customizationprefix ne 'none' and uniquename ne 'MicrosoftCorporation' and uniquename ne 'Microsoftdynamic'",
select=["publisherid", "uniquename", "friendlyname", "customizationprefix"],
top=10,
)
if publishers:
# Show existing publishers and ask user which to use
print("Existing publishers in this environment:")
for p in publishers:
print(f" {p['uniquename']} (prefix: {p['customizationprefix']}_)")
# ASK THE USER: "Which publisher should this solution use?"
# Or: "Should I reuse '<name>' (prefix: <prefix>_)?"
publisher_id = publishers[0]["publisherid"] # after user confirms
else:
# No custom publisher exists — ASK THE USER for prefix
# "What publisher prefix should I use? (e.g., 'contoso', 'sa', 'lit' — 2-8 lowercase chars)"
publisher_id = client.records.create("publisher", {
"uniquename": "<publisheruniquename>",
"friendlyname": "<Publisher Display Name>",
"customizationprefix": "<prefix>", # from user input, NOT 'new'
"description": "<description>",
})
Rules:
- Always ask the user before creating a new publisher or choosing a prefix. Never hardcode a prefix.
- The prefix must match any tables already created in the solution — you cannot mix prefixes.
- One publisher can own many solutions. Reuse an existing publisher when possible.
Step 2: Create the Solution Record
Use the SDK to create the solution record (preferred over raw Web API):
import os, sys
sys.path.insert(0, os.path.join(os.getcwd(), "scripts"))
from auth import get_client
# get_client sets a plugin attribution context on the User-Agent header.
# Do not modify the context value — it is a closed schema for server-side
# telemetry (app/skill/agent). Never include secrets or PII.
client = get_client("dv-solution")
# Create the solution record
solution_id = client.records.create("solution", {
"uniquename": "<UniqueName>",
"friendlyname": "<Display Name>",
"version": "1.0.0.0",
"publisherid@odata.bind": "/publishers(<publisher_guid>)",
})
print(f"Created solution: {solution_id}")
The required fields:
Table: solution
Fields: uniquename = "<UniqueName>"
friendlyname = "<Display Name>"
version = "1.0.0.0"
publisherid = <publisher GUID from step 1>
Note: There is no
pac solution createcommand. PAC CLI handles export/import/pack/unpack, not solution record creation. Use the SDK or Web API to create the record.
Step 3: Add Components
Use pac solution add-solution-component to add tables, forms, views, and other components:
pac solution add-solution-component \
--solutionUniqueName <UniqueName> \
--component <ComponentSchemaName> \
--componentType <TypeCode> \
--environment <url>
Note: PAC CLI uses camelCase args here (
--solutionUniqueName,--componentType), not kebab-case.
Common component type codes:
| Type Code | Component |
|---|---|
| 1 | Entity (Table) |
| 2 | Attribute (Column) |
| 26 | View |
| 60 | Form |
| 61 | Web Resource |
| 300 | Canvas App |
| 371 | Connector |
Repeat the command for each component you need to add.
Alternative: Auto-add via MSCRM.SolutionName Header
When creating metadata via the Web API, include the MSCRM.SolutionName header to auto-add components to the solution:
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
"MSCRM.SolutionName": "<UniqueName>"
}
Important: After using this approach, verify components were added by querying the solutioncomponent table with the SDK (pac solution list-components is not available in current PAC):
sol = client.records.list("solution",
filter="uniquename eq '<UniqueName>'", select=["solutionid"], top=1).first()
if sol is not None:
components = client.records.list("solutioncomponent",
filter=f"_solutionid_value eq {sol['solutionid']}",
select=["componenttype", "objectid"])
print(f"{len(components)} components in the solution")
If the header was misspelled or the solution doesn't exist, components will be created in the default solution instead — silently. Always verify.
Find the Solution Name
Before exporting, confirm the exact unique name:
pac solution list --environment <url>
The UniqueName column is what you pass to other commands. Display names have spaces; unique names do not.
Pull: Export + Unpack
Confirm the target environment before exporting or importing. Run
pac auth list+pac org who, show the output to the user, and confirm it matches the intended environment. Developers work across multiple environments — do not assume.
Export the solution as unmanaged (source of truth):
pac solution export \
--name <UniqueName> \
--path ./solutions/<UniqueName>.zip \
--managed false \
--environment <url>
Unpack into editable source files:
pac solution unpack \
--zipfile ./solutions/<UniqueName>.zip \
--folder ./solutions/<UniqueName> \
--packagetype Unmanaged
Windows file-lock race. Run export and unpack as separate commands (as above); chaining them immediately can hit a transient ZIP file-lock right after export. If
unpackfails with a lock / "in use" error, retry after a moment, and verify the unpacked folder has the expected components before deleting the zip.
Delete the zip — the unpacked folder is the source:
rm ./solutions/<UniqueName>.zip
Commit:
git add ./solutions/<UniqueName>
git commit -m "chore: pull <UniqueName> baseline"
git push
Push: Pack + Import
Pack the source files back into a zip:
pac solution pack \
--zipfile ./solutions/<UniqueName>.zip \
--folder ./solutions/<UniqueName> \
--packagetype Unmanaged
Import (async recommended for large solutions):
pac solution import \
--path ./solutions/<UniqueName>.zip \
--environment <url> \
--async \
--activate-plugins
Poll Import Status
After async import, check the job:
pac solution list --environment <url>
Post-Import Validation
After importing a solution, verify that components are live. Use the Python SDK to check directly — no external scripts needed.
Check a table exists
info = client.tables.get("<logical_name>")
if info:
print(f"[PASS] Table '{info.logical_name}' exists")
else:
print(f"[FAIL] Table '<logical_name>' not found")
Check a form is published
forms = client.records.list(
"systemform",
filter="objecttypecode eq '<entity>' and type eq <form_type_code>",
select=["name", "formid"],
top=5,
)
# Form type codes: 2 = main, 7 = quick create
Check a view exists
views = client.records.list(
"savedquery",
filter="returnedtypecode eq '<entity>'",
select=["name", "savedqueryid", "statuscode"],
top=10,
)
Check a user's role assignment (N:N $expand)
records.list passes $expand straight through, so read the N:N navigation property directly with the SDK:
users = list(client.records.list(
"systemuser",
filter="internalemailaddress eq '<email>'", # fallback: domainname eq '<upn>'
select=["fullname"],
expand=["systemuserroles_association($select=name)"],
top=1,
))
roles = [r["name"] for r in users[0].get("systemuserroles_association", [])] if users else []
Alternatively, the managed Dataverse CLI escape hatch (dataverse api request — not urllib), or FetchXML with a link-entity:
dataverse api request --target dataverse --method GET \
--path "/api/data/v9.2/systemusers?%24filter=internalemailaddress eq '<email>'&%24select=fullname&%24expand=systemuserroles_association(%24select=name)&%24top=1" \
--environment <DATAVERSE_URL> \
--context "app=dataverse-skills/<ver>;skill=dv-solution;agent=<agent>"
The response value[0].systemuserroles_association is the list of assigned roles (each with name).
Check import errors
jobs = client.records.list(
"importjob",
select=["importjobid", "solutionname", "startedon", "completedon", "progress"],
orderby=["startedon desc"],
top=5,
)
For detailed error history, also query msdyn_solutionhistory:
history = client.records.list(
"msdyn_solutionhistory",
filter="msdyn_status eq 1", # 1 = failed
select=["msdyn_name", "msdyn_starttime", "msdyn_exceptionmessage"],
orderby=["msdyn_starttime desc"],
top=5,
)
Validation error reference
| Error | Cause | Fix |
|---|---|---|
| Table not found after import | Component not in solution | Add via pac solution add-solution-component |
| Form check fails immediately | Publishing is async | Wait 30 seconds and retry |
| Role not assigned | User not provisioned | Assign the role via pac admin assign-user or the Power Platform Admin Center |
| Import job at 0% | Import still running | Poll again in 60 seconds |
Notes
- Always use
--managed false/--packagetype Unmanagedfor the development solution. Managed packages are for deployment to downstream environments (test, prod). --activate-pluginsensures any registered plugins in the solution are activated on import.- If you see "solution already exists" errors, use
--import-mode ForceUpgradeto overwrite. - Large solutions (Sales, Customer Service) can take 10–20 minutes to import. Be patient and poll rather than re-importing.
- All validation queries above require auth. Use
scripts/auth.pyfor credential/token acquisition. Seedv-queryfor SDK query patterns anddv-datafor write patterns.
이 스킬의 파일
1dv-solution skill 질문
Claude Code에 dv-solution skill을 어떻게 설치하나요?
npx degit microsoft/Dataverse-skills/.github/plugins/dataverse/skills/dv-solution ~/.claude/skills/dv-solution를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
dv-solution skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
관리형(managed) 솔루션과 비관리형(unmanaged) 솔루션의 차이점은 무엇인가요?
비관리형 솔루션은 개발용으로 사용되며 소스 데이터의 기준이 됩니다. 관리형 패키지는 테스트나 운영 환경과 같은 하위 환경에 배포하기 위한 용도입니다.