Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✔️ Linux VMs ✔️ Windows VMs
Performance Diagnostics helps identify and troubleshoot performance issues 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 a later version installed.
Note
To install Performance Diagnostics on classic VMs, see Azure Performance Diagnostics VM extension.
Supported operating systems
The following operating systems are currently supported for both on-demand and continuous diagnostics:
- Windows Server 2022
- Windows Server 2019
- Windows Server 2016
- Windows Server 2012 R2
- Windows Server 2012
- Windows 11
- Windows 10
Permissions required
The permissions in the following table are required to run Performance Diagnostics and view the reports.
| 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, refer to 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. The account NT AUTHORITY\SYSTEM must be granted View Server State permission and Connect SQL permission for each instance, otherwise PerfInsights won't be able to connect to the SQL Server and the PerfInsights report won'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
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.
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.
Each option displays the same set of options that you must configure before selecting Apply to install the tool. These options are 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. |
A notification is displayed as Performance Diagnostics starts to install, and you'll receive a second notification when it completes. This typically takes about a minute. If you selected the Run on-demand diagnostics option, the selected performance analysis scenario is then run for the specified duration.
Install in standalone mode
Using standalone mode, you can run performance diagnostics without installing the extension on the VM. This mode is useful for troubleshooting performance issues on non-Azure VMs or when you want to run diagnostics without modifying the VM configuration. You must log in interactively to the VM to run PerfInsights in standalone mode.
Download PerfInsights.zip.
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.
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
There's no need to run continuous diagnostics manually. The Performance Diagnostics extension runs continuously on the VM and uploads the results. See Install Performance Diagnostics on Azure virtual machines for instructions on enabling and disabling continuous diagnostics.
Run on-demand diagnostics
There are two 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 and 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. These scenarios shouldn't be run in a live production environment.
- For the benchmarking scenario or the "Advanced performance analysis" scenario that is configured 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 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.
cd <the path of PerfInsights folder>
PerfInsights
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 is the default authentication method. If system-assigned managed identity is selected but not enabled for the VM, Performance Diagnostics attempts to enable it. If the current user lacks the necessary permissions, this operation might fail. 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
The user can select one 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
The user can select storage account access keys. If Allow storage account key access is disabled 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
Once the managed identities are linked to the VM, it might take a few minutes for them to be propagated and recognized by Performance Diagnostics. 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.
To ensure Performance Diagnostics functions correctly, you must enable the Allow storage account key access setting for the storage account. To enable this setting, open the storage account in the Azure portal and select the Configuration menu item.
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, navigate to your storage account in the Azure portal and select Storage browser.
Performance Diagnostics stores reports in a binary large object (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.zipon Windows and a tar file namedPerformanceDiagnostics_yyyy-MM-dd_hh-mm-ss-fff.tar.gzon Linux that contains log files - An HTML report
To download a report, select the container and then click Download.
Change storage account
To change storage accounts, open Performance diagnostics from the Azure portal as described in Install Performance Diagnostics on a VM. Select Settings to open the Performance diagnostic settings screen.
Select Change storage account to select a different storage account.
Uninstall Performance Diagnostics
Uninstalling Performance Diagnostics from a VM removes the VM extension but doesn't affect any diagnostics data that's in the storage account.
To uninstall Performance Diagnostics, select the Uninstall button on the toolbar.