by Danish Ali Detho | O365 & Power Platform Solution Architect
Power Platform provides a great way for citizen developers to develop Apps using low-code /no-code tools like PowerApps, PowerAutomate, and PowerBI. With this approach, the focus is more towards designing an App that provides business value to the business users than the architecture used for developing App. This provides a platform for citizen developers to build Apps at a lightning pace that does deliver value to the business however once the App is in the user’s hands, there is little you can do within Power Platform to gain some insights on how the App is performing or how it is being used by the users. That’s where Application insights come into play and integrating your PowerApps with Application Insights will allow you to gain insights and get some telemetry goodness from your App. In this blog, we will try to answer some of the questions around what is Application Insights, How Application Insights can help you with your PowerApps, and finally how to setup and integrate your PowerApps with Application Insights.
What is Telemetry and Application Insights?
Telemetry is the process of collecting usage, performance, and process-level information from the application into some data store, which then can be used by application developers or system administrators to improve, diagnose or support the application. Application Insights is an Azure monitoring feature that enables developers and DevOps professionals to include telemetry and instrumentation services for their Applications. In other words, It provides you insights into what’s really going on in your application and how the users are using it. It comes with some great features that can help developers to monitor their live applications and detect performance anomalies and includes powerful analytics tools to help you diagnose issues and understand what users actually do with your app.
What value can PowerApps get from Application Insights?
Power Platform doesn’t provide any tools for monitoring live applications which can be troublesome for developers and administrators when it comes to analyzing your app performance or tracing any information, troubleshooting via logs, or getting usage-related information. This can be accomplished by connecting your PowerApp to Application Insights in Azure which will then allow you to monitor your canvas and model-driven Apps in order to find out any bugs or to understand how your users are using the App.
How to Connect PowerApp to Application Insights?
Step 1: Create App Insights Resource in Azure Portal
Log on to https://portal.azure.com and click on Create a resource. Search for Application Insights and then click create. Enter the required information.
Review the information and then click on Create. This will start the Application Insights deployment process and once it’s done the resource will be created.
Now go to the App Insight resource and copy the Instrumentation Key which will be used for connecting our Canvas Apps to App Insights.
Step 2: Connect PowerApps Canvas Apps to Application Insights
Go to http://make.powerapps.com and select Apps from the left menu. Right-click on your App and click on Edit.
Click on the App icon in the left-hand navigation and paste the instrumentation key in the instrumentation key field highlighted below.
Now go to File-> Save to Save and Publish the App. Now App insights will start collecting the telemetry data from your App.
Note: You can connect your model-driven App and Portals as well using the instrumentation key.
Step 4: View Telemetry Data in Application Insights
Now go to Azure Portal and open your App insights resource.
In the left pane select Usage-> Users. This will show the User’s details and you can even drill down to view each user’s details as well as session details.
Now, Select Usage->Events in the left pane, this will show detailed information on all the events which are triggered by the users in the App. You can also see a summary of all the screens viewed across all the sessions.
In order to generate a PowerBI report on the telemetry data, you can export the data and import it in PowerBI, and then use it to build a PowerBI report.
Building resilient Apps requires efficient monitoring to make sure you find out about any errors in order to troubleshoot them and to understand how your users are using your Apps in order to improve the user experience. Connecting your App to App insights will enable you to extract the telemetry information you need to understand the usage patterns, identify your users, and report on the usage of your App. There is no better way to analyze the success of an App than to show real-time data on the usage to stakeholders. In this article, we covered some of the key telemetry information you can easily access through App Insights but there is a lot more you can do including writing custom trace events directly to App Insights to analyze information specific to your use case scenarios as well.