![]() ![]() In this case, it’s been Fabio Filardi (and Mötz Jensen also pointed me towards this solution), pointing to this blog post about a feature in API Management that lets us send the bodies of the requests and responses directly into App Insights. Well, this is another benefit of sharing things, there’s always someone that knows better than you and can help you. And if there are issues, at least we can see which body was sent, what error the backend returned, etc. I went for the latter:Īnd, after some minutes after the requests, we will see what we’ve sent there: Log Analytics dataĪnd now we have the details of whom, when, which endpoint and what is being sent and the response the backend is returning. We can do that either using Azure’s management REST API or PowerShell. ![]() The logger-id property contains the name of a logger we’re creating in the APIM. Var ret = string.Format("", "Outbound", DateTime.UtcNow,, context.RequestId,, , bodyResponse) Var bodyRequest = (preserveContent: true) I just want you all to SPEND MORE MONEY ON (context.Request != null) Logic Appīecause the Event Hub is not meant to view data, we’ll be using a Logic App to get the logs from the Event Hub into Log Analytics. It’s connected to the APIM and will collect data about the performance of the APIM, and we can also use it to query the logs from Log Analytics. Application InsightsĪnd obviously App Insights is the next component. Log Analytics is a tool that we’ll be using to collect the data from the Event Hub and analyze their results. I’m using an Event Hub because… I haven’t been able to get the APIM requests and responses into a Log Analytics Workspace otherwise. ![]() The Event Hub is an event ingestion service, and we’ll use it to log the requests and responses of the API Management. One of the benefits of the APIM is that we can manage the OAuth authentication flow in Dynamics 365 and, for example, use an API key instead.Īdditionally, we can create mock APIs, modify requests and responses before they get to and from the backend, and define several other rules in the policies. This will be the public-facing API endpoint that will connect to our real backend, which in the diagram’s case is Dynamics 365 F&O. Let’s take a look at the individual components. So my idea is having an API Management in front of Dynamics 365 Finance and Operations, or whatever you’re using, and log all the requests done to the APIM and responses returned by the APIM in an Event Hub as JSON. ![]()
0 Comments
Leave a Reply. |