Use workspace-based App Insights resources
March 21, 2025 ยท View on GitHub
SYNOPSIS
Configure Application Insights resources to store data in a workspace.
DESCRIPTION
Application Insights (App Insights) can be deployed as either classic or workspace-based resources. When configured as workspace-based, telemetry is sent from App Insights to a common Log Analytics workspace. New App Insights resources must have a workspace configured during initial deployment.
Using a Log Analytics workspace for App Insights:
- Makes it easier to correlate issues and query across application components.
- Adds support for additional features of Log Analytics workspaces including:
- Customer-Managed Keys (CMK).
- Support for Azure Private Link.
- Capacity Reservation tiers.
- Faster data ingestion.
!!! Warning "Classic App Insights resources are retired" Classic App Insights resources are were retired on the 29 February 2024. Consider migrating to workspace-based resources.
RECOMMENDATION
Consider using workspace-based Application Insights resources to collect telemetry in shared storage.
EXAMPLES
Configure with Azure template
To deploy Application Insights resources that pass this rule:
- Set the
properties.WorkspaceResourceIdproperty to a valid Log Analytics workspace.
For example:
{
"type": "microsoft.insights/components",
"apiVersion": "2020-02-02",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"kind": "web",
"properties": {
"Application_Type": "web",
"Flow_Type": "Redfield",
"Request_Source": "IbizaAIExtension",
"WorkspaceResourceId": "[parameters('workspaceId')]"
}
}
Configure with Bicep
To deploy Application Insights resources that pass this rule:
- Set the
properties.WorkspaceResourceIdproperty to a valid Log Analytics workspace.
For example:
resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
name: name
location: location
kind: 'web'
properties: {
Application_Type: 'web'
Flow_Type: 'Redfield'
Request_Source: 'IbizaAIExtension'
WorkspaceResourceId: workspaceId
}
}