Access Denied error

Chris Dennick 21 Reputation points
2024-01-12T21:56:05.13+00:00

I am getting the following error when trying to create a VM in the sandbox. (AuthorizationFailed) The client 'me' with object id 'my OID' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/e6b1a91a-7af1-4025-8a99-f717210b4a91/resourcegroups/group1' or the scope is invalid. If access was recently granted, please refresh your credentials. Code: AuthorizationFailed Message: The client 'me' with object id 'my OIDWindow - Exercise - Create an Azure virtual machine - Training Microsoft Learn - Google Chrome.png' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/e6b1a91a-7af1-4025-8a99-f717210b4a91/resourcegroups/group1' or the scope is invalid. If access was recently granted, please refresh your credentials.

Azure VMware Solution
Azure VMware Solution
An Azure service that runs native VMware workloads on Azure.
317 questions
0 comments No comments
{count} votes

Accepted answer
  1. shiva patpi 13,141 Reputation points Microsoft Employee
    2024-01-12T23:17:17.1233333+00:00

    Hello @Chris Dennick , As per the document: https://learn.microsoft.com/en-us/training/modules/describe-azure-compute-networking-services/3-exercise-create-azure-virtual-machine You have to use only that sandbox resource group which was created at the time sandbox was activated for you , but you are using own resource group called as group1 which you will not have access to. So please find out the resource group created for you by using the below command: az group list , it will show you a resource group name: Example from my sandbox: resource groups created for learning will be prefixed with learn-

    shiva [ ~ ]$ az group list
    [
      {
        "id": "/subscriptions/f27a2135-1ae7-44b2-b514-f0b7b1dcbfba/resourceGroups/learn-187ec592-45cd-46ba-8efb-00b3730c95ef",
        "location": "westus",
        "managedBy": null,
        "name": "learn-187ec592-45cd-46ba-8efb-00b3730c95ef",
        "properties": {
          "provisioningState": "Succeeded"
        },
        "tags": {
          "x-created-by": "productsandboxes",
          "x-created-for": "f9c26ace-6860-4a0f-b4fe-93021ed48343",
          "x-module-id": "learn.wwl.describe-azure-compute-networking-services"
        },
        "type": "Microsoft.Resources/resourceGroups"
      }
    ]
    
    
    

    Then use that particular name to create the VM: Example from my sandbox

    shiva [ ~ ]$ az vm create --resource-group learn-187ec592-45cd-46ba-8efb-00b3730c95ef --name my-vm --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
    SSH key files '/home/shiva/.ssh/id_rsa' and '/home/shiva/.ssh/id_rsa.pub' have been generated under ~/.ssh to allow SSH access to the VM. If using machines without permanent storage, back up your keys to a safe location.
    {
      "fqdns": "",
      "id": "/subscriptions/f27a2135-1ae7-44b2-b514-f0b7b1dcbfba/resourceGroups/learn-187ec592-45cd-46ba-8efb-00b3730c95ef/providers/Microsoft.Compute/virtualMachines/my-vm",
      "location": "westus",
      "macAddress": "00-0D-3A-5C-09-2F",
      "powerState": "VM running",
      "privateIpAddress": "10.0.0.4",
      "publicIpAddress": "20.245.204.12",
      "resourceGroup": "learn-187ec592-45cd-46ba-8efb-00b3730c95ef",
      "zones": ""
    }
    

    Kindly let us know if you have additional questions!! Regards, Shiva.


0 additional answers

Sort by: Most helpful