1

According to this Official document example from MS Azure team, the following command should display all the VMs in my current subscription. But when I logged-in with my subscription and run the following command, it just brings me back to the command line with no output and no error. I do have VMs in this subscription, and the same login with the same subscription is working for other tasks I am performing in the same session. Question: What I may be missing here, and how can we resolve the issue?

PS C:\Users\MyUserName> Get-azVM
PS C:\Users\MyUserName>

1 Answer 1

2

Are you Signed into Azure Connect-AzAccount

Do you have more than one subscription?
If so you might need to switch subscriptions.

Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"
Sign up to request clarification or add additional context in comments.

2 Comments

Yes. Welcome to StackOverflow. I am using then new az module and not the old one AzureRM module
It worked now after using Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx". Include your comment in your response. I'll mark it as an Answer so to complete this post - thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.