Cross-Environment Solution Version Check
Scheduled flow queries solution version numbers across Dev, UAT, and Prod environments via the Power Platform API (HTTP). Compares versions and flags any environment where the solution is behind the expected version. Logs drift to Dataverse and sends an Outlook report so teams can identify stalled deployments.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow monitors solution version numbers across multiple Power Platform environments (Dev, UAT, Prod, etc.) and generates a consolidated version report. It uses the BAP Admin API via HTTP to query solutions in each environment, logs every version entry to a Dataverse tracking table, and emails a styled HTML report highlighting version differences and missing solutions.
Use Case
Stalled deployments are one of the most common ALM issues in Power Platform. A solution may be promoted from Dev to UAT but never make it to Production, or a hotfix deployed directly to Prod may not be backported to Dev. This flow provides a weekly "state of the world" snapshot showing exactly which version of each monitored solution is installed in each environment — or whether the solution is missing entirely. Teams can use this data to identify deployment gaps, enforce promotion cadence, and prevent environment drift before it causes production issues.
Flow Architecture
Recurrence
RecurrenceWeekly on Monday at 8:00 AM UTC.
10× Parallel Initialize Variable
Initialize variableBinds 7 environment variables to runtime variables and initializes 3 working variables: varTenantId ← flowlibs_GraphTenantId; varClientId ← flowlibs_GraphClientId; varClientSecret ← flowlibs_GraphClientSecret; varAdminEmail ← flowlibs_AdminNotificationEmail; varDriftTable ← flowlibs_SolutionVersionDriftTable; varMonitoredSolutions ← flowlibs_MonitoredSolutionNames; varMonitoredEnvironments ← flowlibs_MonitoredEnvironments; varDriftAlertHtml (empty string accumulator for HTML table rows); varDriftCount (integer counter for entries processed); varCheckTimestamp (utcNow() snapshot for consistent timestamps).
Split Solution Names
ComposeSplits the comma-separated solution list into an array using split(variables('varMonitoredSolutions'), ',').
Split Environment IDs
ComposeSplits the comma-separated environment ID list into an array using split(variables('varMonitoredEnvironments'), ',').
For Each Environment
Apply to eachIterates over each environment ID. For each: (a) Get Solutions In Environment (HTTP) — GET https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/scopes/admin/environments/{envId}/solutions?api-version=2021-02-01 with ActiveDirectoryOAuth authentication (audience: https://api.bap.microsoft.com/); (b) Parse Solutions Response (ParseJson) — extracts solution name, uniqueName, and version from the BAP API response; (c) For Each Monitored Solution (nested Apply to each) — for each monitored solution name, runs Filter Matching Solution and the Check If Solution Found condition described below.
If Solution Found
If conditionInside the nested For Each Monitored Solution: length(body('Filter_Matching_Solution')) > 0 — does the BAP response contain the monitored solution?
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GraphTenantId | String | <your-tenant-id> | Azure AD tenant for OAuth. Set to your tenant GUID. |
| flowlibs_GraphClientId | String | <configure> | App registration client ID used to acquire a token for the BAP Admin API. |
| flowlibs_GraphClientSecret | String | <configure> | App registration secret used to acquire a token for the BAP Admin API. Store securely; rotate per your policy. |
| flowlibs_AdminNotificationEmail | String | admin@yourcompany.com | Recipient address that receives the weekly version report email. |
| flowlibs_SolutionVersionDriftTable | String | flowlibs_solutionversiondrifts | Logical name of the Dataverse table used to log version drift entries. |
| flowlibs_MonitoredSolutionNames | String | FlowLibsCrossEnvSolnVersionCheck | Comma-separated list of solution unique names (not display names) to monitor. |
| flowlibs_MonitoredEnvironments | String | Default-<your-tenant-id> | Comma-separated list of environment IDs to query. Default environments follow the format Default-{tenant-guid}. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord (log version drift entries) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (send the version report email) |
| HTTP | built-in | HTTP (BAP Admin API calls with AAD OAuth (ActiveDirectoryOAuth, audience https://api.bap.microsoft.com/)) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Adding more environments
- Update the flowlibs_MonitoredEnvironments environment variable with a comma-separated list of environment IDs. Each environment ID follows the format Default-{tenant-guid} for default environments or a specific environment GUID for non-default ones.
- Adding more solutions to monitor
- Update the flowlibs_MonitoredSolutionNames environment variable with a comma-separated list of solution unique names (not display names).
- Changing the schedule
- Edit the Recurrence trigger to adjust frequency. For daily monitoring, change to "frequency": "Day", "interval": 1.
- App registration requirements
- The flow uses an Azure AD app registration for BAP Admin API access. The app needs API Permission https://api.bap.microsoft.com/.default (Application) and a tenant role of Power Platform Administrator or Global Administrator.
- Extending with version comparison
- The current flow logs every version it finds. To add drift detection (comparing against a "reference" environment), add a Compose action after the outer Foreach that groups entries by solution name and compares version strings across environments. Use first(filter(allEntries, solutionName and refEnvId)) to get the reference version, then flag mismatches.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Split comma-separated env var into array
Turns the comma-separated solution list env var into an array for iteration.
EXPR.02BAP Admin API URL construction
Builds the per-environment BAP Admin API endpoint inside the outer Apply to each.
EXPR.03Filter matching solution by uniqueName
Used inside the Filter array action to find the monitored solution in the BAP response.
EXPR.04Extract version from first match
Reads the version string from the first (and only) filtered match.
EXPR.05Composite primary key for Dataverse record
Builds a unique row key combining solution, environment, and check timestamp.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.