How to Fix AuthorizationFailed in Sandbox

Isa⭐ 5 Reputation points
2024-06-24T02:04:04.54+00:00

I am trying to create a virtual machine using Azure CLI in the sandbox of a learning module. The module asks me to use the command [az vm create] and asks me to copy and paste the following command into Bash on the sandbox [az vm create --resource-group "learn-0b8635bf-d13e-4d10-86f0-ebd0e1e96417" --name my-vm --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys].

After entering the command, I am given the response [AuthorizationFailed] and in the message, it also says my account [does not have authorization to perform action]. The message suggested [If access was recently granted, please refresh your credentials], so I refreshed but I was still unable to create a vm.

I went to the support page under browse common issues, and I was able to find my issue on the page. The section with my issue suggested I [try the steps again by signing in through a new, private browser window], but after trying to sign in through a private browser, I was still unable to make a vm and was given the same message. I am wondering how I can solve this problem so I can create a vm in the sandbox and continue with the modules?

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,206 questions
{count} vote

1 answer

Sort by: Most helpful
  1. pnaroju 1,885 Reputation points Microsoft Vendor
    2024-06-24T07:53:17.4166667+00:00

    Hi Isa,

    Thank you for reaching out to us on the Microsoft Q&A forum.

    We understand you are experiencing issues creating a VM in the sandbox while working through the module "Describe Azure compute and networking services."

    Here are the troubleshooting steps to resolve the issue:

    1. Sign Out of Existing Azure Portal: Ensure you completely sign out from the Azure portal created in the previous module unit "Exercise - Create an Azure resource," which has an active Microsoft Learn sandbox directory with a Concierge subscription.
    2. Sign Out of Azure Cloud Shell: Sign out completely from the existing Azure Cloud Shell sandbox or wait until the sandbox activation time expires.
    3. Activate a New Sandbox: Click on the "Activate Sandbox" button to activate a new sandbox. This will create a default subscription called "Concierge subscription" along with a default resource group name starting with "learn." We recommend using a different browser or an incognito/private window to rule out any browser-related issues.
    4. Verify Resource Group Name: Sign in to the Azure portal and verify that the resource group name used in the "az vm create" command matches the one displayed in the Azure portal for the sandbox environment.
    5. Refresh the Sandbox Environment: Since you lack permission to modify the sandbox environment and the error indicates an authorization problem, the most effective solution is to refresh the Microsoft Learn sandbox environment. This will recreate the environment with the appropriate permissions.
    6. Follow Microsoft Learn Instructions: Follow the instructions provided in the exercise within the Microsoft Learn document. These instructions are tailored for the sandbox environment and often use Cloud Shell commands to avoid permission issues. Ensure you are running the Azure CLI commands in the correct directory (Microsoft Learn Sandbox) and with the correct subscription selected.

    Kindly note that in a sandbox environment, the access control configurations are pre-set and typically cannot be modified by the user.

    If you continue to face issues, please let us know in the comments. We are here to help.

    If you find this information helpful, please acknowledge by clicking the "Upvote" and "Accept Answer" buttons on the post.

    0 comments No comments