Edit

Manage telemetry settings for the Power Apps CLI

This article explains how to manage Power Apps CLI telemetry settings so you can view the current status, enable or disable collection, and configure console output for debugging or support.

Why enable telemetry?

When telemetry is enabled, the CLI can collect:

Telemetry data Description
Activity events High-level actions, such as running commands or completing scenarios.
Error events Failures and exceptions, including error names and messages.
Scenario timing Start and stop events for key operations and their elapsed time.
Environment context Non-personally identifiable metadata about the environment and region.
Tenant identifier The current tenant ID when the CLI is authenticated.

Note

Telemetry failures never block CLI operations.

Manage telemetry with CLI commands

Use the following commands to manage telemetry:

Command Description
pa telemetry enable Enable telemetry collection.
pa telemetry disable Disable telemetry collection.
pa telemetry status Display the current telemetry settings.

For example:

pa telemetry disable
pa telemetry status

These settings persist across CLI runs.

Configure console output

The CLI stores user-configurable settings in userSettings.json in the .powerapps-cli configuration directory.

The .powerapps-cli folder is located in the location designated by the USERPROFILE environment variable.

You can create the file manually or use the following PowerShell script:

$settingsPath = Join-Path $env:USERPROFILE ".powerapps-cli\userSettings.json"
$settingsDir = Split-Path $settingsPath
if (-not (Test-Path $settingsDir)) { New-Item -ItemType Directory -Path $settingsDir -Force }
$settings = @{
    enabled = $true
    consoleOnly = $false
    outputToConsole = $false
}
$settings | ConvertTo-Json | Set-Content $settingsPath

The file supports the following properties:

{
  "enabled": true,
  "consoleOnly": false,
  "outputToConsole": false
}
Property Description
enabled Indicates whether remote telemetry is enabled.
consoleOnly Writes telemetry only to the console and doesn't send it remotely.
outputToConsole Mirrors remotely sent telemetry events to the console.

Telemetry enabled, remote only (default)

If the file doesn't exist, remote telemetry is enabled and telemetry isn't written to the console.

{
  "enabled": true,
  "consoleOnly": false,
  "outputToConsole": false
}

Telemetry fully disabled

{
  "enabled": false,
  "consoleOnly": false,
  "outputToConsole": false
}

Set outputToConsole to true if you still want to see events.

Telemetry enabled, remote, and console

The system sends events remotely and prints them locally.

{
  "enabled": true,
  "consoleOnly": false,
  "outputToConsole": true
}

Console-only telemetry (no remote send)

To write telemetry to the console without sending it remotely, use:

{
  "enabled": false,
  "consoleOnly": true,
  "outputToConsole": false
}
  • enabled is effectively ignored for remote sending.
  • outputToConsole isn't required because console logging is implied.

Pipe telemetry to a file

When console output is enabled, you can redirect output from a command such as pa app add data-source to a file for debugging or support.

Windows Command Prompt

pa app add data-source ... > telemetry.log 2>&1

PowerShell (Windows, macOS, Linux)

pa app add data-source ... | Out-File -FilePath telemetry.log -Encoding utf8