Data source environment variables: proper ALM for SharePoint apps and flows
Environment variables are now built into canvas app and cloud flow authoring, so apps and flows can switch data sources between dev, test and production on import.

If you have ever moved a canvas app built on SharePoint from a dev environment to production, you know the pain. The app points at the dev site and list, so after import someone has to open it, remove the data source, add the production one and re-publish. Flows have the same problem. Casey Burke’s post on the Power Apps blog yesterday announces data source environment variables, which fix exactly this.
What was announced
Environment variables have existed in solutions for a while, but using them for data sources was awkward. Now they are built into the authoring experience for canvas apps and cloud flows, and into solution import.
Build
- When you add a data source to a canvas app, environment variables can be created automatically to hold the connection details. This is controlled by a setting in the app: “Automatically create environment variables when adding data sources”. It works for a limited set of connectors at the moment.
- The same environment variables can be reused across canvas apps, flows and other components in the solution.
- In cloud flows, you can insert environment variables directly into triggers and actions. Trigger support is limited to some connectors for now.
- You no longer need to query environment variables through the Dataverse connector, and using them no longer requires premium licences.
Deploy and automate
- When you import a solution, you can provide new values in the import UI.
- There are new and improved APIs for working with environment variables in code. Casey notes the APIs are live but the documentation is still being published.
- New build tasks and an ALM Accelerator are coming soon.
Govern
- Admins get more visibility of the data sources apps and flows use, and can retire and replace a production data source by changing the value, without editing the apps and flows.

How it works with SharePoint
The blog walks through a simple dev, QA and production example with SharePoint:
- Create a solution and a canvas app inside it, and turn on the auto-create setting.
- Add a SharePoint data source as normal. The app now connects through two environment variables: one for the site URL and one for the list.
- Add a button that creates a flow. In the SharePoint action, choose Enter custom value for the site address and list name, then pick the environment variables from the dynamic content list.
- Remove the environment variable values from the solution (not from the environment), export as managed, and import into the next environment.
- On import, pick a SharePoint connection for the connection reference and enter the new site and list values. Everything connects to the new site and list without editing.

Caveats
- Remove values before export. If the values stay in the solution, the import will not prompt you for new ones. This step is easy to forget, so put it in your release checklist.
- Security roles. Users need a security role that gives access to environment variables in Dataverse, as well as to the apps and flows. Sharing the app alone is not enough.
- Limited connectors. Auto-creation and trigger support do not cover every connector yet. Check the docs for the current list.
- Some UI is still rolling out. In flows, environment variables currently appear under a “Parameters” heading, which will be renamed “Environment variables”.
What I would do now
This, together with connection references, is what turns a solution into something you can actually move between environments without hand edits. For anyone running SharePoint-based apps across dev, test and production, it is one of the most useful ALM features this year.
Useful links
- Announcing data source environment variables (Power Apps Blog)
- Environment variables overview (Microsoft Docs)
- Use environment variables in Power Automate solution cloud flows (Microsoft Docs)
- Create a connection reference in a solution (Microsoft Docs)
- Overview of application lifecycle management with Microsoft Power Platform (Microsoft Docs)


