• Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Special Offers
Business Intelligence Info
  • Business Intelligence
    • BI News and Info
    • Big Data
    • Mobile and Cloud
    • Self-Service BI
  • CRM
    • CRM News and Info
    • InfusionSoft
    • Microsoft Dynamics CRM
    • NetSuite
    • OnContact
    • Salesforce
    • Workbooks
  • Data Mining
    • Pentaho
    • Sisense
    • Tableau
    • TIBCO Spotfire
  • Data Warehousing
    • DWH News and Info
    • IBM DB2
    • Microsoft SQL Server
    • Oracle
    • Teradata
  • Predictive Analytics
    • FICO
    • KNIME
    • Mathematica
    • Matlab
    • Minitab
    • RapidMiner
    • Revolution
    • SAP
    • SAS/SPSS
  • Humor

Monitoring the Power Platform: Canvas Driven Apps – Getting Started with Application Insights

May 15, 2020   Microsoft Dynamics CRM

Summary


 

Power Apps Canvas Apps represent a no or low code approach to building and delivering modern applications for makers. The requirements of knowing programming languages such as C# have been removed allowing makers of virtually any background to build apps. These apps can be used with hundreds of connectors allowing for a flexible user interface layered on top of data sources. Apps can also be generated from data sources automatically allowing you to quickly create and deploy an application to your team or customers.

This article is designed to introduce makers to incorporating Azure Application Insights into Power Apps Canvas Apps. We will cover adding the necessary identifiers, reviewing the tables events are sent to and examine some helpful Kusto queries.

Application Insights


 

2262.pastedimage1589496009445v17 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Azure Application Insights is an extensible Application Performance Management (APM) service that can be used to monitor applications, tests, etc. Azure Application Insights can be used with any application hosted in any environment. Depending on what’s being monitored there are SDKs available. For other applications connections and message delivery can be programmed using the REST APIs available.

For Power Platform components, Application Insights is recommended due to its direct integration with Power Apps features and tools and its capabilities to deliver to the API.

Once we begin sending telemetry to Application Insights we can review in real time availability tests, user actions, deployment metrics as well as other feedback from our applications. Connecting our messages with correlation identifiers allows us a holistic view into how our apps are interdependent upon each other. This provides the transparency desired and honestly needed with modern era technology.

Adding Application Insights to Canvas Apps


 

Adding Azure Application Insights message delivery is a native feature of Power Apps Canvas Apps. Once added it will begin to send messages from both the preview player and once deployed, your application in Power Apps. This article from

To add the Instrumentation Key to your Canvas App, open the Power Apps Studio and locate the ‘App’ in the Tree view.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Next, in the App Object window to the right, add the Azure Application Insights Instrumentation Key.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Adding and Locating Identifiers


 

Identifiers in Canvas Apps come in various formats including the user playing the app, the session id, the player version, app version, etc. These data elements are a must when troubleshooting and monitoring how your users interact with your app. Some of the data points I find valuable are the app and player build numbers which are key to understanding if users are using out of date player versions. The other major data point is the session id. For an app user, to obtain these values, navigate to the Settings window and click ‘Session details‘.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Session Window:

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

If a user reports an issue, having the session id and Power Apps player version can help with troubleshooting. That said, currently I don’t see a way to grab the session id natively using Canvas App functions. However, using the Power Apps connector with Power Automate, the session Id can be obtained and added to a trace entry.

AUTHOR’S NOTE: This article from Aengus Heaney titled “Log telemetry for your Apps using Azure Application Insights” details that this feature is coming. I would suggest, unless needed immediately, to avoid the Power Automate customization. This feature will eliminate the need for using the Power Apps connector in this fashion, I’m very excited to see its coming! I’ll update this article once this is available.

7181.SessionIdBetweenCanvasAppAndAppInsights Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Adding Traces


 

The Trace function is used to send messages to the traces table in Application Insights. This allows makers the ability to add telemetry and instrumentation from practically any control on any screen. This also opens us up to generating identifiers for specific actions which can be used for troubleshooting in a live environment. The below image shows using informational traces to capture the timings between the invocation of a Power Automate flow. The image shows a trace for the button click, and entries for adding instrumentation for a Power Automate flow.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

The image below is the result of the Trace methods showing the message and the time stamp for each entry.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Traces can three types: Information (for operational activities), Warnings (non breaking issue), or Errors (breaking issue).

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Based on the severity level, the Application Insights record will change.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Exploring what’s delivered


 

At the time of this writing the tables data is delivered to natively include the customEvents, pageViews and browserTimings tables. Each table contains generic Azure Application Insights properties as well as specific relevant properties.

7002.pastedimage1589496009449v27 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

The customEvents table shows when the published app was started.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

pageViews – The pageViews table is included when Azure Application Insights is added to Canvas Apps. The message received by Application Insights contains the URL, the name of the screen within your app and the duration as well as a handy performance bucket. Using the duration along with contextual information from the session and user we can begin to identify performance concerns.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

NOTE: I have seen the pageViews duplicate duration across all screens. Consider adding trace events in the Maker Defined Events section or a technique to find the difference between pageView entries in Kusto.

browserTimings – This represents browser interactions including the send and receive duration, the client processing time and the all up total duration. Similar to the pageViews table a performance bucket is present allowing for a general visualization.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Maker Defined Events

 

The traces table contains information sent from the app by the platform and the maker using the Trace() method. For the platform trace events, the user agent string and client information is captured. For the trace method, as shown above an enumeration is used to set the severity from the Canvas App. In Application Insights this translates to a number.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Useful Kusto Queries


 

The Kusto Query Language allows analysts to write queries for Azure Application Insights. Below I’ve included some queries to help you get started with each table events are currently delivered to.

Pulling ms-app identifiers from custom dimensions:

//This query shows how to parse customDimensions for the app identifiers
traces
| union pageViews, customEvents, browserTimings
| extend cd=parse_json(customDimensions)
| project timestamp, 
itemId, //this changes for each call
itemType,
operation_Id , operation_ParentId , //this does not changes for each call
operation_Name , session_Id , user_Id, 
message, cd.['ms-appSessionId'],cd.['ms-appName'],cd.['ms-appId']


​

Pulling Page Views within the same session:

//This query shows how to use a session_id to follow a user's path in the canvas app
pageViews 
// | where session_Id == "f8Pae" //Windows 10
// | where session_Id == "YhUhd" //iOS
| where (timestamp >= datetime(2020-05-13T10:02:52.137Z) and timestamp <= datetime(2020-05-14T12:04:52.137Z)) 

Slow Performing Pages or screens:

// Slowest pages 
// What are the 3 slowest pages, and how slow are they? 
pageViews
| where notempty(duration) and client_Type == 'Browser'
| extend total_duration=duration*itemCount
| summarize avg_duration=(sum(total_duration)/sum(itemCount)) by operation_Name
| top 3 by avg_duration desc
| render piechart 

Connecting the Dots


 

The Power Apps Canvas App platform provides app contextual information for each event passed to Application Insights. These include operation name, operation and parent operation identifiers as well as user and session data. Most messages also include custom properties titled ms-appId, ms-appName and ms-appSessionId.

The following Kusto query is an example showing how to isolate for specific operations by a user in a player session. Using the session_id field, we can filter the specific action, which may have generated multiple events, and group them together.

union (traces), (requests), (pageViews), (dependencies), (customEvents), (availabilityResults), (exceptions)
| extend itemType = iif(itemType == 'availabilityResult',itemType,iif(itemType == 'customEvent',itemType,iif(itemType == 'dependency',itemType,iif(itemType == 'pageView',itemType,iif(itemType == 'request',itemType,iif(itemType == 'trace',itemType,iif(itemType == 'exception',itemType,"")))))))
| where 
(
    (itemType == 'request' or (itemType == 'trace' or (itemType == 'exception' or (itemType == 'dependency' or (itemType == 'availabilityResult' or (itemType == 'pageView' or itemType == 'customEvent')))))) 
    and 
    ((timestamp >= datetime(2020-04-26T05:17:59.459Z) and timestamp <= datetime(2020-04-27T05:17:59.459Z)) 
    and 
    session_Id == 'tmcZK'))
| top 101 by timestamp desc

Application Insights contains a User Session feature that can help visualize and provide data points for the specific session. The image below combines custom events and page views.

 Monitoring the Power Platform: Canvas Driven Apps   Getting Started with Application Insights

Next Steps


 

The native functionality of Azure Application Insights traceability is a relatively new feature for Canvas Apps. I would also expect to see additional messages delivered to missing tables above such as exceptions and custom metrics. In the meantime consider using a Power Automate flow to send events, a custom connector or the Log Analytics Data Collector connector. This connector requires a P1 license but does allow to send data to a Log Analytics workspace which can be queried and monitored by Azure Monitor and other platforms.

Utilizing the Azure Application Insights API Key, Microsoft Power BI reports can be created based off the data collected from Power Apps Canvas Apps. Consider using the M Query export or building custom queries using the Application Insights API.

If you are interested in learning more about specialized guidance and training for monitoring or other areas of the Power Platform, which includes a monitoring workshop, please contact your Technical Account Manager or Microsoft representative for further details.

Your feedback is extremely valuable so please leave a comment below and I’ll be happy to help where I can! Also, if you find any inconsistencies, omissions or have suggestions, please go here to submit a new issue.

Index


 

Monitoring the Power Platform: Introduction and Index

Let’s block ads! (Why?)

Dynamics 365 Customer Engagement in the Field

Application, apps, Canvas, Driven, Getting, Insights, monitoring, Platform, Power, Started
  • Recent Posts

    • Experimenting to Win with Data
    • twice-impeached POTUS* boasts: “I may even decide to beat [Democrats] for a third time”
    • Understanding Key Facets of Your Master Data; Facet #2: Relationships
    • Quality Match raises $6 million to build better AI datasets
    • Teradata Joins Open Manufacturing Platform
  • Categories

  • Archives

    • March 2021
    • February 2021
    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
© 2021 Business Intelligence Info
Power BI Training | G Com Solutions Limited