
Answer-first summary for fast verification
Answer: Yes
The solution meets the goal because: 1) The command 'az vm create' is an Azure CLI command that runs in Bash, which is supported in Azure Cloud Shell. 2) Azure Cloud Shell automatically uses the active Azure subscription context, which in this case is Subscription1 (as established by signing into the portal and creating RG1). 3) The resource group RG1 already exists in Subscription1, so the command will successfully create VM1 within it. Community consensus (64% selected A, with highly upvoted comments confirming the command works in Cloud Shell Bash) supports this, noting that the subscription context is inherited and the command syntax is correct for Bash. Alternative views suggesting it's a PowerShell command or requires explicit subscription selection are incorrect, as 'az' commands are Azure CLI (Bash-compatible) and Cloud Shell defaults to the active subscription.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have an Azure subscription named Subscription1. You create a resource group named RG1 from the Azure portal.
You find the following command in the Azure documentation for creating a virtual machine named VM1:
az vm create --resource-group RG1 --name VM1 --image UbuntuLTS --generate-ssh-keys
You need to create VM1 in Subscription1 using this command.
Solution: You launch Azure Cloud Shell from the Azure portal, select the Bash environment, and run the command in Cloud Shell.
Does this solution meet the goal?
A
Yes
B
No
No comments yet.