
Answer-first summary for fast verification
Answer: Yes
The solution meets the goal because Azure Cloud Shell, even when PowerShell is selected, supports running Azure CLI commands (like 'az vm create'). The community discussion includes multiple users who tested this command in Cloud Shell with PowerShell selected and confirmed it works (e.g., comments with upvotes like 78, 12, and 8). While some users argued that 'az vm create' is a Bash command and PowerShell uses 'New-AzVm', the consensus from practical testing and Microsoft documentation (e.g., Cloud Shell's welcome message: 'Type "az" to use Azure CLI') shows that Azure CLI commands are cross-compatible in Cloud Shell's PowerShell environment. The command does not explicitly specify the subscription, but Cloud Shell uses the default subscription context, which is Subscription1 as per the scenario. Thus, the solution is valid.
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 are provided with the following command from the Azure documentation to create 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: Launch Azure Cloud Shell from the Azure portal and select PowerShell. Run the command in Cloud Shell.
Does this solution meet the goal?
A
Yes
B
No
No comments yet.