You Need Visibility Into Your Application’s Performance
You’ve deployed your web app or service to Azure. It’s running, users are accessing it, but you’re flying blind. Is it performing well? Are there errors you don’t know about? How many users are active right now?
This is the exact scenario that leads developers and IT pros to search for Application Insights. Without proper telemetry, you’re troubleshooting in the dark, reacting to user complaints instead of proactively managing performance. Azure Application Insights is the built-in solution for this, and setting it up is your first critical step toward observability.
This guide walks you through creating an Application Insights resource directly in the Azure portal. We’ll cover the standard method, integration with existing apps, and key configuration choices that matter for your data and costs.
What Is Azure Application Insights?
Before you create anything, it helps to know what you’re building. Application Insights is an Application Performance Management service. It’s a feature of Azure Monitor designed specifically for developers.
Think of it as a centralized dashboard for your application’s health. Once instrumented, your app sends telemetry data—like requests, dependencies, exceptions, and custom events—to this resource. Application Insights then processes, stores, and visualizes this data, giving you insights into performance, usage patterns, and failures.
It supports a wide range of applications: ASP.NET, Java, Node.js, Python apps hosted on Azure, on-premises, or even other clouds. The creation process in the portal is largely the same regardless of your eventual runtime.
Prerequisites You Must Have Ready
To follow along, you’ll need a few things in place. Don’t worry if you’re just exploring; you can create a free Azure account for this purpose.
First, an active Azure subscription. This could be a Pay-As-You-Go subscription, a Visual Studio Enterprise benefit, or a free trial account. You need permissions to create resources in a resource group.
Second, decide on a resource group. A resource group is a logical container for your Azure resources. It’s best practice to place your Application Insights instance in the same resource group as the application it monitors for easier management. Have a name ready, or we’ll create one.
Finally, know your application type. While not strictly required during creation, knowing whether you’re monitoring an ASP.NET Core app, a Java Spring Boot service, or a static website will help you choose the right configuration later.
Step-by-Step Creation in the Azure Portal
Let’s get to the core action. Log into the Azure portal at portal.azure.com. The interface is consistent, so these steps should match your experience.
Initiating the Create Workflow
From the portal homepage or sidebar, click “Create a resource.” You’ll see the Azure Marketplace. In the search bar at the top, type “Application Insights.” Select the result named “Application Insights” published by Microsoft.
Click the blue “Create” button on the service overview page. This opens the creation blade, where you’ll fill in the essential details.
Filling the Project Details Section
The first section asks for basic project details. Start with your Subscription. The dropdown will show subscriptions you have access to; select the appropriate one.
Next, the Resource Group. You can select an existing group from the dropdown or click “Create new.” If creating new, give it a descriptive name like “monitoring-rg” or “prod-app-insights-rg.”
Then, the Name. This is the name of your Application Insights resource itself. Choose a globally unique name, often combining your app name and environment, like “myapp-prod-insights.” The portal will check availability as you type.
Configuring the Instance Details
The Region is crucial. Select the Azure region geographically closest to where your application is hosted. This minimizes latency when sending telemetry and ensures compliance with data residency requirements. If your app is in East US, choose East US.
Now, the Resource Mode. You will likely see two options: “Workspace-based” and “Classic.” The modern, recommended approach is Workspace-based.
Selecting Workspace-based means your Application Insights data will be stored in a Log Analytics workspace. This unlocks powerful integration with other Azure Monitor logs, uses a unified data platform, and often provides more cost-effective retention. You’ll need to select an existing Log Analytics workspace or create a new one.
If you choose to create a new workspace, give it a name and select a region, often the same as your Application Insights resource.
Instrumenting Your Application After Creation
Creating the resource is only half the battle. The empty resource is like a data warehouse with no deliveries. You must connect your application to it by providing the instrumentation key or connection string.
Finding Your Connection Credentials
Once deployment completes, navigate to your new Application Insights resource. On the overview blade, look for the “Essentials” section at the top. You will see a field labeled “Connection String” or “Instrumentation Key.”
Click the copy icon next to it. This string is the unique identifier that tells your application where to send its telemetry data. Keep it secure like any other secret.
Adding the SDK to Your Code
The method for adding the SDK depends on your application stack. For a typical ASP.NET Core application, you would add the Microsoft.ApplicationInsights.AspNetCore NuGet package.
Then, in your Program.cs file, you add the service and configure the connection string. The exact code varies, but it often looks like adding builder.Services.AddApplicationInsightsTelemetry() and setting the connection string in configuration.
For other languages like Node.js or Java, you would install the corresponding Application Insights SDK package and initialize it with your connection string, usually via an environment variable or configuration file.
Verifying Data Is Flowing
After deploying your instrumented application, return to the Application Insights resource in the portal. Go to the “Investigate” section and click “Live Metrics.”
Generate some traffic to your app by accessing its URL. Within seconds, you should see incoming requests, performance counters, and dependency calls appearing in the Live Metrics stream. This confirms the connection is active.
Key Configuration Settings to Review
With your resource created and data flowing, take a moment to configure settings that control functionality and cost.
Setting Up Sampling and Daily Cap
Telemetry can be voluminous. To control costs, navigate to “Usage and estimated costs” under the Configure section. Here, you can set a daily data volume cap to prevent unexpected charges.
More importantly, consider Adaptive Sampling. Found under “Properties,” this feature automatically reduces the volume of telemetry sent while preserving statistically significant data. For high-traffic applications, enabling sampling is a best practice.
Configuring Availability Tests
To monitor your app’s uptime from outside Azure, set up an availability test. Go to the “Availability” section and click “Add test.”
You can create a simple URL ping test that checks if your homepage loads from multiple global locations. This creates a synthetic transaction that monitors response time and success rate, giving you an external perspective on availability.
Defining Smart Detection and Alerts
Application Insights includes Smart Detection, which uses machine learning to identify unusual failure patterns or performance degradation. Review these settings under “Smart Detection.”
For proactive alerts, go to “Alerts” and create a new alert rule. You can set conditions like “when the average response time is greater than 2 seconds for 5 minutes” and configure email or webhook notifications for your team.
Common Troubleshooting Steps
If you don’t see data after instrumentation, don’t panic. Start with the basics. Double-check that the connection string in your application’s configuration matches exactly the one from the portal. Even a missing character will break it.
Verify your application is actually generating traffic. The SDK sends data in batches. If your app is idle, there may be no data to send. Trigger a few requests manually.
Check for network issues. If your application is hosted on-premises or behind a strict firewall, ensure it can reach the Application Insights ingestion endpoint. The endpoint URL is part of the connection string.
Examine the SDK logs. Most Application Insights SDKs can generate diagnostic logs. Enable verbose logging temporarily to see if the SDK is initializing correctly and attempting to send data.
Alternative Creation Methods
The Azure portal is the most visual method, but it’s not the only one. If you manage infrastructure as code, you can create an Application Insights resource using an ARM template, a Bicep file, or via Terraform.
This is ideal for repeatable, consistent deployments across environments like dev, staging, and production. The resource definition includes the same properties you set in the portal.
You can also create it programmatically using the Azure CLI or Azure PowerShell. For example, the command `az monitor app-insights component create` allows for scripted creation, useful in CI/CD pipelines.
Your Path to Proactive Monitoring
Creating an Application Insights resource is the foundational step in moving from reactive firefighting to proactive application management. You’ve now established the data pipeline.
Your immediate next step should be to explore the data. Spend time in the “Application Map” to see component interactions, check “Failures” for exceptions, and review “Performance” to identify slow operations.
From here, consider deeper integrations. Connect your Application Insights to an Azure Dashboard for a custom view, or set up continuous export to archive raw telemetry for long-term analysis beyond the standard retention period.
The goal is not just to create the resource, but to use the insights it provides to improve your application’s reliability, performance, and ultimately, the user experience. Start simple, monitor the basics, and gradually expand your instrumentation as your needs grow.