Skip to content

Commit 217f3d9

Browse files
authored
Merge pull request #10528 from CarlosFigueiraMSFT/carlosff/canvasdocs/usinglivemonitorandtrace
AB#9270: New doc about debugging canvas apps with the live monitor
2 parents 6afb1ae + 01724bd commit 217f3d9

3 files changed

Lines changed: 424 additions & 0 deletions

File tree

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
---
2+
title: Troubleshoot canvas apps if Live monitor is unsupported
3+
description: Debug Power Apps canvas apps by using alternative tools such as Application Insights, Dataverse, and on-screen diagnostics if Live monitor is unsupported.
4+
ms.date: 01/15/2026
5+
ms.reviewer: carlosff, v-shaywood
6+
ms.custom: sap:Running Canvas App
7+
search.audienceType:
8+
- maker
9+
---
10+
11+
# Debug canvas apps without Live monitor
12+
13+
## Summary
14+
15+
This article discusses alternative debugging approaches for Microsoft Power Apps [canvas apps](/power-apps/maker/canvas-apps/getting-started) in scenarios that don't support [Live monitor](/power-apps/maker/monitor-canvasapps). Use these techniques for SharePoint integrated forms, custom pages, or custom portal embeddings in which you can't open Live monitor alongside the app.
16+
17+
Live monitor is the recommended tool for debugging canvas apps because it displays real-time events and works together with the [Trace function](/power-platform/power-fx/reference/function-trace). However, some hosted or embedded scenarios don't support it. This article covers alternatives such as Application Insights, [Dataverse](/power-apps/maker/data-platform/data-platform-intro) logging tables, SharePoint list logging, and on-screen diagnostics panels.
18+
19+
> [!NOTE]
20+
> For scenarios in which Live monitor is supported and available, see [Debug canvas apps with Live monitor and Trace](monitor-debugging-canvas-apps.md).
21+
22+
## Alternative debugging approaches
23+
24+
If Live monitor isn't available, choose one of the following alternative debugging methods based on your environment and needs.
25+
26+
| Alternative | Best for | Notes |
27+
| --------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------- |
28+
| [Application Insights](#application-insights-integration) | Centralized telemetry and performance monitoring | Requires Azure setup. Emits traces and metrics outside Power Apps. |
29+
| [Dataverse logging table](#write-debug-records-to-dataverse) | Ad-hoc diagnostics and audit trails | Create a custom table. Use guarded logic to write records when debugging. |
30+
| [SharePoint list logging](#write-debug-records-to-sharepoint) | Lightweight environments without Dataverse | Use `Collect` or `Patch` (to a list). To control size, prune entries. |
31+
| [On-screen diagnostics panel](#create-an-on-screen-diagnostics-panel) | Immediate feedback during testing | Only for secure audiences. Remove before a broad rollout. |
32+
33+
## Application Insights integration
34+
35+
[Application Insights](/power-apps/maker/canvas-apps/application-insights) provides centralized telemetry for canvas apps. It captures performance metrics, errors, and custom traces in Azure Monitor, where you can analyze data across sessions and users.
36+
37+
This approach requires:
38+
39+
- An Azure subscription
40+
- An Application Insights resource
41+
- Configuration in the Power Apps app settings
42+
43+
For setup instructions, see [Analyze app telemetry using Application Insights](/power-apps/maker/canvas-apps/application-insights).
44+
45+
## Write debug records to Dataverse
46+
47+
To capture diagnostic information if your environment includes Dataverse, create a custom `Debug Logs` table. This approach works well for ad-hoc troubleshooting and audit trails.
48+
49+
### Create the Debug Logs table
50+
51+
1. In [Power Apps](https://make.powerapps.com), go to **Tables**, and create a new table that's named `Debug Logs`.
52+
1. Add the following columns:
53+
- `Title`: A label for the log entry
54+
- `UserEmail`: The email address of the user
55+
- `Timestamp`: When the event occurred
56+
- `Payload`: Additional data in JSON format
57+
- Other columns as necessary for your scenario (for example, `CartCount`, `ScreenName`)
58+
59+
### Example: Write a debug record to Dataverse
60+
61+
Use a guarded [Patch](/power-platform/power-fx/reference/function-patch) call to write records only if a debug query string parameter is present:
62+
63+
```powerfx
64+
If(Param("debug") = "true",
65+
Patch(
66+
'Debug Logs',
67+
Defaults('Debug Logs'),
68+
{
69+
Title: "BeforeSubmit",
70+
UserEmail: User().Email,
71+
CartCount: CountRows(colCart),
72+
Timestamp: Now(),
73+
Payload: JSON({customerId: ddCustomer.Selected.Id})
74+
}
75+
)
76+
);
77+
```
78+
79+
### Run the app in debug mode
80+
81+
To enable debug logging, add `&debug=true` to the app URL. For more information about query string parameters, see [Launch and Param functions](/power-platform/power-fx/reference/function-param).
82+
83+
After you reproduce the issue, open the `Debug Logs` table in Dataverse to review the captured records.
84+
85+
> [!NOTE]
86+
> Remove or disable debug logging before you deploy the app broadly. To manage storage, periodically delete old log entries.
87+
88+
## Write debug records to SharePoint
89+
90+
For lightweight environments without Dataverse, use a [SharePoint](/connectors/sharepointonline/) list to capture debug information.
91+
92+
### Create the debug list
93+
94+
1. In SharePoint, create a list that's named `AppDebugLogs`.
95+
1. Add the following columns:
96+
- `Title`: A label for the log entry
97+
- `UserEmail`: The email address of the user
98+
- `Timestamp`: When the event occurred
99+
- `Payload`: Additional data in JSON format
100+
- Other columns as necessary for your scenario.
101+
102+
### Example: Write a debug record to SharePoint
103+
104+
```powerfx
105+
If(Param("debug") = "true",
106+
Patch(
107+
AppDebugLogs,
108+
Defaults(AppDebugLogs),
109+
{
110+
Title: "BeforeSubmit",
111+
UserEmail: User().Email,
112+
Timestamp: Now(),
113+
Payload: JSON({customerId: ddCustomer.Selected.Id, cartCount: CountRows(colCart)})
114+
}
115+
)
116+
);
117+
```
118+
119+
> [!NOTE]
120+
> SharePoint lists have storage limits. To prevent the list from growing too large, regularly remove old entries.
121+
122+
## Create an on-screen diagnostics panel
123+
124+
For immediate feedback during testing, create a diagnostics panel that displays debug information directly in the app. This approach is useful if you have to see values in real time.
125+
126+
### Collect debug data
127+
128+
Instead of using Trace, add data to a local [collection](/power-apps/maker/canvas-apps/create-update-collection). For example:
129+
130+
```powerfx
131+
If(
132+
Param("debug") = "true",
133+
Collect(
134+
debugTraces,
135+
{
136+
Timestamp: Now(),
137+
Data: $"Before submit for {User().Email} with {CountRows(colCart)} items in the cart"
138+
}
139+
)
140+
)
141+
```
142+
143+
### Add a text control to display traces
144+
145+
Add a text control to the screen that shows the collected traces. Set the **Visible** property of the text control so that the control appears only in debug mode.
146+
147+
#### Control properties
148+
149+
| Property | Value |
150+
| ----------- | ------------------------------------------------------------------------------ |
151+
| **Text** | `Concat(debugTraces, $"[{Text(Timestamp, "hh:mm:ss.fff")}] {Data}", Char(10))` |
152+
| **Visible** | `Param("debug") = "true"` |
153+
| **Height** | 200 |
154+
| **Width** | 300 |
155+
| **X** | `Parent.Width - 320` |
156+
| **Y** | 20 |
157+
158+
This configuration displays a scrollable list of debug messages that you can copy and analyze outside the app.
159+
160+
#### Example YAML as the text control
161+
162+
If you're using Power Apps Studio's YAML view:
163+
164+
```yaml
165+
- TextDebugPanel:
166+
167+
Properties:
168+
Height: =200
169+
Size: =12
170+
Text: |-
171+
=Concat(
172+
debugTraces,
173+
$"[{Text(Timestamp,"hh:mm:ss.fff")}] {Data}",
174+
Char(10))
175+
Visible: =Param("debug") = "true"
176+
Width: =300
177+
X: =Parent.Width - 320
178+
Y: =20
179+
```
180+
181+
> [!IMPORTANT]
182+
> Remove or hide the diagnostics panel before you deploy the app to users. Users who open the app by using the debug parameter shouldn't see internal diagnostic information.
183+
184+
## Best practices for alternative debugging
185+
186+
If you use an alternative debugging approach, follow these guidelines:
187+
188+
- *Guard debug controls*: Use query string parameters (`Param("debug") = "true"`) or role checks to display debug features only during testing.
189+
- *Clean up before deployment*: Remove debug controls, logging calls, and diagnostic panels before you run a broad deployment.
190+
- *Manage log storage*: To manage storage for Dataverse or SharePoint logging, periodically delete old entries.
191+
- *Use meaningful labels*: To make logs easier to analyze, include descriptive titles such as "BeforeSubmit" or "OnVisible_OrderScreen."
192+
- *Include context*: Log the user email, screen name, and relevant data values so you can correlate entries across sessions.
193+
194+
## Related content
195+
196+
- [Collaborative debugging with Live monitor](/power-apps/maker/monitor-collaborative-debugging)
197+
- [Live monitor overview](/power-apps/maker/monitor-overview)

0 commit comments

Comments
 (0)