Hello Rising Flight, to list all the VMs inside an Azure subscription, you would want to do something like this.
Send a GET request to the following API endpoint https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines?api-version=2024-03-01
Check out the source link that I've referenced below to understand the various URI parameters and the responses from the above endpoint
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.