You have a resource group named RG1.
You need to prevent the creation of virtual machines only in RG1. The solution must ensure that other objects can be created in RG1.
What should you use?
Click on the arrows to vote for the correct answer
A. B. C. D.D
Azure policies can be used to define requirements for resource properties during deployment and for already existing resources. Azure Policy controls properties such as the types or locations of resources.
Azure Policy is a service in Azure that you use to create, assign, and manage policies. These policies enforce different rules and effects over your resources, so those resources stay compliant with your corporate standards and service level agreements.
In this question, we would create an Azure policy assigned to the resource group that denies the creation of virtual machines in the resource group.
You could place a read-only lock on the resource group. However, that would prevent the creation of any resources in the resource group, not virtual machines only. Therefore, an Azure Policy is a better solution.
https://docs.microsoft.com/en-us/azure/governance/policy/overviewThe correct answer is D. an Azure policy.
Explanation: Azure Policy is a service in Azure that enables you to create, assign, and manage policies. These policies enforce rules and effects over your resources to ensure they remain compliant with your corporate standards and service level agreements. Azure Policy can be used to prevent certain types of resources from being created in a resource group.
A lock is used to lock down a resource so that it cannot be modified or deleted. It does not prevent the creation of new resources.
An Azure role is used to grant permissions to users or groups to perform specific tasks within a subscription or resource group. It does not prevent the creation of new resources.
A tag is used to label resources for management purposes. It does not prevent the creation of new resources.
Therefore, the correct option to prevent the creation of virtual machines only in RG1 is to use an Azure policy. An Azure policy can be used to define a policy that only allows the creation of certain types of resources in a resource group. In this case, the policy would prevent the creation of virtual machines in RG1, while allowing the creation of other types of resources.
Yes, the solution provided meets the goal of creating a virtual machine named VM1 in Subscription1 using the specified command.
The solution suggests using the Azure Cloud Shell to run the command in PowerShell. The Azure Cloud Shell is an interactive shell environment that provides access to the Azure CLI (Command-Line Interface) or PowerShell commands directly from the Azure portal, without the need for any local installations. The user can choose between using PowerShell or Bash as the default shell environment.
By launching Azure Cloud Shell and selecting PowerShell, the user can easily run the command to create the virtual machine named VM1, as per the instructions provided in the scenario. The user needs to ensure that they are logged in to the correct subscription before executing the command.
Overall, the proposed solution is a valid approach to creating the virtual machine in the desired resource group and subscription, and it meets the requirements stated in the scenario.