Short recording to show how to get my Bearer token using my Microsoft AAP account.
Get MFA bearer token using postman
I used this post to help me: Authorizing requests overview | Postman Learning Center
Short recording to show how to get my Bearer token using my Microsoft AAP account.
Get MFA bearer token using postman
I used this post to help me: Authorizing requests overview | Postman Learning Center
Overview: I had a hard time setting up my tenant to use the Power Platform API, so here are my notes.
1. Register a new App that will be the Service Principal (SP)
Open https://portal.azure.com and login, and open your Azure Active Directory (mine is Radimaging Ltd) > Click "App Registrations" > "New registration" > add the registration as shown below:
Click the "All applications" tab and verify that the SP has been created. Click the application to go into it. Mine is called "Power Platform SP".2. Give the SP permissions to use the Power Platform API's
Click "API permissions" > "Add a permission" > select the tab "API's my organization uses", search for the "Power Platform API" ensure it has the Application(Client Id) of "8578...".
Optional: If the API does not show up, use Power Shell to add it.
Overview: If you are using ALM/DTAP environments, I want to ensure all my environments are logging to the correct Log Analytics/App Insights. This needs to cover all services such as Canvas Apps, Functions, Service Bus,...
Canvas Apps: Open the Canvas app in Edit mode, Select "App", and check the instrumentation key points at the correct App Insights instance.
1. Ensure you have setup an application key in each Canvas App you build.
2. Ensure you turn on the logging feature (provides more logging)
4. Ensure you are in run mode (edit and play mode does not log)
5. Open App Insights or Log Analytics, and check the trace is coming in
Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Managed Environment Logging (New 2025-05-09)
App Insights for Power Platform - Part 5 - Logging for APIM
App Insights for Power Platform - Part 6 - Power Automate Logging
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics (this post)
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging (this post)
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern
Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Managed Environment Logging (New 2025-05-09)
App Insights for Power Platform - Part 5 - Logging for APIM
App Insights for Power Platform - Part 6 - Power Automate Logging
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards (this post)
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern
Overview: Azure Dashboards are excellent but, if you want beautiful dashboards use the Azure Grafana service or Power BI dashboards.
It's always difficult to identify KPI's and graphs to allow support and stakeholders to quickly digest monitoring information. An option is to have an overview for the PM, PO, Business owners,,, and a separate set of dashboards for support.
Identify What is important? End-to-end testing is always nice especially if running CI to detect abnormalities.
For instance, this Azure Dashboard, fires of a Canvas App recorded Test (done using test studio) and shows the speed (performance) of the run, i then warn the user if the performance is too slow. I also grab the oldest successful run from 7 days ago to check if performance is considerably different.
Power automate has it's own logging, but integrating log entries when a error occurs via Log analytics, allows me to see if any of my workflows have a problem. This is discussed in part 6 of the logging series on Flows.
Azure services are often used when building solutions using the Power Platform. The most common are Functions, App Services, APIM, Service Bus, maybe sendgrid. So we need to know that they are working, and help the user see performance or issues. Here are a couple of examples.
Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Model App Logging
App Insights for Power Platform - Part 5 - Logging for APIM
App Insights for Power Platform - Part 6 - Power Automate Logging
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards (this post)
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern
Open Source Software Licencing for dummies/me:
Note: Announcement 23 Aug 2023 - integration of Power Automate telemetry data with Azure Application Insights.
Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Managed Environment Logging (New 2025-05-09)
App Insights for Power Platform - Part 5 - Logging for APIM
App Insights for Power Platform - Part 6 - Power Automate Logging (this post)
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern
#r "Newtonsoft.Json"using System.Net;using Microsoft.AspNetCore.Mvc;using Microsoft.Extensions.Primitives;using Newtonsoft.Json;public static async Task<IActionResult> Run(HttpRequest req, ILogger log){string requestBody = await new StreamReader(req.Body).ReadToEndAsync();dynamic data = JsonConvert.DeserializeObject(requestBody);int eventId = data?.eventId;string errType = data?.errType;string errMsg = data?.errMsg;string correlationId = data?.correlationId;string workflowId = data?.workflowId;string workflowUrl = data?.workflowUrl;string flowDisplayName = data?.flowDisplayName;var custProps = new Dictionary<string, object>(){{ "CorrelationId", correlationId},{ "WorkflowId", workflowId},{ "WorkflowUrl", workflowUrl},{ "WorkflowDisplayName", flowDisplayName}};using (log.BeginScope(custProps)){if (errType=="Debug"){log.Log(LogLevel.Debug, eventId, $"{errMsg}");}else if (errType=="Critical"){log.Log(LogLevel.Critical, eventId, $"{errMsg}");}else if (errType=="Warning"){log.Log(LogLevel.Warning, eventId, $"{errMsg}");}else if (errType=="Trace"){log.Log(LogLevel.Trace, eventId, $"{errMsg}");}else if (errType=="Error"){log.Log(LogLevel.Error, eventId, $"{errMsg}");}else{log.LogInformation($"Event is {eventId}, type is {errType}, and msg is {errMsg}");}};string responseMessage = $"This HTTP triggered function executed successfully. {errType} - {errMsg}";return new OkObjectResult(responseMessage);}
Power Platform Admin Centre:
There is nice analytics inside the Power platform Admin Centre as shown below to examine Flows/Power automate:
The flows can also be reviewed on a per environment basis:Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Model App Logging
App Insights for Power Platform - Part 5 - Logging for APIM
App Insights for Power Platform - Part 6 - Power Automate Logging (this post)
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern
Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Managed Environment Logging (New 2025-05-09)
App Insights for Power Platform - Part 5 - Logging for APIM (this post)
App Insights for Power Platform - Part 6 - Power Automate Logging
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern
Overview: APIM is often part of you Power Platform solutions, such as monitoring and controlling all inbound and outbound traffic or to wrap over Azure functions.
Within APIM you can add multiple App Insights Instances. You can send all logging to a single instance an override specific API's to log to different instances. Making the logging nice and granular.
Setup Logging |
Series
App Insights for Power Platform - Part 1 - Series Overview
App Insights for Power Platform - Part 2 - App Insights and Azure Log Analytics
App Insights for Power Platform - Part 3 - Canvas App Logging (Instrumentation key)
App Insights for Power Platform - Part 4 - Model App Logging
App Insights for Power Platform - Part 5 - Logging for APIM (this post)
App Insights for Power Platform - Part 6 - Power Automate Logging
App Insights for Power Platform - Part 7 - Monitoring Azure Dashboards
App Insights for Power Platform - Part 8 - Verify logging is going to the correct Log analytics
App Insights for Power Platform - Part 9 - Power Automate Licencing
App Insights for Power Platform - Part 10 - Custom Connector enable logging
App Insights for Power Platform - Part 11 - Custom Connector Behaviour from Canvas Apps Concern