[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69AR3MEKCYBD8FEKK80KJ5B":3,"skill-same:01M69AR3MEKCYBD8FEKK80KJ5B":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":17,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M69AR3MEKCYBD8FEKK80KJ5B","dv-solution","Dataverse 解决方案部署管理","Dataverse solution lifecycle — create, export, import, promote across environments, and validate deployments. Use when the user wants to package customizations, deploy to another environment, or move work between dev \u002F test \u002F prod.","Dataverse 解决方案生命周期——创建、导出、导入、跨环境提升以及验证部署。当用户想要打包自定义配置、部署到其他环境，或在开发\u002F测试\u002F生产环境之间迁移工作成果时使用。","microsoft\u002FDataverse-skills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69AQ9SHMSQ8KC4EKV8DZW2Y",258,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-solution\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理","SCENARIO","使用场景",[31,32,33,34,35],"dv solution","test","validate","dataverse","deploy","2026-11-10 10:12:30",false,"---\nname: dv-solution\ndescription: Dataverse solution lifecycle — create, export, import, promote across environments, and validate deployments. Use when the user wants to package customizations, deploy to another environment, or move work between dev \u002F test \u002F prod.\n---\n\n# Skill: Solution\n\nCreate, export, unpack, pack, import, and validate Dataverse solutions via PAC CLI. Includes post-import validation using the Python SDK.\n\n> **Headless \u002F restricted-egress hosts**: use the raw Web API (`ExportSolution` \u002F `ImportSolution`) for the online steps. `pac solution pack`\u002F`unpack` are local file operations (no auth) but need a host that can run PAC -- do them on a capable machine or CI runner. Verify egress with `python scripts\u002Fauth.py --check`. See `dv-connect\u002Freferences\u002Fheadless-hosts.md`.\n\n## Skill boundaries\n\n| Need | Use instead |\n|---|---|\n| Create tables, columns, relationships, forms, views | **dv-metadata** |\n| Create, update, or delete data records | **dv-data** |\n| Query or read records | **dv-query** |\n| Connect to Dataverse \u002F set up MCP | **dv-connect** |\n\n---\n\n## Create a New Solution\n\n**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.\n\n### Step 1: Find or Create the Publisher\n\nEvery 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.\n\n**Never use the default `new` prefix.** It provides no organizational identity, risks naming collisions, and signals the developer did not follow best practices.\n\n**Discovery flow — always run this before creating a publisher:**\n\n```python\nimport os, sys\nsys.path.insert(0, os.path.join(os.getcwd(), \"scripts\"))\nfrom auth import get_client\n\n# get_client sets a plugin attribution context on the User-Agent header.\n# Do not modify the context value — it is a closed schema for server-side\n# telemetry (app\u002Fskill\u002Fagent). Never include secrets or PII.\nclient = get_client(\"dv-solution\")\n\n# 1. Query for existing non-Microsoft publishers\npublishers = client.records.list(\n    \"publisher\",\n    filter=\"customizationprefix ne 'none' and uniquename ne 'MicrosoftCorporation' and uniquename ne 'Microsoftdynamic'\",\n    select=[\"publisherid\", \"uniquename\", \"friendlyname\", \"customizationprefix\"],\n    top=10,\n)\n\nif publishers:\n    # Show existing publishers and ask user which to use\n    print(\"Existing publishers in this environment:\")\n    for p in publishers:\n        print(f\"  {p['uniquename']} (prefix: {p['customizationprefix']}_)\")\n    # ASK THE USER: \"Which publisher should this solution use?\"\n    # Or: \"Should I reuse '\u003Cname>' (prefix: \u003Cprefix>_)?\"\n    publisher_id = publishers[0][\"publisherid\"]  # after user confirms\nelse:\n    # No custom publisher exists — ASK THE USER for prefix\n    # \"What publisher prefix should I use? (e.g., 'contoso', 'sa', 'lit' — 2-8 lowercase chars)\"\n    publisher_id = client.records.create(\"publisher\", {\n        \"uniquename\": \"\u003Cpublisheruniquename>\",\n        \"friendlyname\": \"\u003CPublisher Display Name>\",\n        \"customizationprefix\": \"\u003Cprefix>\",   # from user input, NOT 'new'\n        \"description\": \"\u003Cdescription>\",\n    })\n```\n\n**Rules:**\n- **Always ask the user** before creating a new publisher or choosing a prefix. Never hardcode a prefix.\n- The prefix must match any tables already created in the solution — you cannot mix prefixes.\n- One publisher can own many solutions. Reuse an existing publisher when possible.\n\n### Step 2: Create the Solution Record\n\nUse the SDK to create the solution record (preferred over raw Web API):\n\n```python\nimport os, sys\nsys.path.insert(0, os.path.join(os.getcwd(), \"scripts\"))\nfrom auth import get_client\n\n# get_client sets a plugin attribution context on the User-Agent header.\n# Do not modify the context value — it is a closed schema for server-side\n# telemetry (app\u002Fskill\u002Fagent). Never include secrets or PII.\nclient = get_client(\"dv-solution\")\n\n# Create the solution record\nsolution_id = client.records.create(\"solution\", {\n    \"uniquename\": \"\u003CUniqueName>\",\n    \"friendlyname\": \"\u003CDisplay Name>\",\n    \"version\": \"1.0.0.0\",\n    \"publisherid@odata.bind\": \"\u002Fpublishers(\u003Cpublisher_guid>)\",\n})\nprint(f\"Created solution: {solution_id}\")\n```\n\nThe required fields:\n```\nTable:  solution\nFields: uniquename    = \"\u003CUniqueName>\"\n        friendlyname  = \"\u003CDisplay Name>\"\n        version       = \"1.0.0.0\"\n        publisherid   = \u003Cpublisher GUID from step 1>\n```\n\n> **Note:** There is no `pac solution create` command. PAC CLI handles export\u002Fimport\u002Fpack\u002Funpack, not solution record creation. Use the SDK or Web API to create the record.\n\n### Step 3: Add Components\n\nUse `pac solution add-solution-component` to add tables, forms, views, and other components:\n```\npac solution add-solution-component \\\n  --solutionUniqueName \u003CUniqueName> \\\n  --component \u003CComponentSchemaName> \\\n  --componentType \u003CTypeCode> \\\n  --environment \u003Curl>\n```\n\n> **Note:** PAC CLI uses camelCase args here (`--solutionUniqueName`, `--componentType`), not kebab-case.\n\nCommon component type codes:\n| Type Code | Component |\n|---|---|\n| 1 | Entity (Table) |\n| 2 | Attribute (Column) |\n| 26 | View |\n| 60 | Form |\n| 61 | Web Resource |\n| 300 | Canvas App |\n| 371 | Connector |\n\nRepeat the command for each component you need to add.\n\n### Alternative: Auto-add via MSCRM.SolutionName Header\n\nWhen creating metadata via the Web API, include the `MSCRM.SolutionName` header to auto-add components to the solution:\n```python\nheaders = {\n    \"Authorization\": f\"Bearer {token}\",\n    \"Content-Type\": \"application\u002Fjson\",\n    \"MSCRM.SolutionName\": \"\u003CUniqueName>\"\n}\n```\n\n**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):\n```python\nsol = client.records.list(\"solution\",\n    filter=\"uniquename eq '\u003CUniqueName>'\", select=[\"solutionid\"], top=1).first()\nif sol is not None:\n    components = client.records.list(\"solutioncomponent\",\n        filter=f\"_solutionid_value eq {sol['solutionid']}\",\n        select=[\"componenttype\", \"objectid\"])\n    print(f\"{len(components)} components in the solution\")\n```\n\nIf the header was misspelled or the solution doesn't exist, components will be created in the default solution instead — silently. Always verify.\n\n## Find the Solution Name\n\nBefore exporting, confirm the exact unique name:\n```\npac solution list --environment \u003Curl>\n```\nThe `UniqueName` column is what you pass to other commands. Display names have spaces; unique names do not.\n\n## Pull: Export + Unpack\n\n> **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.\n\nExport the solution as unmanaged (source of truth):\n```\npac solution export \\\n  --name \u003CUniqueName> \\\n  --path .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --managed false \\\n  --environment \u003Curl>\n```\n\nUnpack into editable source files:\n```\npac solution unpack \\\n  --zipfile .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --folder .\u002Fsolutions\u002F\u003CUniqueName> \\\n  --packagetype Unmanaged\n```\n\n> **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 `unpack` fails with a lock \u002F \"in use\" error, retry after a moment, and verify the unpacked folder has the expected components before deleting the zip.\n\nDelete the zip — the unpacked folder is the source:\n```\nrm .\u002Fsolutions\u002F\u003CUniqueName>.zip\n```\n\nCommit:\n```\ngit add .\u002Fsolutions\u002F\u003CUniqueName>\ngit commit -m \"chore: pull \u003CUniqueName> baseline\"\ngit push\n```\n\n## Push: Pack + Import\n\nPack the source files back into a zip:\n```\npac solution pack \\\n  --zipfile .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --folder .\u002Fsolutions\u002F\u003CUniqueName> \\\n  --packagetype Unmanaged\n```\n\nImport (async recommended for large solutions):\n```\npac solution import \\\n  --path .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --environment \u003Curl> \\\n  --async \\\n  --activate-plugins\n```\n\n## Poll Import Status\n\nAfter async import, check the job:\n```\npac solution list --environment \u003Curl>\n```\n\n## Post-Import Validation\n\nAfter importing a solution, verify that components are live. Use the Python SDK to check directly — no external scripts needed.\n\n### Check a table exists\n\n```python\ninfo = client.tables.get(\"\u003Clogical_name>\")\nif info:\n    print(f\"[PASS] Table '{info.logical_name}' exists\")\nelse:\n    print(f\"[FAIL] Table '\u003Clogical_name>' not found\")\n```\n\n### Check a form is published\n\n```python\nforms = client.records.list(\n    \"systemform\",\n    filter=\"objecttypecode eq '\u003Centity>' and type eq \u003Cform_type_code>\",\n    select=[\"name\", \"formid\"],\n    top=5,\n)\n# Form type codes: 2 = main, 7 = quick create\n```\n\n### Check a view exists\n\n```python\nviews = client.records.list(\n    \"savedquery\",\n    filter=\"returnedtypecode eq '\u003Centity>'\",\n    select=[\"name\", \"savedqueryid\", \"statuscode\"],\n    top=10,\n)\n```\n\n### Check a user's role assignment (N:N `$expand`)\n\n`records.list` passes `$expand` straight through, so read the N:N navigation property directly with the SDK:\n\n```python\nusers = list(client.records.list(\n    \"systemuser\",\n    filter=\"internalemailaddress eq '\u003Cemail>'\",   # fallback: domainname eq '\u003Cupn>'\n    select=[\"fullname\"],\n    expand=[\"systemuserroles_association($select=name)\"],\n    top=1,\n))\nroles = [r[\"name\"] for r in users[0].get(\"systemuserroles_association\", [])] if users else []\n```\n\nAlternatively, the managed **Dataverse CLI** escape hatch (`dataverse api request` — not `urllib`), or FetchXML with a link-entity:\n\n```bash\ndataverse api request --target dataverse --method GET \\\n  --path \"\u002Fapi\u002Fdata\u002Fv9.2\u002Fsystemusers?%24filter=internalemailaddress eq '\u003Cemail>'&%24select=fullname&%24expand=systemuserroles_association(%24select=name)&%24top=1\" \\\n  --environment \u003CDATAVERSE_URL> \\\n  --context \"app=dataverse-skills\u002F\u003Cver>;skill=dv-solution;agent=\u003Cagent>\"\n```\n\nThe response `value[0].systemuserroles_association` is the list of assigned roles (each with `name`).\n\n### Check import errors\n\n```python\njobs = client.records.list(\n    \"importjob\",\n    select=[\"importjobid\", \"solutionname\", \"startedon\", \"completedon\", \"progress\"],\n    orderby=[\"startedon desc\"],\n    top=5,\n)\n```\n\nFor detailed error history, also query `msdyn_solutionhistory`:\n\n```python\nhistory = client.records.list(\n    \"msdyn_solutionhistory\",\n    filter=\"msdyn_status eq 1\",  # 1 = failed\n    select=[\"msdyn_name\", \"msdyn_starttime\", \"msdyn_exceptionmessage\"],\n    orderby=[\"msdyn_starttime desc\"],\n    top=5,\n)\n```\n\n### Validation error reference\n\n| Error | Cause | Fix |\n| --- | --- | --- |\n| Table not found after import | Component not in solution | Add via `pac solution add-solution-component` |\n| Form check fails immediately | Publishing is async | Wait 30 seconds and retry |\n| Role not assigned | User not provisioned | Assign the role via `pac admin assign-user` or the Power Platform Admin Center |\n| Import job at 0% | Import still running | Poll again in 60 seconds |\n\n## Notes\n\n- Always use `--managed false` \u002F `--packagetype Unmanaged` for the development solution. Managed packages are for deployment to downstream environments (test, prod).\n- `--activate-plugins` ensures any registered plugins in the solution are activated on import.\n- If you see \"solution already exists\" errors, use `--import-mode ForceUpgrade` to overwrite.\n- Large solutions (Sales, Customer Service) can take 10–20 minutes to import. Be patient and poll rather than re-importing.\n- All validation queries above require auth. Use `scripts\u002Fauth.py` for credential\u002Ftoken acquisition. See `dv-query` for SDK query patterns and `dv-data` for write patterns.\n","# Skill: Solution\n\nCreate, export, unpack, pack, import, and validate Dataverse solutions via PAC CLI. Includes post-import validation using the Python SDK.\n\n> **Headless \u002F restricted-egress hosts**: use the raw Web API (`ExportSolution` \u002F `ImportSolution`) for the online steps. `pac solution pack`\u002F`unpack` are local file operations (no auth) but need a host that can run PAC -- do them on a capable machine or CI runner. Verify egress with `python scripts\u002Fauth.py --check`. See `dv-connect\u002Freferences\u002Fheadless-hosts.md`.\n\n## Skill boundaries\n\n| Need | Use instead |\n|---|---|\n| Create tables, columns, relationships, forms, views | **dv-metadata** |\n| Create, update, or delete data records | **dv-data** |\n| Query or read records | **dv-query** |\n| Connect to Dataverse \u002F set up MCP | **dv-connect** |\n\n---\n\n## Create a New Solution\n\n**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.\n\n### Step 1: Find or Create the Publisher\n\nEvery 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.\n\n**Never use the default `new` prefix.** It provides no organizational identity, risks naming collisions, and signals the developer did not follow best practices.\n\n**Discovery flow — always run this before creating a publisher:**\n\n```python\nimport os, sys\nsys.path.insert(0, os.path.join(os.getcwd(), \"scripts\"))\nfrom auth import get_client\n\n# get_client sets a plugin attribution context on the User-Agent header.\n# Do not modify the context value — it is a closed schema for server-side\n# telemetry (app\u002Fskill\u002Fagent). Never include secrets or PII.\nclient = get_client(\"dv-solution\")\n\n# 1. Query for existing non-Microsoft publishers\npublishers = client.records.list(\n    \"publisher\",\n    filter=\"customizationprefix ne 'none' and uniquename ne 'MicrosoftCorporation' and uniquename ne 'Microsoftdynamic'\",\n    select=[\"publisherid\", \"uniquename\", \"friendlyname\", \"customizationprefix\"],\n    top=10,\n)\n\nif publishers:\n    # Show existing publishers and ask user which to use\n    print(\"Existing publishers in this environment:\")\n    for p in publishers:\n        print(f\"  {p['uniquename']} (prefix: {p['customizationprefix']}_)\")\n    # ASK THE USER: \"Which publisher should this solution use?\"\n    # Or: \"Should I reuse '\u003Cname>' (prefix: \u003Cprefix>_)?\"\n    publisher_id = publishers[0][\"publisherid\"]  # after user confirms\nelse:\n    # No custom publisher exists — ASK THE USER for prefix\n    # \"What publisher prefix should I use? (e.g., 'contoso', 'sa', 'lit' — 2-8 lowercase chars)\"\n    publisher_id = client.records.create(\"publisher\", {\n        \"uniquename\": \"\u003Cpublisheruniquename>\",\n        \"friendlyname\": \"\u003CPublisher Display Name>\",\n        \"customizationprefix\": \"\u003Cprefix>\",   # from user input, NOT 'new'\n        \"description\": \"\u003Cdescription>\",\n    })\n```\n\n**Rules:**\n- **Always ask the user** before creating a new publisher or choosing a prefix. Never hardcode a prefix.\n- The prefix must match any tables already created in the solution — you cannot mix prefixes.\n- One publisher can own many solutions. Reuse an existing publisher when possible.\n\n### Step 2: Create the Solution Record\n\nUse the SDK to create the solution record (preferred over raw Web API):\n\n```python\nimport os, sys\nsys.path.insert(0, os.path.join(os.getcwd(), \"scripts\"))\nfrom auth import get_client\n\n# get_client sets a plugin attribution context on the User-Agent header.\n# Do not modify the context value — it is a closed schema for server-side\n# telemetry (app\u002Fskill\u002Fagent). Never include secrets or PII.\nclient = get_client(\"dv-solution\")\n\n# Create the solution record\nsolution_id = client.records.create(\"solution\", {\n    \"uniquename\": \"\u003CUniqueName>\",\n    \"friendlyname\": \"\u003CDisplay Name>\",\n    \"version\": \"1.0.0.0\",\n    \"publisherid@odata.bind\": \"\u002Fpublishers(\u003Cpublisher_guid>)\",\n})\nprint(f\"Created solution: {solution_id}\")\n```\n\nThe required fields:\n```\nTable:  solution\nFields: uniquename    = \"\u003CUniqueName>\"\n        friendlyname  = \"\u003CDisplay Name>\"\n        version       = \"1.0.0.0\"\n        publisherid   = \u003Cpublisher GUID from step 1>\n```\n\n> **Note:** There is no `pac solution create` command. PAC CLI handles export\u002Fimport\u002Fpack\u002Funpack, not solution record creation. Use the SDK or Web API to create the record.\n\n### Step 3: Add Components\n\nUse `pac solution add-solution-component` to add tables, forms, views, and other components:\n```\npac solution add-solution-component \\\n  --solutionUniqueName \u003CUniqueName> \\\n  --component \u003CComponentSchemaName> \\\n  --componentType \u003CTypeCode> \\\n  --environment \u003Curl>\n```\n\n> **Note:** PAC CLI uses camelCase args here (`--solutionUniqueName`, `--componentType`), not kebab-case.\n\nCommon component type codes:\n| Type Code | Component |\n|---|---|\n| 1 | Entity (Table) |\n| 2 | Attribute (Column) |\n| 26 | View |\n| 60 | Form |\n| 61 | Web Resource |\n| 300 | Canvas App |\n| 371 | Connector |\n\nRepeat the command for each component you need to add.\n\n### Alternative: Auto-add via MSCRM.SolutionName Header\n\nWhen creating metadata via the Web API, include the `MSCRM.SolutionName` header to auto-add components to the solution:\n```python\nheaders = {\n    \"Authorization\": f\"Bearer {token}\",\n    \"Content-Type\": \"application\u002Fjson\",\n    \"MSCRM.SolutionName\": \"\u003CUniqueName>\"\n}\n```\n\n**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):\n```python\nsol = client.records.list(\"solution\",\n    filter=\"uniquename eq '\u003CUniqueName>'\", select=[\"solutionid\"], top=1).first()\nif sol is not None:\n    components = client.records.list(\"solutioncomponent\",\n        filter=f\"_solutionid_value eq {sol['solutionid']}\",\n        select=[\"componenttype\", \"objectid\"])\n    print(f\"{len(components)} components in the solution\")\n```\n\nIf the header was misspelled or the solution doesn't exist, components will be created in the default solution instead — silently. Always verify.\n\n## Find the Solution Name\n\nBefore exporting, confirm the exact unique name:\n```\npac solution list --environment \u003Curl>\n```\nThe `UniqueName` column is what you pass to other commands. Display names have spaces; unique names do not.\n\n## Pull: Export + Unpack\n\n> **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.\n\nExport the solution as unmanaged (source of truth):\n```\npac solution export \\\n  --name \u003CUniqueName> \\\n  --path .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --managed false \\\n  --environment \u003Curl>\n```\n\nUnpack into editable source files:\n```\npac solution unpack \\\n  --zipfile .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --folder .\u002Fsolutions\u002F\u003CUniqueName> \\\n  --packagetype Unmanaged\n```\n\n> **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 `unpack` fails with a lock \u002F \"in use\" error, retry after a moment, and verify the unpacked folder has the expected components before deleting the zip.\n\nDelete the zip — the unpacked folder is the source:\n```\nrm .\u002Fsolutions\u002F\u003CUniqueName>.zip\n```\n\nCommit:\n```\ngit add .\u002Fsolutions\u002F\u003CUniqueName>\ngit commit -m \"chore: pull \u003CUniqueName> baseline\"\ngit push\n```\n\n## Push: Pack + Import\n\nPack the source files back into a zip:\n```\npac solution pack \\\n  --zipfile .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --folder .\u002Fsolutions\u002F\u003CUniqueName> \\\n  --packagetype Unmanaged\n```\n\nImport (async recommended for large solutions):\n```\npac solution import \\\n  --path .\u002Fsolutions\u002F\u003CUniqueName>.zip \\\n  --environment \u003Curl> \\\n  --async \\\n  --activate-plugins\n```\n\n## Poll Import Status\n\nAfter async import, check the job:\n```\npac solution list --environment \u003Curl>\n```\n\n## Post-Import Validation\n\nAfter importing a solution, verify that components are live. Use the Python SDK to check directly — no external scripts needed.\n\n### Check a table exists\n\n```python\ninfo = client.tables.get(\"\u003Clogical_name>\")\nif info:\n    print(f\"[PASS] Table '{info.logical_name}' exists\")\nelse:\n    print(f\"[FAIL] Table '\u003Clogical_name>' not found\")\n```\n\n### Check a form is published\n\n```python\nforms = client.records.list(\n    \"systemform\",\n    filter=\"objecttypecode eq '\u003Centity>' and type eq \u003Cform_type_code>\",\n    select=[\"name\", \"formid\"],\n    top=5,\n)\n# Form type codes: 2 = main, 7 = quick create\n```\n\n### Check a view exists\n\n```python\nviews = client.records.list(\n    \"savedquery\",\n    filter=\"returnedtypecode eq '\u003Centity>'\",\n    select=[\"name\", \"savedqueryid\", \"statuscode\"],\n    top=10,\n)\n```\n\n### Check a user's role assignment (N:N `$expand`)\n\n`records.list` passes `$expand` straight through, so read the N:N navigation property directly with the SDK:\n\n```python\nusers = list(client.records.list(\n    \"systemuser\",\n    filter=\"internalemailaddress eq '\u003Cemail>'\",   # fallback: domainname eq '\u003Cupn>'\n    select=[\"fullname\"],\n    expand=[\"systemuserroles_association($select=name)\"],\n    top=1,\n))\nroles = [r[\"name\"] for r in users[0].get(\"systemuserroles_association\", [])] if users else []\n```\n\nAlternatively, the managed **Dataverse CLI** escape hatch (`dataverse api request` — not `urllib`), or FetchXML with a link-entity:\n\n```bash\ndataverse api request --target dataverse --method GET \\\n  --path \"\u002Fapi\u002Fdata\u002Fv9.2\u002Fsystemusers?%24filter=internalemailaddress eq '\u003Cemail>'&%24select=fullname&%24expand=systemuserroles_association(%24select=name)&%24top=1\" \\\n  --environment \u003CDATAVERSE_URL> \\\n  --context \"app=dataverse-skills\u002F\u003Cver>;skill=dv-solution;agent=\u003Cagent>\"\n```\n\nThe response `value[0].systemuserroles_association` is the list of assigned roles (each with `name`).\n\n### Check import errors\n\n```python\njobs = client.records.list(\n    \"importjob\",\n    select=[\"importjobid\", \"solutionname\", \"startedon\", \"completedon\", \"progress\"],\n    orderby=[\"startedon desc\"],\n    top=5,\n)\n```\n\nFor detailed error history, also query `msdyn_solutionhistory`:\n\n```python\nhistory = client.records.list(\n    \"msdyn_solutionhistory\",\n    filter=\"msdyn_status eq 1\",  # 1 = failed\n    select=[\"msdyn_name\", \"msdyn_starttime\", \"msdyn_exceptionmessage\"],\n    orderby=[\"msdyn_starttime desc\"],\n    top=5,\n)\n```\n\n### Validation error reference\n\n| Error | Cause | Fix |\n| --- | --- | --- |\n| Table not found after import | Component not in solution | Add via `pac solution add-solution-component` |\n| Form check fails immediately | Publishing is async | Wait 30 seconds and retry |\n| Role not assigned | User not provisioned | Assign the role via `pac admin assign-user` or the Power Platform Admin Center |\n| Import job at 0% | Import still running | Poll again in 60 seconds |\n\n## Notes\n\n- Always use `--managed false` \u002F `--packagetype Unmanaged` for the development solution. Managed packages are for deployment to downstream environments (test, prod).\n- `--activate-plugins` ensures any registered plugins in the solution are activated on import.\n- If you see \"solution already exists\" errors, use `--import-mode ForceUpgrade` to overwrite.\n- Large solutions (Sales, Customer Service) can take 10–20 minutes to import. Be patient and poll rather than re-importing.\n- All validation queries above require auth. Use `scripts\u002Fauth.py` for credential\u002Ftoken acquisition. See `dv-query` for SDK query patterns and `dv-data` for write patterns.\n",{"name":5,"description":7},"main","108370ef5d61358835af476c22c555dadefc55d0",".github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-solution",65,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 08:33:20",{"source":9,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add microsoft\u002FDataverse-skills --skill dv-solution",{"tool":56,"command":57},"bunx","bunx skills add microsoft\u002FDataverse-skills --skill dv-solution",{"tool":59,"command":60},"pnpm","pnpm dlx skills add microsoft\u002FDataverse-skills --skill dv-solution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-solution\u002FSKILL.md",true,[],[65,92,122,139,171,199],{"skillNo":66,"name":67,"nameZh":17,"description":68,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":36},"01M6PJ8NCTZS7PZ5AVHXERS10A","erp-sql","Temporary Finance and Operations SQL access and bounded physical-table reads for unified development environments (UDEs) only, requiring the environment System administrator (sysAdmin) role. Use when the user explicitly requests direct ERP SQL access, a temporary SQL password, a sqlcmd connection, or a table read in an established ERP SQL workflow.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Ferp-sql\u002FSKILL.md",[],[72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91],"erp sql","sql","erp","use","password","requests","only","development","table","bounded","environments","direct","read","workflow","access","environment","system","operations","sqlcmd","for",{"skillNo":93,"name":94,"nameZh":95,"description":96,"descriptionZh":97,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":98,"categories":99,"keywords":104,"publishedAt":36},"01M69AR6XKM814KPH4PEEQE7R7","erp-xpp","X++ 代码开发与部署","X++ code development lifecycle for Finance and Operations — scaffold models, author classes, custom services\u002FAPIs, and data entities, install matching SDKs, compile deployable packages, deploy packages, synchronize databases, and verify deployed artifacts. Use when the user explicitly requests creating, building, compiling, packaging, deploying, DB-syncing, or verifying X++ customizations, or an end-to-end ERP code change.","面向 Finance and Operations 的 X++ 代码开发生命周期——搭建模型、编写类、自定义服务\u002FAPI 和数据实体，安装匹配的 SDK，编译可部署包、部署包、同步数据库，并验证已部署的工件。当用户明确要求创建、构建、编译、打包、部署 X++ 自定义项、同步数据库或进行验证，或进行端到端的 ERP 代码变更时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Ferp-xpp\u002FSKILL.md",[100,101],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":102,"categoryName":103,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QVANT4709358VEJK53E","代码实现",[105,106,74,107,91,108,109,110,111,112,113,114,115,116,117,118,79,119,120,121],"xpp","erp xpp","compiling","data","install","packages","sdks","code","end","packaging","db","databases","development lifecycle","change","custom","lifecycle","compile",{"skillNo":123,"name":124,"nameZh":125,"description":126,"descriptionZh":127,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":128,"categories":129,"keywords":136,"publishedAt":36},"01M69AR0SGRQFYSFT071ZAS19V","dv-security","Dataverse 安全权限管理","Security-role assignment, user access, application users, business units, and admin self-elevation in Dataverse environments. Use when the user wants to give someone access, grant a role, become an admin, or add a service principal.","Dataverse 环境中的安全角色分配、用户访问、应用程序用户、业务单元以及管理员自我提权。当用户想要授予某人访问权限、授予角色、成为管理员或添加服务主体时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-security\u002FSKILL.md",[130,133],{"categoryNo":131,"categoryName":132,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师",{"categoryNo":134,"categoryName":135,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTFDX7M21YT75733H52N36","身份与访问管理",[137,138,34],"security","dv security",{"skillNo":140,"name":141,"nameZh":142,"description":143,"descriptionZh":144,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":145,"categories":146,"keywords":153,"publishedAt":36},"01M69AQX9TXX472D6Q59RYSMXY","dv-query","Dataverse 数据查询分析","Bulk reads, multi-page iteration, and analytics over Dataverse data. Use when the user wants to read, list, filter, aggregate, group, join, or analyze records — including pandas DataFrame workflows and notebook exploration. Also covers ERP (Finance and Operations \u002F F&O) business-data reads and runtime entity, schema, or action discovery; load dv-overview first, then this skill.","对 Dataverse 数据进行批量读取、多页迭代和分析。当用户想要读取、列出、筛选、聚合、分组、联接或分析记录时使用——包括 pandas DataFrame 工作流和 notebook 探索。还涵盖 ERP（Finance and Operations \u002F F&O）业务数据读取，以及运行时实体、架构或操作发现；请先加载 dv-overview，再加载本技能。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-query\u002FSKILL.md",[147,150],{"categoryNo":148,"categoryName":149,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQGD4CMBM6B4PWSM1NXGT9","数据分析与报告",{"categoryNo":151,"categoryName":152,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5CX980XNXCJKQF70BY","数据分析师",[154,155,156,157,158,159,75,160,161,162,84,163,164,165,166,167,168,34,169,170],"dv query","query","analyze","pandas","bulk","user","records","discovery","list","dataframe","filter","join","notebook","iteration","exploration","workflows","analytics",{"skillNo":172,"name":173,"nameZh":174,"description":175,"descriptionZh":176,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":177,"categories":178,"keywords":183,"publishedAt":36},"01M69AQSP7EV1XGQAA69Y9MJ8Y","dv-overview","Dataverse\u002FPower Platform 总览","Foundational cross-cutting context for Dataverse \u002F Power Platform work — scope and the skill map, the tool-capability reference, the safety rules, and the safe change lifecycle. Use when the user mentions Dataverse, Dynamics 365, Power Platform, CRM, or ERP; load this first for orientation. Specialist skills self-route via their own frontmatter triggers. Finance and Operations \u002F F&O business-data requests also require this skill first, then dv-query for reads.","Dataverse \u002F Power Platform 工作的基础性跨领域上下文——包括范围与技能图谱、工具能力参考、安全规则以及安全变更生命周期。当用户提及 Dataverse、Dynamics 365、Power Platform、CRM 或 ERP 时使用；应首先加载此技能以进行定位。专家技能通过其自身的 frontmatter 触发器自行路由。财务与运营（Finance and Operations \u002F F&O）业务数据请求也需要先加载此技能，然后再使用 dv-query 进行读取。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-overview\u002FSKILL.md",[179,180],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":181,"categoryName":182,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BWKS60NTYJHFE9FQSXGDKS","低代码应用开发",[184,185,155,186,187,188,108,189,190,191,192,193,74,194,195,196,197,34,198,118],"dv overview","overview","capability","context","frontmatter","Safety","crm","work","route","self","map","skill map","scope","power","safe",{"skillNo":200,"name":201,"nameZh":202,"description":203,"descriptionZh":204,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":205,"categories":206,"keywords":209,"publishedAt":36},"01M69AQP3WCSN3K3DCRD0E2PFF","dv-metadata","Dataverse 数据模型设计与查看","Dataverse schema authoring and inspection — tables, columns, relationships, forms, and views. Use when the user wants to define, evolve, or inspect the data model — add a column, create a table, set up a lookup, customize a form, build a view, or list existing columns and relationships.","Dataverse 架构编写与检查——表、列、关系、表单和视图。当用户希望定义、演进或检查数据模型时使用——添加列、创建表、设置查找（lookup）、自定义表单、构建视图，或列出现有的列和关系。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDataverse-skills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fdataverse\u002Fskills\u002Fdv-metadata\u002FSKILL.md",[207,208],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":181,"categoryName":182,"taxonomyType":28,"taxonomyTypeDesc":29},[210,211,34],"dv metadata","customize"]