name:Azure VM Performance Diagnostics Feature Not Enabled
author:princechaddha
severity:medium
description:|
Ensure that Performance Diagnostics feature is enabled for your Microsoft Azure virtual machine instances to help mitigate VM performance issues. Performance Diagnostics installs a VM extension that runs PerfInsights, available for both Windows and Linux operating systems. PerfInsights collects and analyzes diagnostic information to provide findings and recommendations for performance issues.
impact:|
Not enabling Performance Diagnostics may lead to unresolved VM performance issues due to lack of insights into VM's operational state.
remediation:|
Enable the Performance Diagnostics feature by installing the AzurePerformanceDiagnostics extension through Azure Portal or Azure CLI commands to mitigate performance issues and ensure optimal VM operation.
az vm list --output json --query '[*].{"Name":name,"ResourceGroup":resourceGroup}'
extractors:
- type:json
name:vmList
internal:true
json:
- '.[]'
- engine:
- sh
- bash
source:|
az vm extension list --vm-name "$name" --resource-group "$resourceGroup" --output json --query '[*].{"ExtensionName": name, "ProvisioningState": provisioningState}'
matchers-condition:and
matchers:
- type:word
part:body
words:
- 'AzurePerformanceDiagnosticsLinux'
- type:word
part:body
words:
- 'Succeeded'
negative:true
extractors:
- type:dsl
dsl:
- '"Performance Diagnostics is not enabled for " + name + " in " + resourceGroup'