Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="Unknown" Message="Unknown service error" Details=[{"odata.error"


Error listing Service Principals: graphrbac.ServicePrincipalsClient#List: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="Unknown" Message="Unknown service error" Details=[{"odata.error":{"code":"Authorization_RequestDenied","date":"2020-06-14T16:34:09","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"6e0d75da-7fa9-44c3-b9b7-0d46b57dc94e"}}]

Background:-

My CICD Pipeline Service principal name is : BasicProject-9239f519-8504-XXXX-XXX-c84d53ba3714

and i am trying to Create and Read other service principal name Diskencryption within the pipeline i get error as specified above. 

resource "azuread_application" "diskencryptionapp" {
  name = "diskencryptionapp"
  
}

When i execute release pipeline i got below error

Error listing Service Principals: graphrbac.ServicePrincipalsClient#List: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="Unknown" Message="Unknown service error" Details=[{"odata.error":{"code":"Authorization_RequestDenied","date":"2020-06-14T16:34:09","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"6e0d75da-7fa9-44c3-b9b7-0d46b57dc94e"}}]


In order to resolve this issue:-

As per the error information it indicated that i do not have required permission of my service principal(BasicProject-9239f519-8504-XXXX-XXX-c84d53ba3714) to read data of other service principal name diskencryptionapp.

 1. login to Azure portal
 2. Go to Azure Active Directory
 3. Click on App registrations >> All Application tab.
 4.Search for Application BasicProject-9239f519-8504-XXXX-XXX-c84d53ba3714
 5Give permission as below to both Azure Active Directory Graph and Microsoft Graph

it should work





Your Issue will  resolve

Thanks.

Comments

Popular posts from this blog

How to use Custom Script Extensions for windows using Azure PowerShell - AZ CLI and from Terraform

How to create a Resource group in Azure using Terraform Part -1

Error inspecting states in the "azurerm" backend: storage: service returned error: StatusCode=403, ErrorCode=AuthenticationFailed