We will learn to monitor a Canvas App with Azure Application Insights. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Apps.
How can we monitor a Canvas App?
There are various method of monitoring the telemetry of a Canvas App including Power Apps Analytics & Azure Application Insight (Azure Monitor).
Power Apps Analytics (Preview)
There are three major reports available for Power Apps admins. This report includes “Report of Usage”, “Report of Location” and “Report of Performance”.
Azure Application Insight (Azure Monitor)
Application Insights is a feature of Azure Monitor that provides extensible application performance management (APM) and monitoring for live web apps.
Understanding Azure Application Insight
DevOps professionals & developers can use Application Insight to perform the below given activities.
- See what users actually do with apps.
- Help continuously improve app performance and usability.
- Automatically detect performance anomalies.
- Help diagnose issues by using powerful analytics tools.
To use Application Insights, you either install a small instrumentation package (SDK) in your app, or enable Application Insights by using the Application Insights agent. You can instrument the web app, any background components, and the JavaScript in the web pages themselves.
Note: – The app and its components don’t have to be hosted in Azure.
The instrumentation monitors your application and targets the telemetry data to an Application Insights resource by using a unique instrumentation key. The following diagram demonstrates how the Azure Application Insight in an app sends telemetry data to an Application Insight resource.
Analysing telemetry of a Canvas App using Azure Application Insight
We can connect our application with our Azure Application Insight using the below steps.
Step 1 – Creation of Application Insight on Azure
- Login to Azure Portal (https://portal.azure.com/)
- Search for “Application Insight” in the search bar.
- Create an Application Insights resource as shown below.
- Enter the appropriate values and select Review + create.
- After the Application Insights instance is created, you’ll see the instance overview. Copy the “Instrumentation Key” which we will require in the later stage as shown below.
Step 2 – Link an App to Application Insight
- Sign-in to Power Apps Studio (https://make.powerapps.com/).
- Select an App of your choice and open it in the editor window.
- In the “App” component, navigate to the “Instrumentation Key” property and paste the previously copied Application Insight key from Azure as shown below.
- Save and Publish your App.
Validate the implementation in Azure Insight
On completion of the above configuration, play the published app and browse through different screens. As you browse through different screens, events are automatically logged to Application Insights, including the usage details such as:
- Where the app is accessed from.
- Which devices are used.
- The browser types used.
- Number of users who viewed the app.
- Region and location of the users.
- Number of sessions by the users for the app.
- Number of events logged for the app.
- Operating systems and browser version details of the users.