Building an IFS Integration with Azure Service Bus

Building an IFS Integration with Azure Service Bus

Event-driven IFS integration using Azure Service Bus — publishing IFS events to a queue, consuming them in a microservice, invoking verified IFS projection operations, and designing for reliability.

Published

IFSIFS CloudAzureService BusIntegrationMicroservicesEvent-Driven

In today's enterprise landscape, IFS Cloud stands out as a powerful, cloud-native ERP solution. Yet modern businesses rarely run on a single system. The real challenge—and opportunity—lies in connecting IFS Cloud to the broader ecosystem: external microservices, specialized processors, legacy systems, and third-party APIs. This is where event-driven integration with Azure Service Bus becomes invaluable.

Azure Service Bus can decouple a suitable IFS event from downstream processing. Independent workers consume durable messages, process them asynchronously, and, where the business contract requires it, call a documented IFS projection operation. The broker supplies useful primitives; the integration still has to provide authentication, idempotency, reconciliation, schema governance and monitoring.

This guide walks you through the entire pattern: setting up IFS Cloud to publish events, building an Azure Service Bus topology, implementing a consumer microservice, writing back to IFS, and handling failures gracefully.

Why Event-Driven Integration for IFS?

The Problem with Synchronous Integrations

Traditional IFS integrations often rely on direct API calls—a process updates in IFS, your code calls an external API, and you wait for the result. Simple. Fragile.

What breaks this pattern:

  • External APIs go down. Your process hangs, blocking the user.
  • Spikes in volume overwhelm downstream systems.
  • No visibility into what happened if the call fails silently.
  • Tight coupling means changes in one system ripple everywhere.

The Event-Driven Solution

With Azure Service Bus as a message broker:

  1. IFS publishes an event (e.g., "PurchaseOrderCreated") to a Service Bus queue or topic.
  2. Your microservice subscribes and receives the message asynchronously.
  3. Processing happens independently—if the consumer is slow or down, messages queue safely.
  4. Write results back through a documented IFS action when the business process requires it; do not patch ERP status fields as an integration acknowledgement.
  5. Dead-letter handling isolates repeatedly failing messages for investigation and controlled replay.

This pattern gives you:

  • Resilience: Systems are decoupled; one failure doesn't cascade.
  • Scalability: Add more consumers to handle volume without redesigning IFS.
  • Traceability: Stable message IDs, broker metrics and application telemetry can form an operational trail when retention is configured.
  • Flexibility: Swap microservices, add new processors, or retire old ones without touching IFS.

Architecture Overview

Here's the complete flow:

┌──────────────────┐
│   IFS Cloud      │
│  (Event Source)  │
└────────┬─────────┘
         │
         │ Publishes event
         │ via REST Connector
         │
         ▼
┌──────────────────────────────┐
│  Azure Service Bus Namespace │
├──────────────────────────────┤
│  ┌────────────────────────┐  │
│  │  Topic: ifs-events     │  │
│  │                        │  │
│  │  Subscription:         │  │
│  │  order-processing      │  │
│  └────────────────────────┘  │
└──────────────┬───────────────┘
               │
               │ Consumes messages
               │
         ▼─────┴─────▼
  ┌─────────────┐ ┌──────────────┐
  │  Processor  │ │  Processor   │
  │  Instance 1 │ │  Instance 2  │
  └──────┬──────┘ └──────┬───────┘
         │                │
         └────────┬───────┘
                  │
                  │ Writes back results
                  │ via a projection action
                  │
                  ▼
          ┌──────────────────┐
          │   IFS Cloud      │
          │  (Result Sink)   │
          └──────────────────┘

Key Components:

  1. IFS Cloud: Publishes events to Service Bus when business events occur.
  2. Service Bus Topic: Receives and routes events to subscriptions.
  3. Microservices: Consumer applications that process events independently.
  4. IFS projection API: The exact published action/entity operation selected in API Explorer for any legitimate result write-back.

Step 1: Configuring IFS Cloud to Publish Events

Enable Event Publishing

IFS Cloud releases that expose REST Call event actions can publish a customer-defined event message through the integration framework. Navigation, sender authentication options and event parameters vary by release, so confirm them in the target tenant. The event names and payload fields below are illustrative, not standard contracts that every tenant contains.

1.1 Set Up Azure Service Bus Authentication

First, create a Service Bus namespace and queue/topic in Azure. For authentication, you have two main options:

Option A: Entity-scoped Shared Access Signature (SAS)

Service Bus send credential (store outside source control):
Endpoint=sb://your-namespace.servicebus.windows.net/;
SharedAccessKeyName=ifs-send-only;
SharedAccessKey=your_key_here

Never give IFS RootManageSharedAccessKey. Create a Send-only policy on the target topic/queue and rotate it. A SAS token sent over HTTPS is often the simplest direct REST option where supported.

Option B: Customer-owned Azure bridge with managed identity

An IFS SaaS workload cannot simply assume a managed identity in your Azure tenant. If avoiding a SAS credential in IFS is a requirement, publish to an authenticated API Management/Function bridge and let that customer-owned Azure workload use managed identity with the Azure Service Bus Data Sender role. A service principal is also distinct from managed identity and must be explicitly supported by the configured REST sender.

1.2 Configure IFS Event Action

In current IFS Cloud documentation, navigate to Solution Manager → Configuration → Events → Manage Event Actions, create a REST Call action, then enable and publish it. Labels differ in older releases:


Sample Event Payload (IFS sends this to Service Bus):


This is the resolved integration contract, not a built-in IFS envelope. Map only scalar parameters exposed by the chosen event. A REST Call event action cannot manufacture a full PO header/line graph or consume the downstream response; send keys/version data and let the worker read authoritative details when needed.

1.3 Message Format and Routing

For direct Service Bus REST publishing, use the data-plane queue/topic send URL and the documented Authorization/broker headers:

https://your-namespace.servicebus.windows.net/ifs-events/messages

Service Bus accepts the message only when the request is correctly authenticated and within size/quota limits. For direct REST publishing, set a valid BrokerProperties header containing a stable MessageId (and SessionId if sessions are enabled), using substitutions actually exposed by the IFS event. Delivery to consumers is at least once, so duplicates remain possible. A customer-owned bridge can set and validate these broker properties more easily than a direct event action.


Step 2: Setting Up Azure Service Bus

2.1 Create a Service Bus Namespace


2.2 Create a Topic and Subscription


2.3 Configure Access Policies

If direct IFS publishing uses SAS, create an entity-scoped Send policy. Run consumers on Azure with managed identity where possible; grant their identity Azure Service Bus Data Receiver at the narrowest scope instead of issuing another connection string.



Step 3: Building a Consumer Microservice

Your consumer microservice pulls messages from Service Bus, processes them, and writes results back to IFS.

3.1 C# Microservice Example


3.2 Node.js/TypeScript Alternative


acquireIfsAccessToken represents your OAuth client implementation: discover/use the configured token endpoint, cache the access token until shortly before its returned expiry, and obtain a new client-credentials token when needed. It must not return a token baked into the container image or environment indefinitely.


Step 4: Writing Results Back Through an IFS Projection

The consumer writes back only if IFS owns a meaningful part of the result. First find a standard action that represents that business operation. If none exists, design a narrow customer projection/action or keep integration telemetry in the integration store; do not add arbitrary processing flags to a standard purchase order.

4.1 Invoke the Declared Action


IFS_RESULT_ACTION_URL, action namespace, binding key and parameter names are placeholders for a contract verified in API Explorer and $metadata. Keep shell tracing disabled while handling the token; the stdin header keeps it out of curl's process arguments. If the supported operation is PATCH instead, preserve the returned ETag with If-Match. Never infer a /odata/v4/PurchaseOrder(...) path or write a lifecycle status property.

4.2 Handling API Response Codes

Classify failures before deciding whether to abandon/retry the Service Bus message:

ResponseIntegration treatment
200/204Record the correlation ID/outcome and complete the message
401Renew the token once; alert if the configured client still fails
403Permission/configuration fault; do not retry in a tight loop
404Contract, version or business-key mismatch; quarantine for investigation
409/412Re-read state/ETag and apply the documented concurrency rule
429, 502, 503, 504Retry with jitter and Retry-After where supplied
Other 4xxTreat as a validation/contract fault unless documentation says otherwise

The worker should not swallow a failed write and then complete the broker message. Return a typed result or throw a classified exception so the message handler can retry transient failures and dead-letter permanent ones with a concise reason.


Step 5: Dead-Letter Queue Handling

Not every message will process successfully on the first try. Service Bus provides a Dead-Letter Queue (DLQ) for messages that:

  • Exceed the max delivery count (default: 10)
  • Fail with non-recoverable errors
  • Are explicitly moved by your code

5.1 Configure Dead-Letter Behavior


5.2 Monitor and Reprocess Dead Letters


5.3 Alerts and Monitoring

Set up Azure Monitor alerts for DLQ activity:

Use Azure Monitor's Service Bus DeadletteredMessages metric, filter it to the entity/subscription, and attach a tested action group. Metric names, dimensions and alert CLI syntax can change, so create the rule from the current Azure Monitor definition rather than copying an unvalidated JSON fragment. Alert on age as well as count: one old financial message matters even when the queue is small.


Best Practices for Reliability

1. Idempotency

Service Bus delivery is at least once. Enforce a unique message/event ID in a durable inbox and couple local state changes to an outbox transaction. Checking and then inserting in two independent operations has a race, and broker duplicate detection alone does not make external side effects exactly once:


2. Graceful Degradation

If writing back to IFS fails transiently, use bounded exponential backoff with jitter and honour Retry-After. Do not retry validation/permission errors, and do not hold a PeekLock through long sleeps without ensuring lock renewal:


3. Message Sessions for Ordering

For workflows where order genuinely matters, create a session-enabled queue/subscription, set SessionId on every published message (for example to the purchase-order key), and create a session processor. Ordering is per session, not global. A subscription's session requirement is fixed when the entity is created; it cannot be enabled later with an update command:


For an existing non-session subscription, create a new session-enabled subscription, reproduce and verify its filters/rules and access controls, deploy the session receiver, then cut the publisher over with a SessionId. Drain or reconcile the old subscription before retiring it. Existing non-session messages cannot be consumed by a session receiver.


4. Distributed Tracing

Use Application Insights to trace messages end-to-end:



Deployment and Scaling

Containerize Your Consumer


Deploy to Azure Container Apps or AKS

Run the container under a user-assigned or system-assigned managed identity with Azure Service Bus Data Receiver. Inject the IFS token endpoint, client ID, scope, and result-action URL as configuration; keep the IFS client secret in the platform secret store and acquire short-lived access tokens at runtime. Do not deploy a long-lived IFS_TOKEN or Service Bus connection string as a plain environment value.

Auto-Scaling Based on Queue Length

Azure Container Instances does not provide broker-driven autoscaling. Use Azure Container Apps' Service Bus/KEDA scale rule or an equivalent AKS KEDA scaler. Set maximum replicas and processor concurrency from tested IFS/API capacity, lock duration and downstream limits—not just queue depth.


Key Takeaways

  1. Decouple suitable IFS events from downstream systems using Azure Service Bus. This contains many transient failures, but operations still need reconciliation and replay.

  2. Publish supported event actions through a governed REST route. Use a Send-only SAS credential or an authenticated Azure bridge; managed identity is not directly available to the IFS SaaS workload.

  3. Build independent microservices that consume events asynchronously. Scale them independently based on workload.

  4. Write results back through exact projection actions only when the IFS business process owns that result. Never invent status fields or generic endpoints.

  5. Implement robust dead-letter handling. Monitor DLQ depth and implement reprocessing workflows for recovery.

  6. Use message sessions for per-key ordering and durable idempotency for duplicates. They improve consistency but do not guarantee exactly-once external side effects.

  7. Invest in distributed tracing with Application Insights. Visibility is critical in asynchronous systems.

  8. Measure before scaling. Service Bus throughput depends on tier, message size and features; consumer concurrency must also respect IFS and downstream capacity.


Conclusion

Event-driven integration with Azure Service Bus can replace a brittle synchronous dependency with a resilient, observable pub-sub boundary. Business notifications flow through Service Bus, independent workers process them at their own pace, and meaningful results can return through supported IFS operations. Durability, error handling and monitoring are capabilities to configure and operate, not automatic guarantees.

The patterns described here—idempotency, dead-lettering, message sessions, and distributed tracing—are battle-tested in production systems. Start small: pick one IFS event, route it through Service Bus, and build one consumer. From there, the architecture grows naturally as your integration needs expand.

Azure Service Bus is more than a queue, but it is still one component of the integration. Paired with a verified IFS event/action contract and disciplined operations, it provides a sound boundary that can scale with measured demand.

Building event-driven integration between IFS and Azure?

Syrett Consultancy can help you architect Service Bus patterns for reliable message handling, retries, and downstream processing.