Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have an Azure subscription named Subscription1. You sign in to the Azure portal and create a resource group named RG1.
From Azure documentation, you have the following command that creates 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 by using the command.
Solution: From a computer that runs Windows 10, install Azure CLI. From a command prompt, sign in to Azure and then run the command.
Does this meet the goal?
Click on the arrows to vote for the correct answer
A. B.A
The command can be run from PowerShell or the command prompt if you have the Azure CLI installed.
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latestThe given solution suggests that to create a virtual machine named VM1 in Subscription1 using the provided command, you should install Azure CLI on a computer running Windows 10. You would then sign in to Azure from a command prompt and execute the command az vm create --resource-group RG1 --name VM1 --image UbuntuLTS --generate-ssh-keys
.
To determine if this solution meets the goal, let's break it down:
Installing Azure CLI: Azure CLI is a command-line tool that allows you to interact with Azure resources. By installing Azure CLI on a Windows 10 computer, you gain access to the necessary command-line interface to manage Azure resources.
Signing in to Azure: After installing Azure CLI, you need to sign in to your Azure subscription. This step ensures that you have the required permissions and access to create resources in Subscription1.
Executing the command: Once you are signed in to Azure through Azure CLI, you would run the command az vm create --resource-group RG1 --name VM1 --image UbuntuLTS --generate-ssh-keys
. This command creates a virtual machine named VM1 within the resource group RG1. The virtual machine is based on the UbuntuLTS image, and the --generate-ssh-keys
flag generates SSH keys for authentication.
Based on the provided solution, it appears to meet the goal of creating VM1 in Subscription1. However, it's important to note that the solution assumes you have a Windows 10 computer available and that you have installed Azure CLI correctly. If these prerequisites are met, the solution should work as intended.
Therefore, the answer is A. Yes.
Yes, the solution meets the goal of creating a virtual machine named VM1 in Subscription1 using the provided command.
The solution suggests installing Azure CLI on a Windows 10 computer and then signing in to Azure from a command prompt to run the command that creates the virtual machine. Azure CLI is a command-line interface that allows you to manage Azure resources from the command prompt, and it supports the same commands as the Azure portal.
To create the virtual machine named VM1 in Subscription1, the command specified in the question is required. This command creates a virtual machine with the name VM1, using the UbuntuLTS image, and generates SSH keys for authentication. By specifying the --resource-group parameter with the value of RG1, the virtual machine is created in the resource group named RG1, which was already created in the subscription.
Therefore, the suggested solution meets the goal of creating the virtual machine named VM1 in Subscription1 by using the command provided in the question. The solution is valid because it uses Azure CLI, which is a supported method of managing Azure resources, and signs in to Azure to ensure that the command is executed in the correct subscription.