Connecting Business Central to Azure: Patterns, Trade-offs, and Where to Start

Note: This blog is a personal notebook. I write it to record what I work on, for my own reference, not to publish it on social media or to promote myself. If a post is still useful to you, I am glad, but that is not why it exists.

This post was published on November 08, 2025. Software versions, product features, links, and tool availability may have changed since then. Always check official documentation for the latest information. Some screenshots show small details. Zoom in on the page to see them clearly.

Business Central is a cloud-first ERP system, but not a closed one. Most installations must send data to other systems, move heavy logic elsewhere, or expose data to outside consumers. This post maps the main Azure services to those needs.

Problem

AL extensions run in Microsoft’s managed SaaS environment. To keep the platform stable for all tenants, cloud extensions have no direct .NET access, no file system, and no message broker, and outbound calls are rate limited.

Real projects need more. A posted sales order must trigger a fulfilment system, payment keys must stay out of the code, and operations must see the nightly batch before a customer complains.

Without an Azure strategy, teams use point-to-point HTTP calls, credentials in AL code, or manual file transfers. These work in a sandbox and fail under load or in an audit.

Why this matters

The wrong pattern gets more expensive over time. Common mistakes are a direct HTTP call where a queue is needed, a Logic App where a Function is cheaper, and a shared secret where a Managed Identity is available.

A direct call is like a visitor at your door: you must be home. A queue is a letterbox: the sender drops the message, and the receiver collects it when ready.

AL now has codeunits for Azure Storage, Azure Functions, and Key Vault. That makes it easy to start, and easy to build without thinking about boundaries.

Architecture

Business Central is in the center, with the AL codeunits, the API pages, the event publishers, and the integration log tables.

Azure service BC use case Pattern
Service Bus Decoupled messaging with CRM, e-commerce, WMS Write-back (async)
Logic Apps Low-code workflow automation, BC connector Read / write-back
Azure Functions Serverless logic, .NET offload, third-party calls Write-back (sync or async)
Blob Storage File export/import, report archival, large data Read / write-back
Key Vault Secrets, certificates, API keys Read-only (from BC)
API Management Managed, secured API gateway over BC’s APIs Read-only / write-back
Application Insights BC telemetry, integration monitoring, alerting Read-only
Entra ID User auth, OAuth for API callers Trust boundary

Inside Business Central: AL calls out with HttpClient or the Azure Functions system codeunit. The standard API pages (/api/v2.0/) receive inbound reads and writes. AL keeps no open connections and no background threads, so each call is separate and has the standard timeout.

Outside Business Central: Azure supplies the storage, routing, orchestration, and compute. Business Central reads Key Vault secrets at run time through the Azure Key Vault system codeunit.

Trust boundary: Outbound calls use OAuth (Entra ID app registrations) or connection strings from Key Vault. Inbound callers use Entra ID tokens. Never use basic authentication in production, and prefer a Managed Identity where the service allows it.

Data boundary: Data that leaves Business Central stays in the same Entra ID tenant. Application Insights telemetry holds operation metadata by default, not business records.

Demo steps

Business Central sends a message to a Service Bus queue when a user posts a sales order.

  1. Prerequisites: An Azure subscription, a Service Bus namespace (Standard tier), a Business Central sandbox, and an AL project.

  2. Setup: Create a queue. Register an Entra ID app with the Azure Service Bus Data Sender role, and store the connection string in Key Vault. Write a codeunit that reads the secret with AzureKeyVault.GetAzureKeyVaultSecret() and posts to the Service Bus REST endpoint.

  3. Trigger: Subscribe to OnAfterPostSalesDocument and call the codeunit with the order number and posting date.

  4. Expected outcome: One message per posted order, with order number, customer number, and amount. An Azure Function reads the queue and writes a log entry.

  5. Verification: Post a test order. Check the message count in Service Bus Explorer and the order number in the Function log stream.

What is intentionally simple

  • One queue, one direction: Business Central to Azure
  • No dead-letter handling, retry policy, or integration log table
  • A connection string in Key Vault, not a Managed Identity
  • A minimal JSON payload
  • No API Management in front of the inbound API

Risks/limits

  • Rate limits: Outbound calls are limited per tenant. At high volume, use batches or a job queue.
  • Synchronous failures: A failed call in an event subscriber shows an AL error. Without retry logic, a short Azure failure stops the user’s work.
  • Secret rotation: Business Central can cache a secret for the session, so a rotated Key Vault secret can break authentication during the day.
  • Logic Apps run history: It stores the input and output of each action by default. Mask sensitive fields.
  • Cost at scale: Logic Apps and Service Bus are cheap at low volume, so calculate the volume before you pick a tier.

Next iteration

  • Use a Managed Identity instead of the connection string
  • Log the send status of each document in an AL table
  • Alert on the dead-letter queue with Azure Monitor
  • Trace end to end with Application Insights
  • Put API Management in front of the inbound API

Closing note

Azure extends good AL design. It does not replace it. Pick the service that fits each problem, and define the data boundary and error strategy first. Without them, the integration becomes fragile.

← Back to Integrations