FinOps Business Event connection with Azure APIM – LogicApps

This article is mainly focuses on connecting the Azure APIM with finance and operations business event. Whenever the business event triggers it will send the payload to Azure APIM and it forwards the payload to Azure LogicApp.

In this article we will go through the steps to configure LogicApp with APIM and connect that APIM with FinOps Business Event.

  1. First we need to create LogicApp, for that we need to login to https://portal.azure.com/ and Select Logic apps.
  2. Select Blank Logic App
  3. Search HTTP and select the trigger When a HTTP request is received.
  4. Now open your finance and operations environment.
  5. Navigate to System administration > Setup > Business events > Business events catalog
  6. Here we are using Purchase order confirmed business event for demo purpose you can select your own business event.
  7. Click on Purchase order confirmed business event, Click on Download schema button to download payload schema.
  8. It will download the payload schema file open that file and copy its content.
  9. Go back to your Logic app designer, click on Use sample payload to generate schema link.
  10. Paste the payload schema and click Done.
  11. Add another action in your Logic App to show the data, click on +New Step button and search for Compose action
  12. Select Body of When a HTTP request is received action in Input field of Compose action and save logic app.
  13. After creating a Logic App we need to create the Azure APIM (API Management) from Azure Portal.
  14. Search for API Management services, Create new.
  15. APIM will take some time like 30 minutes something to delpoy, be patient till APIM is deployed succesfully.
  16. Click on API menu.
  17. Select Logic App tile.
  18. Click on Browse and select the logic app you created in this article before.
  19. Click on FinOps-BusinessEvent and then manual-invoke and then Test.
  20. Copy the Request URL and Ocp-Apim-Subscription-Key and save them somewhere for future.
  21. After creating a APIM, we need to create the App Registration for authentication in Azure Portal.
  22. Copy Application (client) ID of App Registration somewhere for future.
  23. Click on Certificates & secrets menu, and add the secret.
  24. Click on New client secret button and give secret name and validity and click Add.
  25. Copy Secret Value somewhere for future.
  26. After App Registration, we need to create Key vault in Azure Portal.
  27. Copy Vault URI somewhere for future and then click on the Access policies menu.
  28. Click on Add Access Policy button.
  29. Select Key & Secret Management in Configure from template (optional)
  30. Click on None selected in Select principal, it will open pop up form enter the Application (client) ID of App Registration which you saved in point number 43. It will search the App registration select it and click on Select button.
  31. After that click on Add button.
  32. Click the Save button then to save the access policy.
  33. After saving the access policy on key vault, create Secret on Key vault. To create secret click on Secrets menu.
  34. Click on Generate/Import button.
  35. Give the appropriate name to the secret and save it somewhere for future use.
  36. The Value of secret should be <APIM endpoint URL>?subscription-key=<APIM endpoint subscription key>
  37. <APIM endpoint URL> is the value which you saved on point 39 as Request URL.
  38. <APIM endpoint subscription key> is the value which you saved on point 39 as Ocp-Apim-Subscription-Key.
  39. Click on Create button to create Secret.
  40. After saving Key vault secret all Azure configuration is done now.
  41. Go to your FinOps environment again.
  42. Navigate to System administration > Setup > Business events > Business events catalog > Endpoints
  43. Click on New button to create a new endpoint.
  44. Select endpoint type as HTTPS and click Next.
  45. Give the appropriate name and description for an endpoint.
  46. In Azure Active Directory application, paste the Application (client) ID of App Registration which you saved in point number 43.
  47. In Azure Application secret, paste the value which you saved in point number 48.
  48. In Key Vault DNS Name, paste the Vault URI which you saved in point number 53.
  49. In Key Vault Secret Name, paste the value which you saved in point number 66.
  50. After end point is configured in FinOps, go to Business event catalog tab and select the Purchase order confirmed business event and click on Activate button.
  51. Select the legal entity and the endpoint which you just created and click OK.
  52. Check in Activate business events tab that the business event is activated or not.
  53. All configurations are completed. In order to trigger the business event we need to confirm the purchase order in order to trigger the business event.
  54. Go to FinOps and navigate to Accounts payable > Purchase orders > All purchase orders
  55. Select the purchase and click Confirm button.
  56. Purchase order is confirmed. Now lets see if the payload of business event is sent to the logic app via APIM or not.

We successfully passed the business event payload of FinOps to the Logic app via APIM.

Thank you for reading this article hope you find it useful.

Omar Iqbal

Technical Consultant

References:

  1. https://azureintegrations.com/2020/02/10/d365fo-business-event-and-azure-function-app/
  2. https://nuxulu.com/2019-11-05-business-events-and-https-endpoint/
  3. https://dynamics365musings.com/how-to-setup-d365-business-events-part-1/
  4. https://dynamics365musings.com/how-to-setup-d365-business-event-part-2/
Total
0
Shares
Previous Article

Qualify Lead using Power Automate

Next Article

FinOps Business Event connection with Azure APIM - Azure Function

Related Posts