In a previous article, we explored the integration of PowerApps with Azure Application Insights. Now, in this tutorial, we’re thrilled to guide you through the dynamic process of interacting with and interpreting Insights data residing in the logs.
Connecting your PowerApps canvas app to Azure Application Insights empowers you with real-time monitoring and analytics, enabling proactive issue identification, performance optimization, and enhanced user experiences.
Prerequirements
Before we embark on this enlightening journey, let’s ensure you’re prepared:
Our specially tailored application initiates a series of actions, populating the Insights Logs. As we follow the footsteps of PowerApps‘ process outlined earlier, we’ll subsequently delve into the intricacies of retrieving and comprehending these logs. Together, we’ll paint a vivid tapestry of the insights waiting to be uncovered.

Examples
Trace Function
The Syntax of the Trace Function as we use it here, is simple;
Trace( Message [, TraceSeverity [, CustomRecord] ] )
- Message contains the String we want to deliver
- Severity is the state of the Trace (Info,Warning,Error)
- A custom record could be any record you want
Let’s take a closer look at the Trace Scenarios:
Trace Info
Deliver informative insights that enrich your understanding.
Trace(
"This is an Information Trace",
TraceSeverity.Information, {
UserName: User().FullName,
UserEmail: User().Email,
Screen: "Home",
FeebackValue: "1"
}
);
Notify("Trace was written");
Trace Warning
Unveil crucial warnings that empower proactive troubleshooting.
Trace(
"This is an Warning Trace",
TraceSeverity.Warning, {
UserName: User().FullName,
UserEmail: User().Email,
Screen: "Home",
FeebackValue: "2"
}
);
Notify("Trace Warning was written");
Trace Error
Illuminate errors that pave the way for targeted resolutions.
Trace(
"This is an Error Trace",
TraceSeverity.Error, {
UserName: User().FullName,
UserEmail: User().Email,
Screen: "Home",
FeebackValue: "3"
}
);
Notify("Trace Error was written");
Undefined Error
In this Example we produce an undefined error. For this we simply make a division by zero error.
UpdateContext({varCal:TextInput1.Text/TextInput1_1.Text })
Correlation Error
A Correlation Error is an error which occurs on Connectors. To be precise, Azure Application Insights can only get the errors from Custom Connectors
We use the Connector we created for another Tutorial.
TestConnector.POOO(TextInput2.Text)
Application Insights
Now that we created the Traces and Errors, we want to look in the Logs of the Insights.
Let us look the traces we created. To filter out simple traces like App starts we use the following filter:
traces
| where severityLevel != 0

As you see I had an error in my first warning trace with the wrong Type of Severity.
I will not write out any kind of Query as you should know the basics. If not, feel free to reach out to us. We are always happy to help you.
But let us look deeper in the Traces we made. We choose the Warning Trace because we will come to the Error with the unhandled Error.


We see many details. From which user it was to when it happend and the custom record we provided. We also see App-Version, SessionID and location. Many details that could potential help you debugging an error.
Let’s take another look in the unhandled error. I choose the Correlation Error because the structure of the „Division by zero“ and the correlation Error are the same.

We can see which Interaction (Button1_4) the User has done. We also see what kind of Error is returned. That makes it simple to debug any errors
Is it worth the costs?
The cost of Azure Application Insights depends on how much data you send and how many queries you run on the data. For example, if you send 30 GB of data per month, which is typical for a medium to large usage o PowerApps in a company with 1000+ users of PowerApps, you will pay about 82€ per month. If you also run 100 queries on the data, you will pay an additional 0.006€ per query, or 0.60€ in total. So the total cost would be around 82.60€ per month.
Is it worth the cost? That depends on how much value you get from the data. If you have a lot of PowerApps users who encounter errors or have poor performance, you can use Azure Application Insights to find and fix the root causes. This can save you time and money on development and support. It can also improve user satisfaction and productivity. The more developers or supporters you need to handle PowerApps errors, the more likely it is that Azure Application Insights will pay for itself.