I have a python script which simply lists the VMs in a resource group. It was working in the past but for some reason has stopped producing output. All other commands in my script work, it is just this one that is giving me bother. My code is as follows:
credentials = MSIAuthentication()
subscription_client = SubscriptionClient(credentials)
subscription = next(subscription_client.subscriptions.list())
subscription_id = subscription.subscription_id
compute_client = ComputeManagementClient(credentials, subscription_id)
resourceGroup = "myResourceGroup"
for vm in compute_client.virtual_machines.list(resourceGroup):
print(vm)
I have also tried appending an older API version but still nothing is printed. I can confirm there are VMs in this resource group.
I have a similar command for listing VMs in VMSS groups, and it works fine.
Does anyone know what could be the issue with this particular command?
It was working in the past but for some reason has stopped producing output
Is there any error information? – Tom Sun - MSFT