Managing site logs and telemetry

Loading

Managing site logs and telemetry is a crucial part of operating and maintaining Power Pages (Power Apps Portals). It helps in monitoring performance, tracking issues, analyzing usage patterns, and enhancing security. This guide walks you through the step-by-step process of enabling, accessing, and managing logs and telemetry data using tools like Power Platform Admin Center, Azure Application Insights, and Power Platform CLI (PAC CLI).


Why Manage Site Logs and Telemetry?

  • Troubleshoot issues: See HTTP errors, failed requests, dependency issues
  • Performance monitoring: Track page load times, server response times
  • Security auditing: Identify suspicious access attempts or login failures
  • Usage analytics: Understand how users interact with your portal
  • Automated alerts: Get notified about key failures or traffic anomalies

Prerequisites

  • You must be an Administrator in the Power Platform environment
  • Portal should already be provisioned and in a working state
  • Access to Azure Portal (for enabling Application Insights)
  • Power Platform CLI installed if managing via command line

Step-by-Step Guide: Managing Logs and Telemetry in Power Pages


Step 1: Enable Diagnostic Logging (Application Insights)

  1. Go to Power Platform Admin Center
    URL: https://admin.powerplatform.microsoft.com
  2. Select your environment
  3. Under Resources, click Portals and select your portal
  4. Click Manage on the portal record
  5. Scroll to Set up Application Insights
  6. Choose:
    • Create new resource (or select existing Application Insights instance)
    • It will link to Azure Application Insights which will collect telemetry data
  7. Click Save

This will activate logging to Application Insights for your portal.


Step 2: Access and Analyze Logs in Azure Application Insights

  1. Open Azure Portalhttps://portal.azure.com
  2. Navigate to Application Insights > select the resource linked to your portal
  3. Use Features like:
    • Live Metrics: View real-time telemetry
    • Failures: Shows failed requests and exceptions
    • Performance: Measures response times and load times
    • Logs (Analytics): Run Kusto Queries (KQL) to get insights
  4. Example KQL queries:
  • Get failed requests
requests
| where success == false
| order by timestamp desc
  • Check page views
pageViews
| summarize count() by url, bin(timestamp, 1h)
  • Track user sessions
customEvents
| where name == "UserLogin"
| project timestamp, user_Id

Step 3: Enable Site Logs in Power Platform CLI

If you want to manage logs via command line:

  1. Authenticate to your environment:
pac auth create --url https://yourorg.crm.dynamics.com `
--applicationId <client-id> `
--clientSecret <client-secret> `
--tenant <tenant-id>
  1. Download portal configuration (to access site settings and logging):
pac paportal download --path "./PortalLogs"
  1. Check for or modify Site Settings:
  • Name: ApplicationInsightsInstrumentationKey
  • Value: <your-AI-key>

This links your portal with Azure Application Insights manually.


Step 4: Monitor with Built-in Portal Diagnostics Tool

  1. Open your portal website in browser
  2. Append this to the URL:
?portalDiagnostics=true

Example:

https://yourportal.powerappsportals.com/?portalDiagnostics=true
  1. You’ll get a Diagnostics panel with:
    • Request timings
    • Cache hits
    • Page details
    • Fetch performance

This is useful during development and testing.


Step 5: Automate Monitoring and Alerts in Application Insights

In Azure Application Insights:

  1. Go to Alerts+ New Alert Rule
  2. Define:
    • Scope: Your portal resource
    • Condition: Example – Failed requests > 5 in 5 mins
    • Action Group: Email or webhook alert
  3. Save the rule to automate notifications.

Step 6: Export Telemetry Data (Optional)

You can export telemetry data to:

  • Log Analytics Workspace
  • Azure Blob Storage
  • Event Hubs for streaming

This allows long-term storage or downstream processing with tools like Power BI.

To configure export:

  1. Go to Application Insights > Diagnostic settings
  2. Add a new destination
  3. Choose your export method (e.g., Log Analytics)

Best Practices

  • Enable logging early in the lifecycle (Dev & Prod)
  • Keep logs for minimum 90 days to allow sufficient investigation
  • Set up role-based access in Azure for log access
  • Monitor daily reports or dashboards via Application Insights
  • Use anomaly detection in Azure for proactive responses

Common Site Settings Related to Logging

Setting NamePurpose
ApplicationInsightsInstrumentationKeyLinks to AI instance
EnableDiagnosticsLoggingEnables server-side diagnostics
EnableTelemetryTrackingTracks usage patterns and performance
PortalTelemetryOptInEnables portal-wide telemetry

You can add/edit these via Power Apps portal editor under Site Settings or using Power Platform CLI.

Leave a Reply

Your email address will not be published. Required fields are marked *