fetching Get-AzureRMRoleAssignment:"Authentication_Unauthorized","message":{"lang":"en","value":"Access denied to the specified API version"}

musham ajay 1 Reputation point
2020-06-29T10:31:28.03+00:00

Get-AzureRMRoleAssignment : {"odata.error":{"code":"Authentication_Unauthorized","message":{"lang":"en","value":"Access
denied to the specified API version."},"requestId":"34fb8b9c-bac2-4df7-9c66-d2b3568d0138","date":"2020-06-29T10:11:43"}}

CategoryInfo : CloseError: (:) [Get-AzureRmRoleAssignment], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.GetAzureRoleAssignmentCommand

I am executing Get-AzureRMRoleAssignment in runbook but it is throwing Access
denied to the specified API version

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,174 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. bharathn-msft 5,086 Reputation points Microsoft Employee
    2020-07-08T18:25:24.78+00:00

    @mushamajay-0860 Apologies for delayed response on this. It seems to be a known issue when using cmdlets that call the Graph API while authenticated with a service principal. Please refer to below threads and see if that helps

    https://stackoverflow.com/questions/35592847/get-azurermroleassignment-access-denied-to-the-specified-api-version
    https://github.com/Azure/azure-powershell/issues/1896

    Please revert back if your scenario is not fitting the above examples and provide some additional details for your scenario with the steps being taken so that we can try to repro the issue and troubleshoot further. Thank you

    0 comments No comments