Repository navigation
Power Automate Integration
This guide explains how to use Power Automate to automatically trigger Azure Synapse pipelines when Business Central exports complete, creating an event-driven data integration solution.
- Overview
- Why Use Power Automate?
- Architecture
- Prerequisites
- Setup Steps
- How It Works
- Monitoring and Troubleshooting
Power Automate acts as a mediator between Business Central and Azure Synapse Analytics, enabling:
- ✅ Automatic pipeline triggering when BC exports complete
- ✅ Event-driven architecture (no manual intervention)
- ✅ Per-table consolidation (immediate processing)
- ✅ Extensible workflow for notifications and custom logic
Note: This integration is designed for Azure Data Lake Storage option only. Microsoft Fabric users should schedule notebooks directly.
- Manual pipeline triggering after BC exports
- Wait for all tables to export before consolidation
- Batch processing approach
- Requires user intervention
- ✅ Instant triggering: Pipeline starts as soon as a table export completes
- ✅ No manual steps: Fully automated workflow
- ✅ Per-table processing: Each table consolidated immediately
- ✅ Extensible: Easy to add notifications, approvals, error handling
- ✅ Loosely coupled: BC and Synapse don't directly communicate
- ✅ Future-proof: Easy to integrate additional services
- Real-time or near real-time data consolidation
- Event-driven workflows
- Multi-step integrations (e.g., export → consolidate → notify)
- Conditional processing based on export status
- Integration with Teams, Email, or other services
Inspired by Issue #84 and Issue #87
The Power Automate solution consists of multiple Cloud flows:

-
BC2ADLS - Trigger from Business Central event (Main flow)
- Listens for BC business events
- Validates export status
- Orchestrates child flows
-
BC2ADLS - Get Access Token (Child flow)
- Retrieves Azure AD token
- Centralized credential management
- Called by main flow
-
BC2ADLS - Get Queued/Running Synapse Pipelines (Child flow)
- Checks for existing pipeline runs
- Prevents duplicate executions
- Returns active pipeline count
-
BC2ADLS - Enqueue Azure Synapse Pipeline (Child flow)
- Triggers Synapse pipeline
- Passes parameters (container, entity, etc.)
- Returns execution ID
Business Central Export Completes
↓
Business Event Triggered
↓
Power Automate Receives Event
↓
Validate Export Status = Success
↓
Get Azure AD Access Token
↓
Check for Running Pipelines
↓
If No Conflicts → Trigger Synapse Pipeline
↓
Pipeline Consolidates Table Data
Before setting up Power Automate integration:
- ✅ Azure Data Lake Storage configured (setup guide)
- ✅ Azure Synapse workspace with pipelines deployed
- ✅ Business Central with bc2adls extension installed
- ✅ Power Automate license (included with Dynamics 365/Microsoft 365)
- ✅ Service Principal with Synapse permissions
- ✅ Power Platform environment connected to BC tenant
- Download the solution file:
powerAutomate/bc2adls_1_0_0_0.zip - Navigate to Power Automate portal
- Select your environment
- Go to Solutions in the left navigation
- Click Import solution
- Click Browse and select
bc2adls_1_0_0_0.zip - Click Next
- Review the solution details
- Click Import
Wait for the import to complete (may take a few minutes).
📖 Learn more about importing solutions
You need a Service Principal with permissions to execute Synapse pipelines.
If you already created one for bc2adls setup:
- Use the same Application ID and Secret
- Skip to granting Synapse permissions below
- Navigate to Azure Portal > Azure Active Directory > App registrations
- Click New registration
- Provide a name (e.g., "BC2ADLS-PowerAutomate")
- Select Accounts in this organizational directory only
- No redirect URI needed for this one
- Click Register
- Note the Application (client) ID and Directory (tenant) ID
- Go to Certificates & secrets > New client secret
- Add description and expiration
- Click Add and copy the secret value
- Open Azure Portal > Your Synapse workspace
- Navigate to Access Control (IAM)
- Click Add > Add role assignment
- Select role: Synapse Contributor or Synapse Administrator
- Click Next
- Click Select members
- Search for your service principal name
- Select it and click Select
- Click Review + assign

This flow manages authentication tokens for Synapse API calls.
- In Power Automate, go to Solutions > BC2ADLS
- Open the BC2ADLS - Get Access Token flow
- Click Edit
- Find the Initialize variable actions at the top
- Update the following variables:
| Variable | Value | Description |
|---|---|---|
| varTenantId | Your tenant ID | From Step 2 |
| varClientId | Your application ID | From Step 2 |
| varClientSecret | Your client secret | From Step 2 |
| varResource | https://dev.azuresynapse.net |
Synapse API endpoint |

- Click Save
- The client secret is stored as plain text in the flow
- Access tokens are visible in run history
- For better security, use Azure Key Vault connector to store secrets
- Or configure Managed Identity authentication on HTTP actions
This is the main flow that orchestrates the entire process.
- Open the BC2ADLS - Trigger from Business Central event flow
- Click Edit
- Find the Initialize variable actions
- Update the following variables:
| Variable | Value | Description |
|---|---|---|
| varAzureSubscriptionId | Your Azure subscription ID | Found in Azure Portal |
| varAzureResourceGroupName | Your resource group name | Where Synapse workspace is located |
| varAzureSynapseWorkspaceName | Your Synapse workspace name | From Synapse setup |
| varPipelineName | Consolidation_OneEntity |
Synapse pipeline to trigger |

Optional variables:
-
varDeleteDeltas:
trueorfalse- Delete deltas after successful consolidation - varSparkPoolName: Spark pool name or leave blank
- Click Save
- Close the flow editor
- In the solution, find BC2ADLS - Trigger from Business Central event
- Click the ... menu > Turn on
- Verify status changes to On
Enable the business event that triggers the flow:
- Open Business Central
- Search for Business Event Catalog
- Find event: ADLSE Execution - On Table Export Completed
- Set Enabled to Yes
- Configure endpoint:
- Endpoint URL: Your Power Automate trigger URL (auto-configured if using connector)
- Authentication: OAuth 2.0
Alternative: Use BC Connector in Power Automate
- The flow already includes the BC connector
- When you enable the flow, it automatically subscribes to the event
- No manual Business Event configuration needed
- BC exports a table to Azure Data Lake
- Export completes successfully
- BC fires business event: On Table Export Completed
-
Flow receives business event with payload:
{ "Company": "CRONUS International Ltd.", "TableID": 18, "TableName": "Customer", "ContainerName": "businesscentral", "Status": "Success", "Timestamp": "2025-01-15T10:30:00Z" } -
Flow checks Status field
- If not "Success": Flow stops (no pipeline trigger)
- If "Success": Continue to next step
- Flow calls BC2ADLS - Get Access Token child flow
- Child flow requests OAuth token from Azure AD:
POST https://login.microsoftonline.com/{tenant}/oauth2/token { "grant_type": "client_credentials", "client_id": "...", "client_secret": "...", "resource": "https://dev.azuresynapse.net" } - Returns access token to main flow
-
Flow calls BC2ADLS - Get Queued/Running Synapse Pipelines
-
Queries Synapse API for active runs:
GET https://management.azure.com/.../pipelineruns?api-version=2020-12-01 Filter: status=InProgress OR status=Queued Filter: parameters.entityName = current table -
Returns count of matching pipelines
-
If count > 0: Flow stops (prevents duplicate runs)
-
If count = 0: Continue to trigger
- Flow calls BC2ADLS - Enqueue Azure Synapse Pipeline
- Child flow triggers pipeline:
POST https://{workspace}.dev.azuresynapse.net/pipelines/Consolidation_OneEntity/createRun?api-version=2020-12-01 { "containerName": "businesscentral", "entityName": "Customer", "deleteDeltas": true, "sparkpoolName": "" } - Synapse returns run ID
- Pipeline starts executing
- Consolidation_OneEntity pipeline runs
- Consolidates deltas for the specific table
- Updates CDM manifest
- Creates shared metadata table (if Spark pool specified)
- Deletes deltas (if deleteDeltas = true)
| Aspect | Manual Trigger | Power Automate |
|---|---|---|
| Trigger | User clicks in Synapse Studio | Automatic on BC export complete |
| Pipeline | Consolidation_AllEntities | Consolidation_OneEntity |
| Timing | After all exports complete | Immediately per table |
| Tables | All tables at once | One table at a time |
| Intervention | Manual | Automatic |
| Delay | Batch (e.g., hourly/daily) | Real-time |
| Flexibility | Simple | Extensible workflow |
- Open Power Automate portal
- Go to My flows
- Find BC2ADLS - Trigger from Business Central event
- Click on the flow name
- View 28-day run history
Each run shows:
- Start time and duration
- Status (Succeeded, Failed, Cancelled)
- Inputs and outputs for each action
- Error messages if failed
- Open Synapse Studio
- Go to Monitor > Pipeline runs
- Filter by pipeline name: Consolidation_OneEntity
- Look for runs with your table name in parameters

Problem: BC export completes but flow doesn't run
Solutions:
- ✅ Verify flow is turned on
- ✅ Check Business Central business event is enabled
- ✅ Ensure Power Automate environment is correct
- ✅ Verify BC and Power Platform are in same tenant
- ✅ Check flow Connection References are valid
Problem: "401 Unauthorized" or "403 Forbidden" errors
Solutions:
- ✅ Verify service principal client ID and secret are correct
- ✅ Check service principal has Synapse Contributor role
- ✅ Ensure token resource is
https://dev.azuresynapse.net - ✅ Verify tenant ID is correct
- ✅ Check client secret hasn't expired
Problem: Flow succeeds but pipeline doesn't start
Solutions:
- ✅ Check Synapse workspace name is correct
- ✅ Verify pipeline name:
Consolidation_OneEntity - ✅ Ensure pipeline exists in Synapse workspace
- ✅ Check API version in HTTP request
- ✅ Review Synapse workspace firewall rules
Problem: Multiple pipelines running for same table
Solutions:
- ✅ Verify Get Queued/Running Pipelines flow is working
- ✅ Check filter logic in that flow
- ✅ Ensure proper delay between checks
- ✅ Review BC export isn't being triggered multiple times
- Edit the flow
- For each HTTP action, add Headers:
Content-Type: application/json - Check Inputs and Outputs in run history
- Test Get Access Token flow first
- Verify it returns a valid token
- Test Get Queued/Running Pipelines with manual inputs
- Test Enqueue Pipeline independently
- Finally test the main trigger flow
- Edit the flow
- Click Flow checker (top right)
- Review warnings and errors
- Fix issues before saving
Add a Send an email action after pipeline trigger:
- Edit the main flow
- Add action after Enqueue Pipeline
- Select Office 365 Outlook > Send an email (V2)
- Configure:
- To: Your email
-
Subject:
BC2ADLS: Table @{triggerBody()?['TableName']} exported - Body: Include table details and pipeline run ID
- Add Microsoft Teams connector
- Add action: Post message in a chat or channel
- Configure channel and message
- Include export status and links
Add conditions based on table name or company:
Condition:
triggerBody()?['TableName'] equals 'Customer'
If yes:
Trigger pipeline with special parameters
If no:
Trigger pipeline with standard parameters
- Add Scope action around pipeline trigger
- Add Configure run after to handle errors
- On failure:
- Send notification
- Log to SharePoint/SQL
- Retry with exponential backoff
Easily add integrations:
- ✅ Azure Logic Apps for complex workflows
- ✅ SharePoint for audit logging
- ✅ SQL Database for run tracking
- ✅ Azure Monitor for centralized logging
- ✅ Azure Functions for custom processing
✅ Use Azure Key Vault for secrets
- Store client secret in Key Vault
- Use Azure Key Vault connector in flow
- Retrieve secret dynamically
✅ Use Managed Identity
- Configure flow with System-Assigned Managed Identity
- Grant identity access to Synapse
- Remove client secret from flow
✅ Limit permissions
- Grant minimum required roles
- Use separate service principals for different environments
- Regularly rotate secrets
✅ Parallel processing
- Multiple tables can export and consolidate simultaneously
- Power Automate handles concurrency
✅ Optimize checks
- Keep Get Running Pipelines logic efficient
- Filter by parameters to reduce results
✅ Monitor limits
- Power Automate has execution limits
- Monitor flow runs per day
- Consider premium connectors if needed
✅ Document customizations
- Add comments in flow actions
- Maintain separate documentation
✅ Version control
- Export solution regularly
- Store in source control (Git)
- Track changes
✅ Test in non-production
- Test flow changes in sandbox environment
- Verify with test data
- Deploy to production after validation
Next: Execution Guide | Azure Data Lake Setup | Back to Home