Application Insights is a powerful tool from Azure that allows you to monitor the health, usage, and performance of your Power Pages portal. Enabling telemetry provides insights into user behavior, errors, page performance, and more.
Why Use Application Insights?
- Track page views and user navigation
- Monitor server-side and client-side errors
- Identify slow pages or failed requests
- Understand portal usage patterns
- Troubleshoot issues with detailed logs
How to Enable Application Insights in Power Pages
Step 1: Create an Application Insights Resource
- Go to the Azure Portal.
- Create a new Application Insights resource.
- Choose the region and resource group.
- Once created, copy the Instrumentation Key or Connection String (preferred).
Step 2: Enable in Power Pages Portal
- Go to Power Pages Admin Center.
- Select your site and click on Site Settings.
- Add the following site setting:
- Name:
ApplicationInsights.ConnectionString
- Value: Paste the Application Insights connection string (starts with
InstrumentationKey=
orConnectionString=
).
- Name:
Alternatively, for older setups:
- Use
ApplicationInsights.InstrumentationKey
instead.
What Gets Tracked?
- Page views
- AJAX calls
- Custom JavaScript events (if implemented)
- Unhandled exceptions
- User sessions and location
Viewing Telemetry
- Open your Application Insights resource in Azure.
- Use the following tabs:
- Overview – Summary of usage and performance
- Failures – Exception and dependency tracking
- Performance – Load time, AJAX, etc.
- Users/Sessions – Behavior tracking
- Logs (Analytics) – Write custom queries with Kusto (KQL)
Example KQL Queries
// Failed requests
requests
| where success == "False"
| order by timestamp desc
// Page view counts
pageViews
| summarize count() by name
Best Practices
- Enable Sampling to reduce ingestion cost for high-traffic portals.
- Combine with Azure Alerts for critical error notifications.
- Use custom events via JavaScript for advanced tracking.