Power Platform
What are environment variables in Power Platform?
Quick answer
Environment variables separate settings from logic: define a text, number, JSON, or data-source variable once, reference it from flows, apps, and Copilot Studio, then set a current value per environment while the default travels with the solution. The same flow calls the test API in Test and the production API in Production with zero edits — the canonical partner to connection references, which rebind systems while variables rebind values.
Key takeaways
- Defaults travel with the solution; current values differ per environment.
- Types cover text, numbers, JSON, and data sources.
- Secrets go to Key Vault; verify values after every deploy.
Detailed Explanation
Environment variables separate settings from logic: define a text, number, JSON, or data-source variable once, reference it from flows, apps, and Copilot Studio, then set a current value per environment while the default travels with the solution. The same flow calls the test API in Test and the production API in Production with zero edits — the canonical partner to connection references, which rebind systems while variables rebind values.
How it works
Create the variable in the solution, use it in place of hard-coded strings, and set current values after each import. Data-source variables swap entire tables or lists per environment for realistic testing.
Limitations and considerations
Secrets belong in Azure Key Vault references, not plain variables. Unset current values silently fall back to defaults — a classic “works in Dev, wrong system in Prod” cause; verify values post-deploy.
For broader context, see the Power Platform Hub — it collects the guides around this topic.
When to use it
Extract every URL, ID, threshold, and toggle the moment a solution targets more than one environment.
Practical example
A support flow reads its ticket-board URL and SLA-hours threshold from variables: 4 hours in Production, 99 in Test to avoid noise during validation.