Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 38 ยท Governance and Patterns

Environments, Solutions and Moving Flows Safely

Organize and ship flows professionally: environment types, solutions as containers, connection references, environment variables, managed versus unmanaged, and dev to production deployment.

You can build a flow in ten minutes and have it running for the whole company by lunch. That is the strength of the platform and also its risk. Flows edited live in production, owned by one person who then leaves, with a hard-coded SharePoint address that only exists in the test site, are the stuff of Monday-morning incidents. Environments and solutions are Power Platform's answer: a place to build, a package to move, and settings that change per place.

The admin pages are not available on this site, so the screens are described in words and the examples are stand-ins that model the ideas.

Environments

An environment is a container for your Power Platform resources: flows, apps, tables, connections, with its own security and data. Every tenant has a Default environment that all licensed users can use; admins create others. Common types:

Type Purpose
Default Created automatically. Everyone can build here. Good for personal productivity, not for important business processes
Production Live, business-critical solutions
Sandbox Testing and experiments; can be copied or reset
Developer A personal environment for one developer, usually free for learning
Trial Short-lived, for testing premium features

A typical layout is Dev -> Test -> Production environments for each important solution, plus the Default for personal flows. Each environment has its own region, its own users and security roles, and optionally a Dataverse database (required for solutions in most cases, and for some features such as approvals history and business process flows).

Switch environment with the environment picker at the top right of the portal. A flow lives in exactly one environment; to use it elsewhere, you export and import it (below), you do not "move" it live.

Solutions

A solution is a package that holds components together: cloud flows, desktop flows, apps, tables, connection references and environment variables. Solutions give you:

  • Packaging: export once, import into another environment.
  • Ownership: flows in a solution can be owned by the solution rather than a person, and a service principal can own them.
  • Version control: solutions have a version number and a publisher (a prefix for names).
  • Layers and managed deployment: production gets a managed solution that nobody can edit casually.

To create one: Solutions in the left navigation, New solution, give a display name, a publisher (create one with a short prefix such as contoso) and a version, then Add existing or New to put flows inside. Build new flows from inside the solution, so the connection references and variables are created properly.

Unmanaged and managed

  • Unmanaged solutions are for development: components can be edited and removed. You work in an unmanaged solution in the Dev environment.
  • Managed solutions are for deployment: the components are locked, the solution can be upgraded or removed as a whole, and customizations on top are layered separately. Export managed to Test and Production.
flowchart LR
    D["Dev environment<br/>unmanaged solution"] -->|"export managed, v1.1"| T["Test environment<br/>managed solution"]
    T -->|"approved"| P["Production environment<br/>managed solution"]

Build in Dev only. Test and production receive the same package, so what you tested is what runs.

Connection references

A flow action uses a connection, which belongs to a person's sign-in. If the flow had the connection built in, importing it into Production would fail or run as the developer. A connection reference is a named placeholder inside the solution ("Shared SharePoint connection"). On import, you pick or create the real connection in the target environment. The same flow then runs with Test credentials in Test and Production credentials in Production, with no editing.

Environment variables

Hard-coded values (a SharePoint site address, a list name, a mailbox, an approver group, a threshold) differ between environments. An environment variable is a named setting with a default value (shipped with the solution) and a current value (set per environment, not exported with the solution by default).

Types include Text, Decimal number, Yes/No, JSON, Data source (for example a SharePoint site or list) and Secret (stored in Azure Key Vault). In a flow you pick the variable as dynamic content, so the value is read at run time.

JS Stand-in: environment variables per environment

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Moving a solution

  1. In Dev, Publish all customizations, then bump the version.
  2. Export as managed (or unmanaged for source control). The solution checker can analyze it first.
  3. In the target environment, Import. The wizard asks you to map each connection reference and set environment variable values.
  4. Turn on the flows if they were imported off, and run a test.
  5. For upgrades, import the new version of the managed solution, which replaces components cleanly (and can delete ones you removed).

Teams automate this with Power Platform pipelines (a built-in deployment pipeline with approvals) or with Azure DevOps or GitHub Actions using the Power Platform CLI (pac) and build tools. The Power Platform CLI can also unpack a solution into readable files that you keep in Git, so changes are reviewed like code.

Ownership and sharing

  • Owner and co-owners can edit a flow. Add a team or at least two people so the flow survives someone leaving.
  • Run-only users can trigger a flow (such as an instant button flow) without editing it. For each connection you choose whether they use their own or the owner's credentials.
  • Service principals (an app registration) can own solution flows, which avoids a flow breaking when a person's account is disabled or password changes.
  • Security roles in the environment decide who can create, read and edit flows in it.

Practical rules

  • Do important work in a dedicated environment, not Default.
  • Build inside solutions; use connection references and environment variables from the first day.
  • Prefer a naming convention: [Dept] Process - Trigger (for example Finance - Invoice - New email).
  • Document each solution: purpose, owner, systems touched, what to do when it fails.
  • Keep exported solutions (unpacked) in source control.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main purpose of a connection reference in a solution?

    The reference names the connection; each environment maps it to its own credentials.
  2. 2. Which solution type should go to Production?

    Develop in unmanaged in Dev; deploy managed solutions to Test and Production.
  3. 3. A flow uses a SharePoint site address that differs per environment. Which feature handles it?

    Environment variables hold per-environment values without editing the flow.
  4. 4. Why use a service principal or a team as owner of important flows?

    Flows tied to one person are a business risk.

Summary

  • Environments separate Dev, Test and Production (and the Default environment is for personal use).
  • Solutions package flows with connection references and environment variables; develop unmanaged, deploy managed.
  • Connection references and environment variables make the same package run correctly in each environment.
  • Use pipelines or CLI-based automation, co-owners or service principals, and keep solutions in source control.

Next: Data Loss Prevention and Governance