If you're like most D365 organizations, you use background workflows. Depending on the nature of your business, you likely have custom plugins embedded in many of those background workflows. While Microsoft hasn't officially announced the deprecation of background workflows, they are recommending that you transition to using MS Flows.
To prepare for this transition, we've been brainstorming how we will convert them to flows, specifically those that have custom plugins. Some very basic plugins can be replaced with flow logic (specifically, items that simply query a list of records or update basic fields several records in a given list) and those that make more sense to keep as code can be replaced with HTTPTrigger functions.
Creating an HttpTrigger function is fairly simple to set up in an Azure function app. You can create it directly in the portal. Once created, it will automatically generate an Http url for you and then you can add your code. In the example below, I have 3 inputs, perform some logic and then return the response as a JSON object:
You can then easily add your HTTPTrigger function to a flow:
The steps in the flow above are the following:
- Flow triggers based on some change in Dynamics
- Then it retrieves the correct HTTP Trigger URL (because they may be different between Dev and PRD). The URL will be stored in an Environment Variable unique to each environment.
- Then it makes a POST call to the HTTP trigger function with a JSON body appropriate for the function. The body replaces the plugin "inputs".
- Then we can retrieve the response as JSON from the HTTP Trigger function which replaces the plugin "outputs".
We love to implement Microsoft Dynamics 365 and Power Platform solutions here at Beringer. We’ve been working with Microsoft Dynamics since its inception, and we’re always finding innovative ways to implement the latest tools and help automate business processes.
Beringer Technology Group, a leading Microsoft Gold Certified Partner specializing in Microsoft Dynamics 365 and CRM for Distribution also provides expert Managed IT Services, Backup and Disaster Recovery, Cloud Based Computing, Email Security Implementation and Training, Unified Communication Solutions, and Cybersecurity Risk Assessment.