A performance counter can be added to your cloud service for either Azure Diagnostics or Application Insights.
For more information: https://docs.microsoft.com/en-us/azure/cloud-services/diagnostics-performance-counters
My steps of Azure Diagnostics:
Open your Cloud Service project in Visual Studio. Go to WebRole’s Properties.
In Properties page -> Click “Configure -> Go to “Performance Counters” Tab -> Add performance counters. For example: \LogicalDisk(C:)% Free Space and \LogicalDisk(C:)\Free Megabytes
Configure a storage account for the Diagnostics results:
Publish the Cloud Service Project into your Cloud Service.
Get the performance counters data from Storage Account Table:
HTH. 2021-3-24 By Jacky