Azure-Samples / azure-sdk-for-go-samples

Examples of how to utilize Azure services from Go.
MIT License
297 stars 184 forks source link

[question]: correct way to list VMs via API #289

Open raffaelespazzoli opened 3 years ago

raffaelespazzoli commented 3 years ago

Thank you for your contribution and feedback! Help us review faster by providing the following information:

This issue is a: (mark with an x)

Steps to reproduce:

I'm trying to get a list of VMs, I'm running this call:

i.compute.ListComplete(context, resourceGroupName)

and I get an empty result, not an error.

If I do the same from the command line:

az vm list -g cluster-raffa-zqh7w-rg

using the same resourceGroupName, I get the expected result? What am I doing wrong? Could this be a permission issue? Currently the account used to make the call has this role: "Virtual Machine Contributor".

I get the same empty result set also with:

i.compute.List(context, resourceGroupName)