PowerShell scrip exercise throwing authorization error

Flávio Miguel Pena 0 Reputation points
2024-03-14T16:27:26.1466667+00:00

https://learn.microsoft.com/en-us/training/modules/automate-azure-tasks-with-powershell/8-exercise-create-resource-using-script

Following the create a resource using script exercise I get an error The client 'flavxxxxxxxx@noxxxxx.pt' with object id '8c4eae1b-781c-4938-98a6-edbee31b0344' does not have

 | authorization to perform action 'Microsoft.Compute/virtualMachines/read' over scope

 | '/subscriptions/71aba40f-344e-4bd7-a059-43c86f7d6d1d/resourceGroups/learn-fce83c04-da8e-408f-82a0-2e7cc63776c7/providers/Microsoft.Compute/virtualMachines/ConferenceDemo3' or the scope is invalid. If access was recently granted, please refresh your credentials.
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.
834 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Flávio Miguel Pena 0 Reputation points
    2024-03-15T12:00:00.44+00:00

    Hello,

    What do you mean by subscription, the resources available on the learning paths are not mine, they are a sandobx environment and should not ask for active subscriptions as they are not connected to any live tenant or am I wrong?

    User's image

    User's image

    I'm not an admin on my company's tenant as I do not perform administrative work on this environment.

    Please advise.

    Regards,

    Flávio Pena

    0 comments No comments

  2. Flávio Miguel Pena 0 Reputation points
    2024-03-15T12:17:10.2533333+00:00

    Not sure on what the issue was but today I was able to run the script without issues.

    Thank you for your support and availability.

    Regards,

    Flavio Pena