Skip to content

application-insights: list operation uses old API version, missing workspaceResourceId field #9613

@berniedurfee-amira

Description

@berniedurfee-amira

Description

az monitor app-insights component show (list all components) uses API version 2018-05-01-preview, which does not return the workspaceResourceId field. This makes all workspace-based Application Insights resources appear to be classic (non-workspace-based) when listed.

The same command with --app and --resource-group (get single component) correctly uses API version 2020-02-02-preview, which does return the workspaceResourceId field.

Reproduction

# List all - uses api-version=2018-05-01-preview - workspaceResourceId is MISSING
az monitor app-insights component show --debug 2>&1 | grep api-version
# Output: api-version=2018-05-01-preview

az monitor app-insights component show --query "[0].workspaceResourceId" -o json
# Output: null (even for workspace-based resources)

# Get single - uses api-version=2020-02-02-preview - workspaceResourceId is PRESENT
az monitor app-insights component show --app MyAppInsights --resource-group MyRG --debug 2>&1 | grep api-version
# Output: api-version=2020-02-02-preview

az monitor app-insights component show --app MyAppInsights --resource-group MyRG --query "workspaceResourceId" -o json
# Output: "/subscriptions/.../workspaces/my-workspace" (correct)

Workaround

Use az rest with the correct API version:

az rest --method get \
  --url "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components?api-version=2020-02-02"

This returns the full resource properties including WorkspaceResourceId for all components.

Impact

  • Auditing scripts that list all App Insights resources to check workspace-based migration status will incorrectly report all resources as classic
  • AI-assisted infrastructure audits are misled by the missing field, leading to incorrect recommendations
  • The ingestionMode field shows LogAnalytics in the list output (suggesting workspace-based), but the actual workspace reference is absent, creating a contradictory response

Environment

  • Azure CLI: 2.83.0
  • application-insights extension: 2.0.0b1 (also reproduced on 1.2.3)
  • OS: macOS (darwin 25.2.0)

Expected Fix

Update the list operation in the application-insights extension to use api-version=2020-02-02 (or later) instead of 2018-05-01-preview, matching the API version already used by the single-resource get operation.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamMonitorcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions