Build Application Insights configurations with availability tests and sampling.
Last verified: May 2026
Build Application Insights configs with availability tests, sampling, smart detection, and diagnostics.
Required Fields
nameresourceGroupapplicationTypeworkspaceResourceIdretentionInDaysOutput will appear here...Azure Application Insights is an APM (Application Performance Management) service in Azure Monitor that provides deep observability into application performance, availability, and usage. Configuration involves setting up the instrumentation connection string, configuring sampling to control data volume and cost, defining availability tests (URL ping and multi-step), setting up custom metrics and dimensions, and configuring alerting on performance anomalies. The Config Builder helps you define Application Insights settings including sampling percentages, availability test configurations, and smart detection rules.
Sampling reduces the volume of telemetry sent to Application Insights while preserving statistically accurate metrics. Adaptive sampling (the default in ASP.NET SDKs) automatically adjusts the rate to stay near a target volume. Fixed-rate sampling applies a consistent percentage across all telemetry. Ingestion sampling is applied server-side on telemetry that has already been sent. For production applications generating more than 5 GB/month, configure sampling to control costs. A 25% sampling rate typically provides sufficient data for trend analysis while reducing costs by 75%.
URL ping tests send a single HTTP GET request from selected Azure locations and check for a valid response with optional content matching. Standard tests (formerly multi-step) support HEAD, GET, and POST methods with custom headers, request bodies, SSL certificate validation, response time thresholds, and dependent request tracking. Standard tests are more flexible and recommended for new availability monitoring. Both test types run at 5-15 minute intervals from up to 16 Azure locations, and you can alert on consecutive failures from a configured number of locations.
Your team's web app generates 50K events/sec at peak. With no sampling, that's $30K/month in Application Insights ingestion. The builder helps configure adaptive sampling targeting 200 events/sec (preserving statistically significant patterns), URL ping tests from 5 locations every 5 minutes for availability monitoring, and smart detection rules for response time and failure rate anomalies. New monthly cost: $400. The 250x reduction comes with no observable impact on debugging capability — at 200 events/sec, you have plenty of samples for trend analysis and rare error investigation.
The builder generates Application Insights resource configurations: workspace-based AI resource (linked to Log Analytics workspace), connection string output for SDK initialization, sampling configuration (adaptive with target events/sec, fixed-rate, or no sampling), availability tests (URL ping or standard test definitions with location list), smart detection rules. Output is generated as az monitor app-insights commands and Terraform azurerm_application_insights + azurerm_application_insights_standard_web_test resources.
Adaptive sampling is the right default for production apps. The default target of ~5 events/sec preserves enough data for trends without breaking the bank. For high-traffic apps where 5 events/sec is too low to debug rare issues, raise the sampling target rather than disabling sampling entirely — the cost of unsampled telemetry can be staggering.
Standard tests are dramatically more capable than URL ping tests but they cost more (~$1/test/month vs $0.10). For most apps, URL ping tests at 5-10 minute intervals from 5 locations are sufficient. Reserve standard tests for endpoints needing POST validation, dependent request tracking, or response content matching beyond simple keyword.
Custom dimensions cost extra (each unique dimension value × event count contributes to ingestion). Be deliberate: track userId on every event and you'll quintuple your data volume vs sampling 1 in 100 users. Use `track*` events with intentional, low-cardinality dimensions only.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.