Azure VM Creation with az vm create command

Create Azure Virtual Machine using az vm create command

Prev Question Next Question

Question

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 the Azure portal, launch Azure Cloud Shell and select Bash. Run the command in Cloud Shell.

Does this meet the goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

A

The command can be run in the Azure Cloud Shell.

The Azure Cloud Shell is a free interactive shell. It has common Azure tools preinstalled and configured to use with your account.

To open the Cloud Shell, just select Try it from the upper right corner of a code block. You can also launch Cloud Shell in a separate browser tab by going to https://shell.azure.com/bash.

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-cli

Yes, the solution provided meets the goal of creating a virtual machine named VM1 in Subscription1 using the given command. Here's why:

The given command creates a virtual machine named VM1 in a resource group named RG1. The command specifies the subscription that the resource group belongs to using the --resource-group parameter. However, the command doesn't specify which subscription to use for the deployment.

The proposed solution addresses this issue by using the Azure Cloud Shell, which is a web-based command-line interface that allows you to run commands directly from the Azure portal. By launching the Azure Cloud Shell and selecting Bash, you get a pre-configured shell environment that has all the necessary tools and libraries to run Azure CLI commands.

By running the command in the Azure Cloud Shell, you automatically use the credentials of the account that you used to sign in to the Azure portal. This ensures that the virtual machine is created in the correct subscription, which is Subscription1 in this case.

Therefore, the proposed solution meets the goal of creating a virtual machine named VM1 in Subscription1 using the given command. The correct answer is A. Yes.