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 Function / Function App.
In this article we will go through the steps to configure Function App with APIM and connect that APIM with FinOps Business Event.
- First we need to create Function App, for that we need to login to https://portal.azure.com/ and Select Function App.
- Function App is created.
- First open your finance and operations environment.
- Navigate to System administration > Setup > Business events > Business events catalog
- Here we are using Purchase order confirmed business event for demo purpose you can select your own business event.
- Click on Purchase order confirmed business event, Click on Download schema button to download payload schema.
- It will download the payload schema file open that file and copy its content.
- Go back to your Function App, click on Functions menu.
- Create new Function by clicking on Create button.
- Select Development environment as per your convenience either use Development in portal or in visual studio, its your choice.
- Here in this demo I am using development in portal.
- Select HTTP Trigger and click on Create.
- After creating a Function App we need to create the Azure APIM (API Management) from Azure Portal.
- Search for API Management services, Create new.
- APIM will take some time like 30 minutes something to delpoy, be patient till APIM is deployed succesfully.
- Click on API menu.
- Select Function App tile.
- Click on Browse and select the function app you created in this article before.
- Click on FinOps-BusinessEvent and then HttpTrigger1 and then Test.
- Copy the Request URL and Ocp-Apim-Subscription-Key and save them somewhere for future.
- After creating a APIM, we need to create the App Registration for authentication in Azure Portal.
- Copy Application (client) ID of App Registration somewhere for future.
- Click on Certificates & secrets menu, and add the secret.
- Click on New client secret button and give secret name and validity and click Add.
- Copy Secret Value somewhere for future.
- After App Registration, we need to create Key vault in Azure Portal.
- Copy Vault URI somewhere for future and then click on the Access policies menu.
- Click on Add Access Policy button.
- Select Key & Secret Management in Configure from template (optional)
- 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 40. It will search the App registration select it and click on Select button.
- After that click on Add button.
- Click the Save button then to save the access policy.
- After saving the access policy on key vault, create Secret on Key vault. To create secret click on Secrets menu.
- Click on Generate/Import button.
- Give the appropriate name to the secret and save it somewhere for future use.
- The Value of secret should be <APIM endpoint URL>?subscription-key=<APIM endpoint subscription key>
- <APIM endpoint URL> is the value which you saved on point 36 as Request URL.
- <APIM endpoint subscription key> is the value which you saved on point 36 as Ocp-Apim-Subscription-Key.
- Click on Create button to create Secret.
- After saving Key vault secret go back to you FunctionApp and write code to log Purchase order number when business event is called.
- Go to your FinOps environment again.
- Navigate to System administration > Setup > Business events > Business events catalog > Endpoints
- Click on New button to create a new endpoint.
- Select endpoint type as HTTPS and click Next.
- Give the appropriate name and description for an endpoint.
- In Azure Active Directory application, paste the Application (client) ID of App Registration which you saved in point number 40.
- In Azure Application secret, paste the value which you saved in point number 45.
- In Key Vault DNS Name, paste the Vault URI which you saved in point number 50.
- In Key Vault Secret Name, paste the value which you saved in point number 63.
- 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.
- Select the legal entity and the endpoint which you just created and click OK.
- Check in Activate business events tab that the business event is activated or not.
- 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.
- Go to FinOps and navigate to Accounts payable > Purchase orders > All purchase orders
- Select the purchase and click Confirm button.
- Purchase order is confirmed. Now lets see if the payload of business event is sent to the function app via APIM or not.
We successfully passed the business event payload of FinOps to the Function app via APIM.
Thank you for reading this article hope you find it useful.
Technical Consultant
References:
Major thanks for the article.Really thank you!
I truly enjoy looking through on this internet site, it holds fantastic articles.
Major thankies for the post.Thanks Again. Really Cool.
Hello! This post could not be written any better!Reading through this post reminds me of my previous roommate! He always kept chatting about this. I will forward thispost to him. Fairly certain he will have a good read.Many thanks for sharing!
college essay ideas help essays online help me write a college essay
Major thanks for the blog. Great.Loading…
Thank you ever so for you blog. Will read on…