Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power Platform + Business Central Integration Patterns

Power Platform Business Central Power BI Azure License

Production-tested patterns for connecting Power Platform to Business Central.
FlexAPI design, Power Automate flows, Canvas App templates, and Azure Function middleware — built from real enterprise consulting projects.


🎯 What This Repo Covers

Business Central is powerful as an ERP, but it becomes transformative when integrated with Power Platform. The challenge: BC's native connectors have limitations, API complexity is high, and most teams struggle with authentication, pagination, and error handling.

This repository provides reusable patterns that solve real integration problems:

  • FlexAPI — Configurable API layer exposing BC data for Fabric & Power BI
  • Power Automate — Approval workflows, document routing, event-driven triggers from BC
  • Power Apps — Canvas App patterns for non-BC-licensed users (purchase requests, approvals)
  • Azure Functions — Middleware for BC ↔ Blob Storage, document processing, webhook handling
  • Power BI — DirectQuery and Import patterns for BC reporting

🏗️ Architecture Overview

┌──────────────────────────────────────────────────────────────────────┐
│                     USER INTERACTION LAYER                           │
│                                                                      │
│   ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐      │
│   │  Power Apps  │  │   Power BI   │  │  Teams / Outlook     │      │
│   │  Canvas App  │  │  Dashboards  │  │  Adaptive Cards      │      │
│   └──────┬───────┘  └──────┬───────┘  └──────────┬───────────┘      │
└──────────┼─────────────────┼─────────────────────┼──────────────────┘
           │                 │                     │
┌──────────▼─────────────────▼─────────────────────▼──────────────────┐
│                     INTEGRATION LAYER                                │
│                                                                      │
│   ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐      │
│   │   FlexAPI    │  │    Power     │  │   Azure Functions    │      │
│   │  (BC ext.)   │  │   Automate   │  │   (Middleware)       │      │
│   │              │  │              │  │                      │      │
│   │ - Custom API │  │ - Approvals  │  │ - BC → Blob sync    │      │
│   │ - Pagination │  │ - Doc route  │  │ - Webhook receiver   │      │
│   │ - Filtering  │  │ - BC events  │  │ - Doc processing     │      │
│   └──────┬───────┘  └──────┬───────┘  └──────────┬───────────┘      │
└──────────┼─────────────────┼─────────────────────┼──────────────────┘
           │                 │                     │
┌──────────▼─────────────────▼─────────────────────▼──────────────────┐
│                     DATA / ERP LAYER                                 │
│                                                                      │
│   ┌──────────────────────────────────────────────────────────┐      │
│   │                  Business Central                         │      │
│   │                                                          │      │
│   │  ┌────────┐  ┌────────────┐  ┌──────────┐  ┌─────────┐ │      │
│   │  │  APIs  │  │  Dataverse │  │  Events  │  │  Pages  │ │      │
│   │  │ (OData)│  │  (Virtual) │  │ (Webhook)│  │  (AL)   │ │      │
│   │  └────────┘  └────────────┘  └──────────┘  └─────────┘ │      │
│   └──────────────────────────────────────────────────────────┘      │
│                                                                      │
│   ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐      │
│   │  Azure Blob  │  │  Dataverse   │  │  Microsoft Fabric    │      │
│   │  Storage     │  │  (Tables)    │  │  (Lakehouse)         │      │
│   └──────────────┘  └──────────────┘  └──────────────────────┘      │
└──────────────────────────────────────────────────────────────────────┘

📁 Repository Structure

powerplatform-bc-integration-patterns/
│
├── README.md                              ← You are here
│
├── docs/
│   ├── flexapi-design.md                  ← FlexAPI: configurable BC API layer
│   ├── bc-connector-patterns.md           ← Power Automate ↔ BC connection guide
│   ├── canvas-app-bc-pattern.md           ← Power Apps Canvas App ↔ BC integration
│   ├── azure-function-middleware.md        ← Azure Function as BC middleware
│   └── authentication-guide.md            ← Azure AD / Entra ID auth patterns
│
├── samples/
│   ├── power-automate/
│   │   ├── bc-purchase-approval.json      ← Purchase order approval flow
│   │   └── bc-document-to-blob.json       ← BC document → Azure Blob flow
│   ├── power-apps/
│   │   └── purchase-request-schema.json   ← Canvas App data schema
│   └── flexapi-sample-response.json       ← FlexAPI endpoint response sample
│
├── templates/
│   ├── bc-integration-checklist.md        ← Pre-deployment checklist
│   ├── api-endpoint-catalog.json          ← Standard BC API endpoints reference
│   └── error-handling-patterns.md         ← Error handling & retry patterns
│
└── diagrams/
    └── integration-patterns.md            ← Mermaid diagrams for all patterns

🔑 Integration Patterns

Pattern 1: FlexAPI — Configurable BC Data Layer

Problem: BC's standard OData APIs return too much data, require complex filtering, and are hard to consume from Power BI / Fabric.

Solution: A custom BC extension (AL) that exposes a configurable API layer — clients define which entities and fields to expose, with built-in pagination and filtering.

Power BI / Fabric
       │
       ▼
   FlexAPI (BC Extension)
       │
       ├── /api/flex/v1/sales-orders?$top=1000&$filter=postingDate gt 2024-01-01
       ├── /api/flex/v1/customers?$select=no,name,balance
       └── /api/flex/v1/gl-entries?$filter=documentType eq 'Invoice'
       │
       ▼
   Business Central OData

See → docs/flexapi-design.md


Pattern 2: Purchase Approval Without BC Licence

Problem: Staff need to submit purchase requests, but BC licences are expensive (AUD $100+/user/month). Not every staff member needs ERP access.

Solution: Power Apps Canvas App → Dataverse → Power Automate → BC API. Staff use a free Canvas App; only the approval flow writes back to BC.

Staff (no BC licence)
       │
       ▼
   Canvas App (Power Apps)
       │
       ▼
   Dataverse (store request)
       │
       ▼
   Power Automate (approval)
       │
       ▼
   BC API (create purchase order)

See → docs/canvas-app-bc-pattern.md


Pattern 3: BC Document → Azure Blob → AI Processing

Problem: BC stores documents (invoices, receipts, contracts) inside the ERP. Extracting them for AI processing or archiving requires manual work.

Solution: BC extension triggers on document posting → Azure Function uploads to Blob → Document Intelligence processes → results write back to BC.

BC (document posted)
       │
       ▼
   Azure Function (webhook)
       │
       ▼
   Azure Blob Storage
       │
       ▼
   Document Intelligence (AI)
       │
       ▼
   BC API (update record with extracted data)

See → docs/azure-function-middleware.md


Pattern 4: BC Data → Fabric Lakehouse

Problem: BC reporting is limited to built-in reports and basic Power BI. Enterprise analytics needs a proper data platform.

Solution: FlexAPI exposes BC data → Fabric Data Pipeline ingests → Lakehouse stores → DirectLake serves Power BI.

Business Central
       │
       ▼
   FlexAPI (optimised endpoints)
       │
       ▼
   Fabric Data Pipeline (scheduled)
       │
       ▼
   Lakehouse (Bronze → Silver → Gold)
       │
       ▼
   Power BI (DirectLake)

See → fabric-lakehouse-architecture repo for the Lakehouse patterns.


⚡ Quick Start

For Power Automate flows

  1. Open samples/power-automate/ for flow definition samples
  2. Review docs/bc-connector-patterns.md for connection setup
  3. Import flow JSON into your Power Automate environment

For Canvas App patterns

  1. Review docs/canvas-app-bc-pattern.md for the architecture
  2. Use samples/power-apps/purchase-request-schema.json as Dataverse schema template
  3. Build Canvas App connecting to the schema

For FlexAPI

  1. Read docs/flexapi-design.md for API design principles
  2. Review samples/flexapi-sample-response.json for response format
  3. Deploy AL extension to BC sandbox for testing

🛡️ Key Design Decisions

Decision Choice Rationale
BC → Power Platform Dataverse as intermediary Decouples apps from BC directly; better offline support
Authentication Azure AD app registration Service-to-service; no user credentials stored
Document storage Azure Blob (not BC) Lower cost, AI-accessible, scalable
Reporting FlexAPI → Fabric → DirectLake Avoids overloading BC with report queries
Error handling Retry with exponential backoff BC API has rate limits; blind retry causes cascading failures
Canvas App licensing Power Apps per-app plan AUD $8/user/month vs BC licence AUD $100+/user/month

📊 Technology Stack

Layer Technology Purpose
ERP Business Central Core business data
API FlexAPI (AL Extension) Configurable data exposure
Apps Power Apps (Canvas) User interface for non-BC users
Automation Power Automate Workflow, approvals, integration
Storage Azure Blob Storage Document archive & AI processing
Middleware Azure Functions (C# / Python) Webhook handling, document sync
Data Platform Microsoft Fabric Enterprise analytics
Reporting Power BI (DirectLake) Business intelligence
Identity Microsoft Entra ID Authentication & authorisation
Data Store Dataverse Structured data for Power Apps

🤝 About

Built and maintained by Hung Nguyen — Microsoft Fabric & Power Platform Architect based in Brisbane, Australia.

  • 🎓 Certified: PL-600 | DP-600 | DP-700 | PL-300 | PL-200 | AI-102
  • 🌐 Portfolio
  • 💼 LinkedIn
  • 📺 MaiTechNote — Microsoft Power Apps micro-tutorials

📄 License

MIT License — free to use, adapt, and share with attribution.

About

Production-tested patterns for connecting Power Platform to Business Central. FlexAPI design, Power Automate flows, Canvas App templates, and Azure Function middleware — built from real enterprise consulting projects.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors