What do I need to change to get my command lines to work?

Tom Bergman 0 Reputation points
2024-01-08T03:31:38.5966667+00:00

I am using the PowerShell on my Mac to execute a resource group command and the following output is what I get:

PS /Users/tombergman/azure/templates> $templateFile = "/users/tombergman/azure/templates/trainingdeploymentgroup”  

PS /Users/tombergman/azure/templates> New-AzResourceGroupDeployment `

  -Name blanktemplate `

  -ResourceGroupName Training `

  -TemplateFile $templateFile

New-AzResourceGroupDeployment: 7:00:55PM - Error: Code=AuthorizationFailed; Message=The client 'live.com#******@gmail.com' with object id '8b9f0450-da96-4bf9-8d09-a4cd2b9b21d9' does not have authorization to perform action 'Microsoft.Resources/deployments/validate/action' over scope '/subscriptions/376677b8-4f72-4242-8bba-1d176656158f/resourcegroups/Training/providers/Microsoft.Resources/deployments/blanktemplate' or the scope is invalid. If access was recently granted, please refresh your credentials.

New-AzResourceGroupDeployment: The deployment validation failed

PS /Users/tombergman/azure/templates> 

My subscription ID is: b29bcac8-b5f0-4077-94ad-8db4322e11c5

I ran this to make sure i have a good session. I still get the same error

PS /Users/tombergman/azure/templates> Connect-AzAccount

Account             SubscriptionName       TenantId                             Environment

-------             ----------------       --------                             -----------

******@gmail.com Concierge Subscription 604c1504-c6a3-4080-81aa-b33091104187 AzureCloud

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.
2,433 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-01-09T03:41:33.23+00:00

    Hi Tom Bergman,

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

    Note: Kindly do not share any PII data (e.g email ID) on the public forum for your privacy and security.

    Based on your error we understand you are facing the issue with deployment validation failed.

    Error: Code=AuthorizationFailed; Message=The client 'live.com#******@gmail.com' with object id '8b9f0450-da96-4bf9-8d09-a4cd2b9b21d9' does not have authorization to perform action 'Microsoft.Resources/deployments/validate/action' over scope '/subscriptions/376677b8-4f72-4242-8bba1d176656158f/resourcegroups/Training/providers/Microsoft.Resources/deployments/blanktemplate' or the scope is invalid.

    To troubleshoot your error message, can you make sure that the client(ID) that you're using has the correct RBAC role or Microsoft.Resources/deployments/validate/action permission, over the / subscriptions/376677b8-4f72-4242-8bba1d176656158f /resourcegroups/Training/providers/Microsoft.Resources/deployments/blanktemplate' scope?

    For more info: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=delegate-condition

    We hope this information is helpful. If you require further assistance, please don't hesitate to reach out to us and kindly provide the screen shots for further reference.

    If you have found the answer provided to be helpful, please click on the "Accept answer" button so that it is useful for other members in the Microsoft Q&A community.

    Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.