
MH507 – Monitoring MHAX Alerts and Retrieving Outbound Events: Leveraging Azure Logic Apps and REST API in Dynamics 365FO
Introduction
In this article, we’ll dive into how you can use Azure Logic Apps to monitor MHAX alerts and retrieve outbound queue events in Dynamics 365FO. I’ll walk you through setting up Logic App triggers to capture and process alerts from the MHAX module, as well as using the REST API to retrieve outbound events.
Note – following are two Rest endpoints for Outbound and Inbound messages in Dynamics
Outbound – https://base_environment_URL/api/services/WMHEServices/WMHEService/readOutboundSubscriptionQueue
Inbound – https://base_environment_URL/api/services/WMHEServices/WMHEService/executeInboundTransaction
Step-by-Step Instructions
Create an Azure Logic App (consumption)
1.1 Access the Azure Portal:
- Sign in to the Azure Portal.
1.2 Create a New Logic App:
- In the Azure Portal, click on Create a resource.
- Search for Logic App and select it from the list.
- Click Create to start the setup process.
1.3 Configure Basic Settings:
- Subscription: Select your Azure subscription.
- Resource Group: Choose an existing resource group or create a new one.
- Logic App Name: Enter a unique name for the Logic App.
- Region: Select the Azure region where you want to deploy the Logic App.
- Click Review + Create, review your settings, and then click Create.

Configure Logic App Trigger
2.1 Open the Logic App Designer:
- Once the deployment is complete, go to the Logic App you created.
- In the Logic App’s overview page, click on Logic App Designer.

2.2 Add a Trigger for the Logic App:
- Click on + New step to add a trigger.
- Search for Fin & Ops App Events in the connector list.
- Select the When a Business Event Occurs connector.

Create an OAuth Connection
- Click Sign in
- This will prompt you to sign in (Make sure you have right permissions)

2.3 Configure the Business Events Trigger:
- Instance: Choose Your Dynamics environment
- Category: Alerts
- Business Event: Choose When an alert rule is triggered.
- Advanced parameter (optional): Choose legal entity

2.4 Add action – Parse Json from Trigger
- Content – Select Body Output of trigger
- Schema – Select Use sample payload to generate schema and upload (Use schema content downloaded from Business events – see previous article of this series)

2.5 Setup a condition to retrieve specific alters based on RuleID

2.6 Configure True branch
URI – https://base_environment_URL/api/services/WMHEServices/WMHEService/readOutboundSubscriptionQueue
Body: Zero indicates all and SubscriptionID indicates name of subscription ID set in Dynamics.

- Configure Authentication of above HTTP call action

2.7 Configure False branch
- I will leave this section empty as additional alerts are not required for our case.

Test Trigger and action
- Click ‘reset status’ of existing outbound events

- Wait for batch job ‘Change Base alert’ to run in Dynamics

- Logic app triggers

- Verify HTTP Call action

HTTP Action Output

We have successfully retrieved the outbound event from Dynamics. The event is now ready to be transmitted to the External WMS system for consumption
Expand Your Knowledge: See More Material Handling Blogs
Share this content:
Post Comment