Skip to content

Latest commit

 

History

History
194 lines (148 loc) · 9.56 KB

APPLICATION-INSIGHTS.md

File metadata and controls

194 lines (148 loc) · 9.56 KB

Application Insights

Documentation | Monitoring | Log fields

Start here when telemetry is missing or incomplete. For everyday queries and alerts, use monitoring.

Task Go to
Understand where records come from Collection
Choose the correct table Signals and tables
Check one deployment Single region
Check several regions Multiple regions
Diagnose missing data Coverage checks
Review privacy and sampling Limits

Function telemetry covers execution, timing, and logs. Microsoft Entra ID sign-ins and provider delivery evidence are separate.

Collection

The Functions host records invocation telemetry. The language worker runs the endpoint and writes application logs. A worker exporter needs its own initialization, authentication, filters, and sampling.

Application Insights stores data in its linked Log Analytics workspace. Correlation can connect requests, dependencies, exceptions, and traces when the active pipeline exports them.

Repository defaults

Runtime Checked-in configuration Verify after deployment
.NET Host uses telemetryMode: OpenTelemetry. The project references Functions OpenTelemetry and Azure Monitor packages. Program.cs does not register a separate worker exporter. Confirm which worker logs, dependencies, and exceptions are present.
JavaScript Standard host Application Insights settings. Requests are excluded from sampling. There is no direct Application Insights or OpenTelemetry exporter in the package manifest. Confirm outbound dependency coverage.
Python Standard host Application Insights settings. Requests are excluded from sampling. There is no Azure Monitor or OpenTelemetry exporter in requirements. Confirm structured properties and dependencies.

These are source defaults, not guarantees. Runtime versions, packages, settings, filters, and sampling can change the collected data.

Application events are logs, not guaranteed customEvents. Verify the runtime format before saving queries.

For additional worker instrumentation, follow the Azure Functions OpenTelemetry guidance for the selected language. Check correlation and duplicate records after any change.

Signals and tables

Signal Workspace table Notes
HTTP requests AppRequests Includes duration, result code, success, role, and operation. Easy Auth can reject before invocation. HTTP success does not prove delivery.
Application logs AppTraces Includes messages, severity, and exported properties. Filters and sampling can remove records.
Outbound calls AppDependencies Includes only instrumented dependencies. Coverage differs by runtime and library.
Exceptions AppExceptions Includes captured and exported exceptions. Handled failures may appear only as sanitized logs or HTTP responses.
Custom metrics AppMetrics Requires emitted measurements and a working export path.
Custom events AppEvents Requires explicit event telemetry. A named log does not automatically become an event.
Availability results AppAvailabilityResults Requires an availability test or custom telemetry. Guided setup does not create tests.

Application Insights metrics, workspace logs, Azure resource metrics, resource logs, Activity Log, and Resource Health are different sources. A chart and a log query can use different sampling, dimensions, and retention. Check the resource's supported metrics and diagnostic categories before building an alert.

See the Application Insights data model and Functions monitoring reference.

Single region

Guided setup connects one Function App to one Application Insights resource backed by a Log Analytics workspace.

Check the following:

  1. Destination: On the Function App, confirm APPLICATIONINSIGHTS_CONNECTION_STRING points to the intended resource. Do not copy it into issues or screenshots.
  2. Workspace: On Application Insights, confirm the linked workspace.
  3. Ingestion authentication: Confirm authenticated ingestion and the Function identity's scoped publisher role.
  4. Runtime settings: Review the selected runtime's host and worker configuration, log levels, and sampling.
  5. Authorized request: Run a non-delivering evaluation through the supported test process, allow for ingestion delay, then check AppRequests and AppTraces.
  6. Live path: Validate provider acceptance and recipient delivery separately through an approved controlled test.

A 401 or 403 can be rejected before the Function runs. Evaluation does not contact the provider. Background credential refresh can run independently.

Ingestion identity

The template configures:

  • APPLICATIONINSIGHTS_AUTHENTICATION_STRING=Authorization=AAD
  • the Function App's system-assigned managed identity
  • Monitoring Metrics Publisher on the Application Insights resource
  • DisableLocalAuth: true

The connection string selects the destination. The managed identity authenticates ingestion. The outbound provider identity is separate.

If you intentionally use a user-assigned ingestion identity, set ClientId=<identity-client-id>;Authorization=AAD, attach that identity to the app, and grant it access to the destination. Do not use the provider application ID.

Missing data can result from a wrong destination, missing role assignment, identity mismatch, role propagation, an inactive exporter, filters, sampling, DNS, or network access. Query access is separate from ingestion access.

See Functions collection configuration and Microsoft Entra-authenticated ingestion.

Multiple regions

Each region has its own Function App and identity. Validate telemetry for every origin. Application Insights does not provide application routing or failover.

Layout Use
Application Insights and workspace per region Strong regional separation. Queries and access must include each workspace.
Application Insights per region with a shared workspace Separate components with one query destination. Retention, access, and ingestion share the workspace boundary.
One shared Application Insights component Requires distinct stable role names and ingestion access for every identity. Shared quotas and ingestion become common dependencies.

Keep an inventory of Function App, region, Application Insights component, workspace, role name, runtime, and owner. Workspace location and client geography do not prove execution region.

Use explicit sources and regional labels in multi-region queries. Monitor Front Door edge and origin signals separately from Function telemetry.

Coverage checks

Run these in the linked Log Analytics workspace.

Requests

AppRequests
| where TimeGenerated > ago(1h)
| summarize StoredRows = count(),
    RepresentedRequests = sum(ItemCount),
    Latest = max(TimeGenerated)
    by _ResourceId, AppRoleName, Name, ResultCode, Success
| order by Latest desc

Dependencies

AppDependencies
| where TimeGenerated > ago(1h)
| summarize StoredRows = count(), Latest = max(TimeGenerated)
    by _ResourceId, AppRoleName, DependencyType, Success
| order by Latest desc

Logs

AppTraces
| where TimeGenerated > ago(1h)
| summarize StoredRows = count(), Latest = max(TimeGenerated)
    by _ResourceId, AppRoleName, SeverityLevel
| order by Latest desc

An absent table, query error, or empty result is not a healthy zero. Check scope, time range, traffic, access, filters, sampling, and ingestion. ItemCount is a sampling weight when supplied. It does not recover discarded records.

Limits

  • Sampling and filters: JavaScript and Python exclude host requests from sampling, not every signal. .NET OpenTelemetry mode does not use the same classic settings.
  • Delivery: Host success, HTTP success, provider acceptance, and recipient delivery are different outcomes.
  • Completeness: Buffering, cold starts, process exits, network failures, throttling, caps, retention, and exporter configuration affect stored telemetry.
  • Privacy: Do not collect phone numbers, OTPs, request bodies, encrypted payloads, nonces, tokens, credentials, private keys, or raw provider responses. Review auto-captured URLs, query strings, dependency fields, and exception text.
  • Access and cost: Restrict query and export access. Set retention and daily caps deliberately. A cap can create a monitoring blind spot.

Next: use the monitoring tasks and queries or the endpoint troubleshooting guide.