Official agent skill

Setup App Insights

by microsoft in microsoft/power-platform-skills

Configure optional customer-owned Application Insights telemetry for a Power Apps mobile app — enable it against an existing Azure resource, change the resource, or disable it.

OfficialMITAuto-check: notesDevOps & Cloud

Install Setup App Insights

skills CLI
$ npx skills add microsoft/power-platform-skills --skill setup-app-insights -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/power-platform-skills setup-app-insights --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/power-platform-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/mobile-apps/skills/setup-app-insights .claude/skills/setup-app-insights && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
setup-app-insights
GitHub stars
967
Token cost
~3.7k tokens
SKILL.md length
1,491 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Configure optional customer-owned Application Insights telemetry for a Power Apps mobile app — enable it against an existing Azure resource, change the resource, or disable it.

  • Works in 6 steps: Detect invocation mode → Inspect and determine the action → Mutation preview + approval → …
  • DevOps & Cloud work in your project
  • SKILL.md covers When to use, When NOT to use, Inputs and Step 1 — Detect invocation mode, plus 9 more sections
  • Calls az, node and npx

What it does

Setup App Insights is an agent skill from microsoft/power-platform-skills, published by the product's own GitHub organization. Configure optional customer-owned Application Insights telemetry for a Power Apps mobile app — enable it against an existing Azure resource, change the resource, or disable it. Standalone, and invoked by /edit-app.

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud. It works with Azure Monitor and Microsoft Azure. The repository describes itself as: A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and… The licence is MIT.

When your agent uses it

  • DevOps & Cloud work in your project

Example prompts

  • “/setup-app-insights”

Requirements

  • Node.js
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion, Skill

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Detect invocation mode
  2. Inspect and determine the action
  3. Mutation preview + approval
  4. Emit the selection telemetry
  5. Verify the provider wiring
  6. 5 — Offer operation instrumentation (enable / change-resource only)

What it can do on your machine

Read from SKILL.md and the folder at commit 5ef4e4f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Glob
    • Grep
    • Bash
    • AskUserQuestion
    • Skill

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • az
    • node
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use az and npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Setup App Insights loads about 3.7k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 1,491 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion, Skill

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/power-platform-skills at commit 5ef4e4f, republished under its MIT licence (© microsoft). 1,491 words, ~3,662 tokens.

Download SKILL.mdSave it as .claude/skills/setup-app-insights/SKILL.md (or your agent's skills folder).
name
setup-app-insights
description
Configure optional customer-owned Application Insights telemetry for a Power Apps mobile app — enable it against an existing Azure resource, change the resource, or disable it. Standalone, and invoked by /edit-app.
allowed-tools
Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion, Skill
user-invocable
true
model
opus

Plugin check: Run node "${PLUGIN_ROOT}/scripts/check-version.js" - if it outputs a message, show it to the user before proceeding.

Shared instructions: shared-instructions.md — read first.

Set up Application Insights

Configures the generated app's optional, customer-owned Application Insights telemetry through app.json → expo.extra.appInsightsConfig. This is host/runtime configuration, not a connector or plan section — it never touches the data model, native-capability matrix, connector list, or screens.

Application Insights is off by default. Invoking this skill (or approving its mutation) is the explicit opt-in; consent is never inferred from an app description.

When to use

  • /setup-app-insights — enable, change, or disable Application Insights on an existing app.
  • Invoked by /edit-app when the request is only an Application Insights change (its Step 0.5 fast path delegates here).
  • Examples: "Enable Application Insights for this app", "Change the Application Insights resource this app uses", "Disable Application Insights for this app".

When NOT to use

  • Adding or changing custom events in app screens → configure Application Insights here first, then continue through /edit-app for those source changes.
  • Data model / connector / native / design / screen changes → the respective /add-*, /setup-*, /edit-app, or /design-system skills.
  • Provisioning a new Azure Application Insights resource → out of scope; this skill discovers or accepts an existing resource.

Inputs

  • working_dir — absolute path to the project root (auto-detected from cwd, or passed by an orchestrator).
  • --action <enable|change-resource|disable> — optional; when omitted, inferred from current state and one question.

Step 1 — Detect invocation mode

Telemetry checkpoint: resolve_app_insights_mode

1. Check env var CODE_APPS_NATIVE_ORCHESTRATING=1
   → Mode A (invoked by /edit-app). Use the passed --working-dir. Return a status block.

2. Else resolve working_dir from cwd (must contain app.json with an expo object)
   → Mode B (standalone). Return a human summary.

Step 2 — Inspect and determine the action

Telemetry checkpoint: determine_app_insights_action

Read, when present:

  • <working_dir>/app.json
  • <working_dir>/app/_layout.tsx
  • <working_dir>/package.json
  • <working_dir>/memory-bank.md

If app.json is missing, malformed, or has no expo object, STOP without mutation (BLOCKED in Mode A). If uncommitted work overlaps app.json or app/_layout.tsx, follow the changed-file overlap approval rule in shared-instructions.md.

Determine the action:

  • enable — appInsightsConfig.enabled is absent or false and the user wants it on.
  • change-resource — already enabled: true and the user wants a different destination.
  • disable — the user wants Application Insights turned off.
  • If intent is ambiguous, ask one AskUserQuestion with those three choices, seeded by the current enabled state.

Step 3 — Mutation preview + approval

Telemetry checkpoint: review_app_insights_change

Show one focused preview and continue only after approval:

text
─── Application Insights ────────────────────────────
Action        <enable | change resource | disable>
Current       enabled: <true|false>
Configuration app.json → expo.extra.appInsightsConfig
Provider      app/_layout.tsx → PowerAppsProvider appConfig
Sensitive     connection string is never printed or stored in memory-bank.md

Ask: Apply this Application Insights change?

Step 4 — Emit the selection telemetry

After the action is confirmed, record the choice through Mobile Apps usage telemetry (enabled for enable/change-resource, disabled for disable):

bash
node "${PLUGIN_ROOT}/hooks/run-telemetry.js" \
  app-insights-selection \
  "<enabled-or-disabled>" \
  "<prompt-or-pretool>" \
  "<working_dir>"

Pass the invocation source so the event's invocationSource matches how the skill was reached: pretool in Mode A (delegated from another skill such as /edit-app via the Skill tool) and prompt in Mode B (the user ran /setup-app-insights directly).

This event follows the existing Mobile Apps telemetry controls and contains no Application Insights resource details or connection string. It fails open and never blocks the skill.

Step 5a — enable / change-resource

Telemetry checkpoint: configure_app_insights_resource

Discover Application Insights resources visible to the current Azure CLI identity:

bash
az resource list \
  --resource-type Microsoft.Insights/components \
  --query "[].{name:name,id:id,resourceGroup:resourceGroup,location:location}" \
  -o json

Branch on the result:

  • One or more resources returned: use AskUserQuestion to let the user select one. Before configuring it, confirm the selected component is workspace-based — az resource list returns every Microsoft.Insights/components, including classic components, which are not compliant with this skill's contract. Read properties.WorkspaceResourceId from the selected resource:

    bash
    WORKSPACE_RESOURCE_ID=$(
      az resource show \
        --ids "<selected-resource-id>" \
        --api-version 2020-02-02 \
        --query properties.WorkspaceResourceId \
        -o tsv
    )

    If WORKSPACE_RESOURCE_ID is empty, the resource is a classic (non-workspace-based) component: do not configure it. Explain that only a workspace-based Application Insights resource is supported, and let the user select a different resource or use the admin handoff below. Otherwise retrieve its connection string without printing it:

    bash
    APP_INSIGHTS_CONNECTION_STRING=$(
      az resource show \
        --ids "<selected-resource-id>" \
        --api-version 2020-02-02 \
        --query properties.ConnectionString \
        -o tsv
    )
  • Not logged in: tell the user to run az login, then retry discovery once.

  • No subscription/resource access or authorization failure: explain that Application Insights Azure RBAC is separate from Power Platform and Entra app-registration permissions. Offer an admin handoff: an administrator can create/select one workspace-based Application Insights resource and give the user its connection string.

  • No resources returned: ask whether the user wants to paste an administrator-provided connection string or leave telemetry disabled. Do not require the user to create Azure resources.

When accepting a pasted connection string, use AskUserQuestion freeform and never repeat the answer in chat or command output. Validate only that it contains InstrumentationKey= and either an IngestionEndpoint= or that the standard public-cloud default can be used. Do not store the connection string in memory-bank.md.

Update <working_dir>/app.json so expo.extra.appInsightsConfig contains:

json
{
  "expo": {
    "extra": {
      "appInsightsConfig": {
        "enabled": true,
        "connectionString": "<selected-or-pasted-connection-string>",
        "appId": "<appId>",
        "environment": "development",
        "includeUserId": false
      }
    }
  }
}

Field rules:

  • appId — preserve the existing non-empty value; otherwise use expo.slug, then package.json name.
  • environment / includeUserId — preserve existing values; default to "development" and false. Never turn on user identity collection implicitly.
  • Set enabled: true and replace only the connection string. Create the appInsightsConfig object when missing, and preserve every other app.json field.

Never print the connection string, pass it to another agent, write it to native-app-plan.md or memory-bank.md, or include it in a summary.

Runtime notes (for screen work that follows)

The app uses @microsoft/applicationinsights-web with the React Native manual-device plugin. The first runtime event is PowerAppsNative.ApplicationStarted, a deterministic ingestion check after loading the app in Dev Player. The runtime exposes two intentionally different loggers:

ts
import {
  getAppLogger,
  getCustomEventsLogger,
} from '@microsoft/power-apps-native-host';
  • getAppLogger() is the host/runtime logger; its events continue to Microsoft OneDS and also fan out to the configured Application Insights resource.
  • getCustomEventsLogger() is for the app's custom events; it goes only to the configured Application Insights resource and is a no-op when custom events are disabled.
  • Generate custom event calls only when the user explicitly requested those events or an approved screen spec has a Custom events entry. Never use getAppLogger() for custom events.
  • Telemetry properties must be approved scalar values (result codes, durations, counts, screen identifiers, operation names). Never include form values, free text, record titles, names, emails, phone numbers, tokens, precise coordinates, nested objects, or complete URLs.

Persist in memory-bank.md (never the connection string):

markdown
- Custom events: enabled
- Custom events app ID: <appId>
- Custom events resource ID: <selected-resource-id or admin-provided>
- Custom events destination: one customer-owned workspace-based Application Insights resource
Show full SKILL.md (566 more words)Show less

Step 5b — disable

Telemetry checkpoint: disable_app_insights

Set enabled: false, clear connectionString, and preserve appId and environment when present. Keep includeUserId: false unless an existing explicitly approved value must be preserved. Do not require Azure sign-in or resource discovery.

json
{
  "expo": {
    "extra": {
      "appInsightsConfig": {
        "enabled": false,
        "connectionString": "",
        "appId": "<appId>",
        "environment": "development",
        "includeUserId": false
      }
    }
  }
}

Persist Custom events: disabled and the app ID in memory-bank.md; remove stale resource ID / destination lines.

Step 6 — Verify the provider wiring

Telemetry checkpoint: verify_app_insights_provider

Confirm app/_layout.tsx imports the root app.json and passes the complete object to PowerAppsProvider:

tsx
import appConfig from '../app.json';

<PowerAppsProvider appConfig={appConfig}>

If either part is missing, patch only the import and the appConfig prop; preserve all other provider props and layout behavior. Run npx tsc --noEmit only when app/_layout.tsx changed.

Parse app.json with Node after the mutation and assert:

  • enable / change-resource: enabled === true and connectionString is non-empty.
  • disable: enabled === false and connectionString === "".

Step 6.5 — Offer operation instrumentation (enable / change-resource only)

Telemetry checkpoint: offer_operation_instrumentation

This skill only wires the telemetry pipeline; it never edits screens or generated services. Enabling Application Insights emits host-level signals (app load, unhandled errors, navigation) automatically, but domain events like todo_created or order_deleted are custom events and require source changes. Those changes belong to /edit-app → screen-planner → screen-builder, which emit named events through getCustomEventsLogger under the existing scalar-only, no-PII allowlist. Offer that follow-up here; never instrument operations from this skill.

Run this step only after a successful enable or change-resource. Skip it entirely for disable.

  • Mode B (standalone): ask one AskUserQuestion, defaulting to No (instrumentation is opt-in, mirroring Application Insights being off by default):

    Application Insights is on. Want me to add custom events for your app's major operations (create / update / delete)?

    • Yes → invoke /edit-app with a scoped instrumentation brief and let its normal edit flow discover the entities, screens, and operation boundaries (this skill does not read the data model or screens):

      Invoke skill: /edit-app
      
      Arguments:
        Add custom events at each successful create, update, and
        delete boundary for the app's main entities. Emit named events through
        getCustomEventsLogger with approved scalar properties only — no
        operation results, response payloads, form values, free text, record
        titles, personal identifiers, tokens, precise coordinates, nested
        objects, or complete URLs. Use trackScenario() for any duration.
    • No → finish with the normal Mode B summary.

  • Mode A (invoked by /edit-app): do not ask the user or re-invoke /edit-app from here — that would loop back into the orchestrator. Instead signal the available follow-up in the return block (instrumentation_offer: available) so /edit-app surfaces the offer after the fast path completes.

Support boundary

This skill discovers or accepts an existing Application Insights resource; it does not provision Azure resources. If the user lacks Azure access and has no administrator-provided connection string, leave telemetry disabled without blocking — the app runs fine with custom events off.

Return

Mode A (invoked by /edit-app) — status block, first line is the status code:

DONE
action: <enable|change-resource|disable>
enabled: <true|false>
app_id: <appId>
layout_patched: <yes|no>
instrumentation_offer: <available|none>

instrumentation_offer is available only after a successful enable/change-resource (see Step 6.5); use none for disable or when telemetry was not turned on. Use DONE_WITH_CONCERNS: <list> when applied with caveats (e.g. an admin-provided string that could not be verified), NEEDS_CONTEXT: <missing> when a required input is unavailable, and BLOCKED: <reason> when app.json is unusable.

Mode B (standalone) — human summary:

Application Insights <enabled|updated|disabled> for this app. Configuration: app.json → expo.extra.appInsightsConfig To change the resource or turn it off later, run /setup-app-insights again.

After an enable/change-resource, if the user accepted the Step 6.5 offer, note that operation instrumentation was handed to /edit-app; if they declined, mention they can run /edit-app later to add custom operation events.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/mobile-apps/skills/setup-app-insights of microsoft/power-platform-skills.

Open the folder on GitHubat commit 5ef4e4f

Compare with similar skills

Setup App Insights next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Setup App Insights compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Setup App Insights this skillmicrosoft/power-platform-skills967—~3.7kAutomated safety check: NotesMIT
Azure Diagnosticsmicrosoft/GitHub-Copilot-for-Azure2551 repos~1.6kAutomated safety check: PassMIT
Azure Monitor Ingestion Javamicrosoft/skills3.1k6 repos~2kAutomated safety check: PassMIT
Azure Monitor Ingestion Pymicrosoft/skills3.1k6 repos~2kAutomated safety check: PassMIT
Azure Monitor Opentelemetry Exporter Javamicrosoft/skills3.1k6 repos~2.2kAutomated safety check: PassMIT
Azure Monitor Opentelemetry Exporter Pymicrosoft/skills3.1k6 repos~2.3kAutomated safety check: PassMIT

Similar skills

  • Azure Diagnostics

    microsoft/GitHub-Copilot-for-Azure

    Official

    Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage.

    255 GitHub starsUsed in 1 repo~1.6k tokens
    DevOps & CloudAuto-check passed
  • Official

    Azure Monitor Ingestion SDK for Java. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~2k tokens
    DevOps & CloudAuto-check passed
  • Official

    Azure Monitor Ingestion SDK for Python. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~2k tokens
    DevOps & CloudAuto-check passed
  • Azure Monitor OpenTelemetry Exporter for Java. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~2.2k tokens
    DevOps & CloudAuto-check passed
  • Official

    Azure Monitor OpenTelemetry Exporter for Python. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~2.3k tokens
    DevOps & CloudAuto-check passed
  • Official

    Azure Monitor OpenTelemetry Distro for Python. An agent skill from microsoft/skills.

    3.1k GitHub starsUsed in 6 repos~2k tokens
    DevOps & CloudAuto-check passed

More from microsoft/power-platform-skills

All 87 skills in this repo
  • Manage Firewall

    microsoft/power-platform-skills

    Official

    Inspects and configures the web application firewall (WAF) in front of a Power Pages production site.

    967 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check: notes
  • Manage Headers

    microsoft/power-platform-skills

    Official

    Inspects and configures the security headers a Power Pages site sends to browsers — Content Security Policy, frame and clickjacking protection, cross-origin sharing, cookie behavior, and related…

    967 GitHub stars~3k tokensUpdated yesterday
    Auto-check: notes
  • Scan Code

    microsoft/power-platform-skills

    Official

    Scans a Power Pages site project for security issues in source code and dependencies.

    967 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check: notes
  • Scan Site

    microsoft/power-platform-skills

    Official

    Runs a security scan on a deployed Power Pages site, fetches the latest scan report, and produces a plain-language summary.

    967 GitHub stars~3.2k tokensUpdated yesterday
    Auto-check: notes
  • Setup Datamodel

    microsoft/power-platform-skills

    Official

    Creates Dataverse tables, columns, and relationships for a Power Pages site based on a data model proposal.

    967 GitHub stars~4k tokensUpdated yesterday
    Auto-check: notes
  • Add Server Logic

    microsoft/power-platform-skills

    Official

    Creates, edits, and manages Power Pages Server Logic files — server-side JavaScript that runs securely on the Power Pages runtime.

    967 GitHub stars~18k tokensUpdated yesterday
    Auto-check: notes

Categories

Questions about Setup App Insights

What does Setup App Insights do?

Configure optional customer-owned Application Insights telemetry for a Power Apps mobile app — enable it against an existing Azure resource, change the resource, or disable it. Setup App Insights is an agent skill from microsoft/power-platform-skills, published by the product's own GitHub organization. Configure optional customer-owned Application Insights telemetry for a Power Apps mobile app — enable it against an existing Azure resource, change the resource, or disable it.

When should I use Setup App Insights?

Setup App Insights fits situations like: devOps & Cloud work in your project.

How do I install Setup App Insights in Claude Code?

Run `npx skills add microsoft/power-platform-skills --skill setup-app-insights -a claude-code`. Or copy the skill folder (plugins/mobile-apps/skills/setup-app-insights in microsoft/power-platform-skills) into .claude/skills/setup-app-insights in your project. Claude Code loads it when a task matches its description.

How do I install Setup App Insights in Codex?

Run `npx skills add microsoft/power-platform-skills --skill setup-app-insights -a codex`. Or copy the skill folder (plugins/mobile-apps/skills/setup-app-insights in microsoft/power-platform-skills) into .agents/skills/setup-app-insights in your project. Codex loads it when a task matches its description.

Can I use Setup App Insights in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/power-platform-skills --skill setup-app-insights -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/setup-app-insights, .gemini/skills/setup-app-insights, .github/skills/setup-app-insights and .opencode/skills/setup-app-insights in your project.

What does Setup App Insights need to run?

Going by SKILL.md and its folder, Setup App Insights needs the command-line tools its instructions call (az, node and npx). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion, Skill.

Does Setup App Insights access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Setup App Insights safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Setup App Insights use?

Setup App Insights is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Setup App Insights use?

About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Setup App Insights?

Skills that share tags, products or a category with Setup App Insights: Azure Diagnostics (microsoft/GitHub-Copilot-for-Azure, 255 stars), Azure Monitor Ingestion Java (microsoft/skills, 3.1k stars), Azure Monitor Ingestion Py (microsoft/skills, 3.1k stars) and Azure Monitor Opentelemetry Exporter Java (microsoft/skills, 3.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Setup App Insights?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/power-platform-skills, which has 967 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/power-platform-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.