Skip to content

Solutions

pete-mc edited this page Jul 9, 2026 · 15 revisions

Solutions

A Solution project lets you export a Dataverse solution to source control, unpack it into individual components, and pack/import it again — the foundation of a healthy Application Lifecycle Management (ALM) workflow. Under the hood it uses the cross-platform Power Platform CLI (pac) (pac solution export/unpack/pack/import), so it runs on Windows, macOS, and Linux.

Solution menu

Steps: PrerequisitesConfigureExtractEdit & commitPackDeployCI/CD.


Prerequisites


Step 1 — Configure the solution

Solution settings live in spkl.json in the project root. This is now just a config file — no external tool is involved (the name is kept for backward compatibility):

{
  "solutions": [
    {
      "solution_uniquename": "MySolution",
      "packagepath": "MySolution",
      "packagetype": "both_unmanaged_import"
    }
  ]
}
Field Meaning
solution_uniquename The unique name of the solution in Dataverse (not the display name).
packagepath The folder the solution is unpacked into / packed from.
packagetype Unmanaged, Managed, or Both.

Tip: develop in unmanaged, ship managed. Both exports and unpacks the unmanaged and managed versions together, so you can source-control both. See managed vs unmanaged solutions.


Step 2 — Extract (export + unpack)

Run Dataverse PowerTools: Extract Solution. This exports the solution from your environment and unpacks it into packagepath, splitting it into per-component files — ideal for source control and diffing.

Verify: packagepath fills with folders like Entities/, WebResources/, Other/, and the output log shows the export completing.


Step 3 — Edit and commit

Edit the unpacked component files (or make changes in the maker portal and re-extract), then commit them to source control. Per-component files mean meaningful diffs and reviewable pull requests, instead of an opaque .zip.


Step 4 — Pack

Run Dataverse PowerTools: Pack Solution to pack the unpacked folder back into a solution .zip under bin/. This is a local operation — no connection required — so it's what a CI pipeline runs to produce a release artifact.

Verify: a .zip appears under bin/.


Step 5 — Deploy (import)

Run Dataverse PowerTools: Deploy Solution to pack the folder and import it into your connected environment, publishing customizations. Use this to push local changes to a development environment.

Verify: the solution appears/updates in the target environment; the log shows the import completing.

For higher environments (test/prod), prefer importing a managed solution built by your pipeline rather than deploying unmanaged from a dev machine — see Healthy ALM.


CI/CD

Because packing and importing are plain pac commands with no editor dependency, reuse the same packagepath folder in any pipeline (GitHub Actions, Azure DevOps, etc.) with the Power Platform CLI or the Power Platform Build Tools:

pac solution pack   --zipfile out/MySolution.zip --folder MySolution --packagetype Managed
pac solution import --path    out/MySolution.zip --environment https://target.crm.dynamics.com

Troubleshooting

Symptom Fix
No spkl.json found Make sure you initialised a Solution project; spkl.json must be in the workspace root.
Export/import fails to authenticate Re-connect — see Refreshing a stale connection.
Wrong solution exported Check solution_uniquename is the unique name (maker portal → Solutions → the value under "Name", not "Display name").
Import succeeds but changes aren't visible Customizations are published on import; if a specific component looks stale, re-extract and confirm it's in packagepath.

Learn more

Clone this wiki locally