Skip to content

Use workspace-based App Insights resources#

Operational Excellence · Application Insights · Rule · 2021_06 · Important

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.

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.WorkspaceResourceId property to a valid Log Analytics workspace.

For example:

Azure Template snippet
{
  "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.WorkspaceResourceId property to a valid Log Analytics workspace.

For example:

Azure Bicep snippet
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
  }
}

Configure with Azure Verified Modules

A pre-built module is avilable on the Azure Bicep public registry. To reference the module, please use the following syntax:

br/public:avm/res/insights/component:<version>

Comments