We’re designing a firmware update orchestration system that needs to integrate Azure IoT Hub (aziot-25) with our SAP ERP backend. The business requirement is that firmware updates must be approved in SAP based on asset criticality, maintenance schedules, and compliance requirements before being pushed to devices.
I’m evaluating two architectural approaches:
Option A - Direct API Integration:
Azure IoT Hub REST API calls directly from SAP using custom ABAP code. Firmware update jobs are created via HTTP requests when SAP workflows approve updates.
// Simplified direct API pattern:
POST https://prod-iot-hub.azure-devices.net/jobs/v2/query
Authorization: SharedAccessSignature sr=...
Content-Type: application/json
{
"jobId": "fw-update-{sapAssetId}",
"type": "scheduleUpdateTwin"
}
Option B - Middleware Layer:
Azure Logic Apps as middleware between SAP and IoT Hub. SAP triggers Logic App workflows via OData, which then orchestrate IoT Hub operations with built-in retry logic and error handling.
What are the community’s experiences with direct API versus middleware approaches for ERP-IoT integration? Particularly interested in perspectives on error handling, monitoring capabilities, and business logic orchestration complexity.
Direct API integration from ABAP is cleaner from a code maintenance perspective if you have strong SAP development skills in-house. We built a custom function module that wraps the IoT Hub REST API calls with proper error handling and logging. The challenge is managing authentication - you need to handle SAS token generation and renewal in ABAP, which isn’t trivial. Also, debugging failed API calls requires digging through SAP application logs rather than having a centralized monitoring dashboard.
From an operational perspective, monitoring and alerting are critical differentiators. Direct API integration requires you to build custom monitoring in SAP - tracking API call success rates, response times, and error patterns. Middleware like Logic Apps gives you Azure Monitor integration out of the box with pre-built dashboards and alerting. When firmware updates fail at 2 AM, having centralized monitoring that shows exactly which step failed (SAP approval, Logic App execution, or IoT Hub job creation) significantly reduces mean time to resolution.
The business logic orchestration aspect is often underestimated. If your SAP approval workflow involves multiple decision points (asset criticality checks, maintenance window validation, compliance verification), implementing all that logic in ABAP alongside IoT Hub API calls creates tight coupling. Middleware allows you to separate concerns - SAP handles ERP business rules, Logic Apps handles IoT orchestration logic, and each system focuses on its core competency. This separation makes testing and debugging much easier.
We went with middleware (Azure Logic Apps) for a similar SAP-IoT Hub integration. The main advantage is built-in retry policies and error handling without custom code. Logic Apps also provides visual workflow monitoring that non-technical stakeholders can understand. The downside is cost - Logic Apps charges per execution, which adds up with high-frequency firmware update approvals. For batch updates though, the orchestration capabilities are worth it.