Azure Data Factory Pipeline Trigger & Monitor
On a schedule (or on-demand via a Power App), the flow kicks off an Azure Data Factory pipeline, polls its run status until completion, then reports success/failure with row counts and duration to Teams and emails the data team on failure with the ADF error detail and a monitor deep link.
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 orchestrates and monitors an Azure Data Factory (ADF) pipeline end-to-end from Power Automate. On a schedule it triggers a pipeline run, polls the run status in a Do Until loop until the run reaches a terminal state, then routes the outcome: a success card to a Microsoft Teams channel, and on failure/cancellation a Teams card plus a high-importance Outlook email to the data team containing the ADF error detail and a deep link into the ADF monitoring blade. Why it matters: ADF's own alerting is coarse and lives in the ADF portal. Wrapping a run in a flow gives business-friendly start triggers (a schedule, a button, an upstream event) and rich, routed notifications - no one has to sit watching the ADF monitor. The flow ships Off; going live requires only authorizing the three connections and setting the environment-variable values.
Use Case
Data-engineering teams want non-engineers to be able to kick off (or schedule) an ETL pipeline and receive clear, routed success/failure notifications instead of silent runs. This reference flow shows the canonical trigger -> create-run -> poll-until-done -> report pattern with a timeout-guarded Do Until and a Switch that fans out per outcome.
Flow Architecture
Schedule Pipeline Run
Recurrence (daily)Starts the run on a schedule. Swap for a PowerApps (V2) or manual trigger for on-demand runs.
Initialize variables (x14)
Initialize VariableBind each environment variable to a working variable (subscription, resource group, factory, pipeline, data-team email, monitor base URL, Teams group/channel) plus poll interval, correlation id, and loop-state variables.
Create Pipeline Run
Azure Data Factory CreatePipelineRunStarts the ADF pipeline; returns a runId.
Set Run Id
Set VariableCaptures the runId for polling and the monitor link.
Do Until Terminal
Do Until (limit 60 / PT2H)Loops until run status is terminal. Contains the five actions below.
Get Run Status
Azure Data Factory GetPipelineRunReads the current run status by pipelineRunName.
Set Run Status
Set VariableUpdates the loop-control variable that drives the exit condition.
Capture Duration
Set VariableCaptures durationInMs so it can be reported after the loop exits.
Capture Message
Set VariableCaptures the run message / error text for the failure notification.
Delay Between Polls
Delay (Wait)Waits the configured interval before the next poll.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AdfSubscriptionId | String | 00000000-0000-0000-0000-000000000000 | Azure subscription that hosts the Data Factory. |
| flowlibs_AdfResourceGroup | String | rg-data-prod | Resource group containing the factory. |
| flowlibs_AdfFactoryName | String | adf-enterprise-prod | Azure Data Factory instance name. |
| flowlibs_AdfPipelineName | String | DailyLoad | Pipeline to trigger and monitor. |
| flowlibs_DataTeamEmail | String | alerts@yourcompany.com | Recipient for failure notification emails. |
| flowlibs_AdfMonitorBaseUrl | String | https://adf.azure.com/en/monitoring/pipelineruns | Base URL for ADF monitoring deep links. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams group (team) ID for the notification channel. |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel ID for status messages. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure Data Factory | shared_azuredatafactory | CreatePipelineRun GetPipelineRun |
| Microsoft Teams | shared_teams | PostMessageToConversation |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
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.
- Pipeline parameters
- Pass run-time parameters (date window, source path) into Create Pipeline Run via the action's Parameters input (a JSON object), feeding values from the trigger.
- On-demand start
- Replace the Recurrence trigger with a PowerApps (V2) or manual trigger to let a user kick the pipeline off from an app or button; the rest of the flow is unchanged.
- Poll cadence and timeout
- Adjust Initialize Poll Interval Seconds (default 60s) and the Do Until limit (count 60 / timeout PT2H) so a hung pipeline cannot loop forever.
- Row counts
- GetPipelineRun returns status, duration, and message but not rows copied. To report row counts, add an ADF activity-runs query (or read a copy activity output) after the loop and include rowsCopied in the notifications.
- Chaining
- Add a second Create Pipeline Run that runs only if the first succeeds to build a dependency chain inside one flow.
- Routing
- Split the Switch default into explicit Failed and Cancelled cases if cancellations should notify differently.
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.01Terminal-state exit condition (Do Until)
Exits the poll loop once the run reaches a terminal state.
EXPR.02Capture run id (CreatePipelineRun output)
Reads the runId returned by the create action.
EXPR.03Read run status (GetPipelineRun output)
Reads the current run status each poll.
EXPR.04Run duration (minutes), from captured ms
Converts captured durationInMs into minutes for the report.
EXPR.05Monitor deep link
Builds the deep link into the ADF monitoring blade.
EXPR.06Per-run correlation id
Stamped on every notification for traceability.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.