Hello Aravind,
Thank you for reaching out Q/A.
I understand that you are looking for a supported and programmatic way to retrieve the count and details of running applications/processes inside an Azure Virtual Machine.
To set the right expectation, Azure does not expose process-level information at the platform (fabric) level, since all running processes exist within the guest operating system. As a result, retrieving this information always requires either executing commands inside the VM or using a supported monitoring agent.
Below are the recommended and supported approaches:
1.VM Insights with Processes & Dependencies:
This is the primary Azure-native and fully supported approach for continuously monitoring running processes inside a VM.
How it works:
- Enable VM Insights from the Azure Portal (VM → Monitoring → Insights)
- During setup, ensure “Enable processes and dependencies” is selected
- This deploys the Azure Monitor Agent (AMA) along with the Dependency Agent
- Process data is collected into the VMProcess table in the Log Analytics workspace
- You can use KQL queries to retrieve process details and process counts
Reference: https://learn.microsoft.com/en-us/azure/azure-monitor/vm/tutorial-enable-monitoring
2.Performance Counter for Process Count:
For near real-time monitoring of process count metrics, you can configure custom performance counters using a Data Collection Rule (DCR) with the Azure Monitor Agent.
- Works for both Windows and Linux VMs
- Useful for alerting scenarios (for example, when process count exceeds a threshold)
- Best suited for numeric monitoring rather than detailed process inspection
Reference: https://learn.microsoft.com/en-us/azure/azure-monitor/vm/data-collection-performance
- Azure VM Run Command (On-Demand / Ad-hoc)
For one-time or ad-hoc retrieval without relying on continuous monitoring:
Windows:
az vm run-command invoke --resource-group <ResourceGroupName> --name <VMName> --command-id RunPowerShellScript --scripts "(Get-Process).Count"
Note: This approach is recommended for on-demand checks only and is not suitable for continuous monitoring or alerting scenarios.
Please refer below documentations also:
https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/vmprocess
Monitor Azure Virtual Machines
Query map data from VM Insights
Hope this helps! Please let me know if you have any queries.