Authorization failed while Executing azure cli command:

Keshav Pratap Singh 1 Reputation point
2021-11-12T11:12:33.36+00:00

azurerm_storage_account.mscomsa (local-exec): ValidationError: The client 'xxxxxxxxxx' with object id 'xxxxxxxx' does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/write' over scope '/subscriptions/xxxxxxxx' or the scope is invalid. If access was recently granted, please refresh your credentials.
azurerm_storage_account.mscomsa (local-exec): ValidationError: The client 'xxxxxxxxxx' with object id xxxxxxxxxx' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/write' over scope '/subscriptions/xxxxxxxxxx/resourceGroups/mscom-prodxx-eastusx/providers/Microsoft.Storage/storageAccounts/campaignxxxxxx' or the scope is invalid. If access was recently granted, please refresh your credentials.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,541 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 36,376 Reputation points Microsoft Employee
    2021-11-12T23:41:39.63+00:00

    KeshavPratapSingh-8589
    Thank you for your post!

    Based off your error message The client 'xxxxxxxxxx' with object id xxxxxxxxxx' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/write' over scope '/subscriptions/xxxxxxxxxx/resourceGroups/mscom-prodxx-eastusx/providers/Microsoft.Storage/storageAccounts/campaignxxxxxx

    • Can you make sure that the client you're using has the correct permissions Microsoft.Storage/storageAccounts/write over your storage account "campaign..."

    If giving your Storage Account /write permissions doesn't resolve your issue, can you share what command you're using or what documentation you're following so I can gain a better understanding of your issue?

    Any additional information or screenshots would also be greatly appreciated!

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.