Configuring access to Azure resources by assigning roles

If a user in your organization needs permissions to access Azure resources, you need to assign the user to the appropriate role in Azure. In this section, we are going to assign administrator access to a user for a VM. First, we need to run a script in Azure Cloud Shell to create the VM. Let's get started:

  1. Navigate to the Azure portal by opening https://portal.azure.com/.
  2. Open Azure Cloud Shell.
  1. First, we need to create a new resource group:
az group create --location eastus --name PacktVMResourceGroup
  1. Then, we need to create the VM:
az vm create 
--resource-group PacktVMResourceGroup
--name VM1
--image win2016datacenter
--admin-username packtuser
--admin-password PacktPassword123
  1. Now that we have the VM in place, we can configure access to the VM for the user. Open the PacktVMResourceGroup resource group and select VM1 from the list.
  2. You will be redirected to the VM settings blade.
  3. In the settings blade, select Access control (IAM) from the left menu and click on AddAdd a role assignment, which can be found in the top menu:

Access control settings
  1. In the Add role assignment blade, specify the following values:

The Add role assignment blade
  1. Click on Save.
  2. The user now has administrator permissions on the VM.

In this section, we assigned administrator access to a user for a VM. Now, we're going to learn how to configure management access to Azure.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset