Edit

Share via


Run performance diagnostics reports on Azure virtual machines

Applies to: ✔️ Linux VMs ✔️ Windows VMs

Performance diagnostics helps you identify and troubleshoot performance problems on Azure virtual machines. This article describes how to install performance diagnostics and run on-demand reports on your Azure virtual machine (VM).

Prerequisites

  • To run continuous and on-demand diagnostics on Windows, you need .NET SDK version 4.5 or later.

Supported machines

This article describes how to install and run performance diagnostics on the following machines:

Install the Azure Performance Diagnostics VM extension for the following machines:

Supported operating systems

The following operating systems are currently supported for both on-demand and continuous diagnostics:

  • Windows Server 2025
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2012
  • Windows 11
  • Windows 10

Permissions required

To run performance diagnostics and view the reports, you need the permissions listed in the following table.

Action Authentication type Permissions required
Run performance diagnostics Storage Account Access Keys The Owner role on the VM and an Azure role that includes the Microsoft.Storage/storageAccounts/listkeys/action permission on the storage account.
Run performance diagnostics Managed Identities (System-assigned and User-assigned) The Owner role on the VM and an Azure role that includes the Microsoft.Storage/storageAccounts/providers/roleAssignments/write permission on the storage account.
View performance diagnostics Storage Account Access Keys An Azure role that includes the Microsoft.Storage/storageAccounts/listkeys/action permission on the storage account or the Storage Table Data Reader role on the storage account.
View performance diagnostics Managed Identities (System-assigned and User-assigned) An Azure role that includes the Storage Table Data Reader role on the storage account.
Download performance diagnostics reports All An Azure role that includes the Storage Table Data Reader role and the Storage Blob Data Reader role on the storage account.

For detailed information about built-in roles for Azure Storage, see Azure built-in roles for Storage. For more information about storage account settings, see view and manage storage account and stored data.

If the VM has SQL Server instances installed on it, PerfInsights uses the account NT AUTHORITY\SYSTEM to access the SQL Server instances to collect configuration information and run rules. You must grant the account NT AUTHORITY\SYSTEM the View Server State permission and Connect SQL permission for each instance. Otherwise, PerfInsights can't connect to the SQL Server and the PerfInsights report doesn't show any SQL Server related information.

Install performance diagnostics on a VM

Performance diagnostics installs a VM extension that runs a diagnostics tool, called PerfInsights. PerfInsights is available for both Windows and Linux.

You can install the performance diagnostics tool from multiple locations in the Azure portal:

  • From the menu for the virtual machine. In the Help section of the menu, select Performance diagnostics. Select Enable performance diagnostics.

    Screenshot of the Performance diagnostics pane in the Azure portal that shows the Enable performance diagnostics button highlighted.

  • From the Overview page for the virtual machine. Select the Monitoring tab and then select Install at the bottom of the Install performance diagnostics tile.

    Screenshot of the Overview pane in the Azure portal that shows the Install performance diagnostics tile highlighted.

  • From VM insights. Select Virtual machines from the Insights section of the Monitor menu and select the VM that you want to run diagnostics on. Select Install at the bottom of the Install Performance Diagnostics tile.

    Screenshot of the Insights pane in the Azure portal that shows the Install performance diagnostics tile highlighted.

Each location displays the same configuration screen with options you must configure before selecting Apply to install the tool.

Screenshot of the installation screen with the configuration options.

Each option is described in the following table.

Option Description
Enable continuous diagnostics Get continuous, actionable insights into high resource usage by having data collected every five seconds and updates uploaded every five minutes to address performance issues promptly. Store insights in your preferred storage account. The storage account retains insights based on the account retention policies that you can configure to manage the data lifecycle effectively. You can disable continuous diagnostics at any time.
Run on-demand diagnostics Runs an on-demand report when the installation is complete. You can choose to run any of these reports later. See the list of reports and their description at On-demand diagnostics.
Storage account Specify a storage account if you want to use a single account for multiple VMs. Otherwise the default diagnostics storage account or creates a new storage account. See view and manage storage account and stored data.
Authentication method Authentication method to use as described in Authentication methods.
Threshold settings (Preview) Specify optional user-defined threshold values that override the default thresholds used by performance diagnostics to generate insights based on workload-specific resource usage patterns.

A notification is displayed as performance diagnostics starts to install, and you receive a second notification when it completes. This process typically takes about a minute. If you selected the Run on-demand diagnostics option, the selected performance analysis scenario runs for the specified duration.

Install in standalone mode

By using standalone mode, you can run performance diagnostics without installing the extension on the VM. This mode is useful for troubleshooting performance problems on non-Azure VMs or when you want to run diagnostics without modifying the VM configuration. You must sign in interactively to the VM to run PerfInsights in standalone mode.

  1. Download PerfInsights.zip.

  2. Unblock the PerfInsights.zip file. To do this, right-click the PerfInsights.zip file, and select Properties. In the General tab, select Unblock, and then select OK. This action ensures that the tool runs without any other security prompts.

    Screenshot of PerfInsights Properties, with Unblock highlighted.

  3. Expand the compressed PerfInsights.zip file to your temporary drive.

On-demand reports

The following sections describe the on-demand reports available in performance diagnostics.

You can run the following on-demand reports from Windows machines:

Quick analysis

This scenario collects the disk configuration and other important information, including:

  • Event logs
  • Network status for all incoming and outgoing connections
  • Network and firewall configuration settings
  • Task list for all applications that are currently running on the system
  • Microsoft SQL Server database configuration settings (if VM is running SQL Server)
  • Storage reliability counters
  • Important Windows hotfixes
  • Installed filter drivers

This is a passive collection of information that shouldn't affect the system.

Note

This scenario is automatically included in each of the following scenarios.

Benchmarking

This scenario runs the Diskspd benchmark test (IOPS and MBPS) for all drives that are attached to the VM.

Note

This scenario can affect the system, and shouldn't be run on a live production system. If necessary, run this scenario in a dedicated maintenance window to avoid any problems. An increased workload that is caused by a trace or benchmark test can adversely affect the performance of your VM.

Performance analysis

This scenario runs a performance counter trace by using the counters that are specified in the RuleEngineConfig.json file. If the VM is identified as a server that is running SQL Server, a performance counter trace is run. It does so by using the counters that are found in the RuleEngineConfig.json file. This scenario also includes performance diagnostics data.

Azure Files analysis

This scenario runs a special performance counter capture together with a network trace. The capture includes all the Server Message Block (SMB) client shares counters. The following are some key SMB client share performance counters that are part of the capture:

Type SMB client shares counter
IOPS Data Requests/sec
Read Requests/sec
Write Requests/sec
Latency Avg. sec/Data Request
Avg. sec/Read
Avg. sec/Write
IO Size Avg. Bytes/Data Request
Avg. Bytes/Read
Avg. Bytes/Write
Throughput Data Bytes/sec
Read Bytes/sec
Write Bytes/sec
Queue Length Avg. Read Queue Length
Avg. Write Queue Length
Avg. Data Queue Length

Advanced performance analysis

When you run an advanced performance analysis, you select traces to run in parallel. If you want, you can run them all (Performance Counter, Xperf, Network, and StorPort).

Note

This scenario can affect the system, and shouldn't be run on a live production system. If necessary, run this scenario in a dedicated maintenance window to avoid any problems. An increased workload that is caused by a trace or benchmark test can adversely affect the performance of your VM.

Run reports

Run continuous diagnostics

You don't need to run continuous diagnostics manually. The performance diagnostics extension runs continuously on the VM and uploads the results. For instructions on enabling and disabling continuous diagnostics, see Install performance diagnostics on Azure virtual machines.

Run on-demand diagnostics

Follow one of these methods to run on-demand diagnostics.

If you installed the performance diagnostics extension on the VM, you can run diagnostics from the Azure portal. From the Performance diagnostics option in the VM menu, select Run diagnostics. Then select the report to run and its duration.

Warning

Possible performance impact

Be aware of the following potential performance impacts on the VM when you run performance diagnostics.

  • For the benchmarking scenario or the "Advanced performance analysis" scenario that is configured to use Xperf or Diskspd, the tool might adversely affect the performance of the VM. Don't run these scenarios in a live production environment.
  • For the benchmarking scenario or the "Advanced performance analysis" scenario that you configure to use Diskspd, ensure that no other background activity interferes with the I/O workload.
  • By default, the tool uses the temporary storage drive to collect data. If tracing stays enabled for a longer time, the amount of data that is collected might be relevant. This condition can reduce the availability of space on the temporary disk, and can therefore affect any application that relies on this drive.

If you installed the standalone version of PerfInsights, you can run on-demand diagnostics from the command line.

Open Windows command prompt as an administrator, and then run PerfInsights.exe to view the available commandline parameters and their descriptions.

cd <the path of PerfInsights folder>
PerfInsights

Screenshot of PerfInsights commandline output.

The basic syntax for running PerfInsights scenarios is:

PerfInsights /run <ScenarioName> [AdditionalOptions]

Use the /list command to view the list of supported scenarios:

PerfInsights /list

Following are examples of running different troubleshooting scenarios:

  • Run the performance analysis scenario for 5 minutes:
PerfInsights /run vmslow /d 300 /AcceptDisclaimerAndShareDiagnostics
  • Run the advanced scenario with Xperf and Performance counter traces for 5 minutes:
PerfInsights /run advanced xp /d 300 /AcceptDisclaimerAndShareDiagnostics
  • Run the benchmark scenario for 5 minutes:
PerfInsights /run benchmark /d 300 /AcceptDisclaimerAndShareDiagnostics
  • Run the performance analysis scenario for 5 minutes and upload the result zip file to the storage account:
PerfInsights /run vmslow /d 300 /AcceptDisclaimerAndShareDiagnostics /sa <StorageAccountName> /sk <StorageAccountKey>

Before running a scenario, PerfInsights prompts you to agree to share diagnostic information and to agree to the EULA. Use /AcceptDisclaimerAndShareDiagnostics option to skip these prompts.

If you have an active support ticket with Microsoft and running PerfInsights per the request of the support engineer you are working with, make sure to provide the support ticket number using the /sr option.

By default, PerfInsights will try updating itself to the latest version if available. Use /SkipAutoUpdate or /sau parameter to skip auto update.

If the duration switch /d is not specified, PerfInsights will prompt you to repro the issue while running vmslow, azurefiles and advanced scenarios.

When the traces or operations are completed, a new file appears in the same folder as PerfInsights. The name of the file is PerformanceDiagnostics_yyyy-MM-dd_hh-mm-ss-fff.zip. You can send this file to the support agent for analysis or open the report inside the zip file to review findings and recommendations.

Authentication methods

Performance diagnostics supports Managed Identities and Storage account access keys as authentication methods to write performance diagnostics data to the storage account:

Note

For optimal security, Microsoft recommends using Microsoft Entra ID with managed identities to authorize requests against blob, queue, and table data, whenever possible. Authorization with Microsoft Entra ID and managed identities provides superior security and ease of use over Shared Key authorization.

  • System-assigned managed identity

    This method is the default authentication method. Performance diagnostics adds the Storage Table Data Contributor role and the Storage Blob Data Contributor role for the storage account, to the system-assigned managed identity. For more information, see How to enable system-assigned managed identity on an existing VM.

  • User-assigned managed identity

    Select a user-assigned managed identity from a list of user-assigned managed identities associated with the VM. Performance diagnostics adds the Storage Table Data Contributor role and the Storage Blob Data Contributor role for the storage account, to the user-assigned managed identity. For more information, see How to assign a user-assigned managed identity to an existing VM.

  • Storage account access keys

    Select storage account access keys. If you disable Allow storage account key access for the storage account, the installation operation fails. For more information, see Shared key authorization.

To change the authentication method, uninstall performance diagnostics and reinstall it.

Note

After you link the managed identities to the VM, it might take a few minutes for performance diagnostics to propagate and recognize them. If the installation fails, wait a few minutes and try again.

View and manage storage account

Performance diagnostics stores all insights and reports in a binary large object (BLOB) container in a storage account that you can configure for short data retention to minimize costs. You can use the same storage account for multiple VMs that use performance diagnostics or use a separate account for each VM.

If you select Storage account access keys for the Authentication method during installation of performance diagnostics, you must enable the Allow storage account key access setting for the storage account.

Screenshot of the configuration settings for storage account.

If you change the storage account after installation, the old reports and insights aren't deleted, but they're no longer displayed in the list of diagnostics reports.

Note

If your storage account uses private endpoints, ensure that you add DNS configuration to each separate private endpoint for performance diagnostics to access storage.

View stored data

To view diagnostics data, go to your storage account in the Azure portal and select Storage browser.

Screenshot of the storage account screen that shows the performance diagnostics insights and report files.

Performance diagnostics stores reports in a BLOB container named azdiagextnresults, and insights in tables. Insights include:

  • All the insights and related information about the run
  • An output compressed file named PerformanceDiagnostics_yyyy-MM-dd_hh-mm-ss-fff.zip on Windows and a tar file named PerformanceDiagnostics_yyyy-MM-dd_hh-mm-ss-fff.tar.gz on Linux that contains log files
  • An HTML report

To download a report, select the container and then click Download.

Change storage account

To view or change the storage account for performance diagnostics, select View or edit diagnostic settings when running on-demand diagnostics or enabling continuous diagnostics. You can also view the configured storage account under the Settings page in performance diagnostics.

Screenshot of the performance diagnostics settings screen on which you can change storage accounts.

Threshold settings (Preview)

Performance diagnostics monitors CPU, memory, and disk usage to generate insights into virtual machine (VM) performance. It generates insights when observed resource utilization exceeds or falls below threshold values during continuous or on-demand diagnostics runs.

By default, predefined threshold values determine when resource usage is high or low. For workloads that operate at consistently elevated utilization levels, default thresholds might generate frequent insights that don't indicate abnormal system behavior.

Use threshold settings to configure custom values for supported resource signals so that insights are generated only when usage deviates from the expected operating range of your workload. For example, if a virtual machine is expected to run at sustained CPU utilization, you can increase the configured CPU threshold so that insights are generated only when usage exceeds that level.

Configure threshold values for the following resource signals for both continuous and on-demand diagnostics. Available categories depend on the VM operating system.

Category Threshold Description Continuous default On-demand default
CPU Aggregate CPU (%) Average CPU usage across all logical processors. Considered high when this value is exceeded. 30 30
CPU Per-core CPU (%) CPU usage of any individual processor core. Considered high when this value is exceeded for any core. 80 80
Memory Available Memory (%) Percentage of free system memory. Considered low when below this value. 10 10
Memory (Windows) Commit in Use (%) Percentage of committed memory in use. Considered high when this value is exceeded. 90 90
Disk (Windows) IOPS Write (%) Percentage of write I/O operations on a disk. Considered high when this value is exceeded for any disk. 30 30
Disk (Windows) IOPS Read (%) Percentage of read I/O operations on a disk. Considered high when this value is exceeded for any disk. 40 40

Select View or edit diagnostic settings under Threshold settings (Preview) when you do the following tasks:

  • Enable performance diagnostics
  • Run on-demand diagnostics
  • Enable continuous diagnostics

Threshold values remain in effect until you update them.

Screenshot of the performance diagnostics threshold settings screen where you can configure threshold values.

View the default and currently configured threshold values under the Settings page in performance diagnostics. The insights displayed are generated based on the current threshold values. Here's an example screenshot of the threshold settings for a Linux VM:

Screenshot of the performance diagnostics insights screen that shows the threshold values that were used to generate insights.

Uninstall performance diagnostics

When you uninstall performance diagnostics from a VM, you remove the VM extension but don't affect any diagnostics data in the storage account.

To uninstall performance diagnostics, select the Uninstall button on the toolbar.

Screenshot of the performance diagnostics screen toolbar that shows the Uninstall button highlighted.

Next steps