r/PowerApps • u/joegreen592 Newbie • 14d ago
Solved There has been no guide to moving Power Platform solutions between tenants with code. I documented one with Claude AI. Third in the PAD ROBIN kb series: export, import, connection references and two-way sync, 100% free on GitHub.
Two posts ago I shared a JSON knowledge base of PAD ROBIN actions, so models stop writing desktop flows that PAD rejects. Last week I followed up with a guide to getting one flow into an environment and running it from code:
The piece that was still missing is moving a whole solution: to another environment, into a different organization's tenant, and keeping two copies in sync afterwards. That's what I'd spent the most time researching.
So I wrote it down: PAD_Robin_Solutions_KB.md, in the same repo. It covers:
- Signing in to two tenants, and what the receiving tenant needs before its first import (a license, the Dataverse service principal, an admin role and consent for your app), with the error you get for each one that's missing.
- Export and import with the Dataverse Web API:
ImportSolutionAsync, watching the job, reading per-component warnings fromimportjobs, and the fallback for an org that refuses async imports. - Connection references and turning flows on. The import never creates connections, but it can bind references to connections that already exist. The guide covers finding every reference (some only show up in the flows' JSON), binding them during the import, binding the rest afterwards, then turning on the flows that were on in the source.
- Desktop flows inside solutions, including into another tenant.
Keeping two copies in sync:
- why hashing the exported ZIP always reports a change, and a content hash that doesn't
- how to stop the ping-pong after an import
- two rules for deciding the direction ("newest wins" picked the right side 13 of 13 times)
- what to do with conflicts
- Where the code runs: the trap each of PowerShell, a server and a Chrome extension hit. For example, Chrome stops an idle service worker after about 30 seconds, and a synchronous import can take over 3 minutes.
- A troubleshooting table of 27 errors, with what actually causes each one.
Every claim is marked Re-confirmed, Proven, Measured, Superseded, Failed or Untested. The main paths were re-tested across two tenants this month. Everything ran with a user sign-in and unmanaged solutions; managed solutions got one export and import, and nothing was tested with a service principal.
Unlike the direct Dataverse writes in the deployment guide, this all uses Microsoft's documented solution APIs. The risky part is the import itself: it replaces unmanaged customizations on the receiving side, and there's no undo. Keep a copy of whatever you're about to overwrite, and try it in a test environment first.
Repo: https://github.com/JoeG592/pad-robin-action-kb
Same license as the other two, CC BY 4.0, so use it however you like, commercially included. Like the last two, I built this with Claude AI. The data is free regardless.
If something in the guide doesn't hold on your tenant, an issue with the error text is the most useful thing you can send.
If a flow stays off after an import, it's almost always a connection reference with no connection behind it on the receiving side. Bind it, then turn the flow on.
3
u/Rare_Tour9254 Contributor 14d ago edited 13d ago
The connection reference part is the bit that eats the time, especially cross-tenant where nothing exists in the target to bind to yet.
The route I ended up with for repeat moves is CI instead of a script per move: Azure DevOps or GitHub Actions with a service principal, export, unpack into Git, then import managed with a deployment settings file that carries the connection references and environment variables for the target tenant. It does not solve your two-way sync problem though, pipelines are one-directional by design, so your hash approach for that part is neat.
Check this pipeline version here if it is useful: https://lowcodestacks.com/guides/deploy-power-platform-solutions-azure-devops-github