Error message"Failed to refresh the Token for request to https://graph.windows.net" when terraform plan

Zhao Mingyang (GI-DE) 30 Reputation points
2023-03-14T09:28:47.4733333+00:00

After I excute command: terraform plan, the error message:

Error: building account: getting authenticated object ID: Error listing Service Principals: autorest.DetailedError{Original:(*errors.errorString)(0xc001d660c0), PackageType:"azure.BearerAuthorizer", Method:"WithAuthorization", StatusCode:0, Message:"Failed to refresh the Token for request to https://graph.windows.net/ef7739ac-965f-48a7-aa0c-7712934800b7/servicePrincipals?%24filter=appId+eq+%27bc12fa72-72b8-45c9-9d15-735d53b5c1d4%27&api-version=1.6", ServiceError:[]uint8(nil), Response:(*http.Response)(nil)}

Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
5,877 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,124 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 39,101 Reputation points
    2023-03-15T06:40:07.13+00:00

    Hi @Zhao Mingyang (GI-DE)

    Azure AD graph has been deprecated and will be completely retired by June 30 of this year, and all features of Azure AD graph have been migrated to the latest Microsoft Graph, so I recommend that you use the Microsoft Graph API to get an application service principal.

    GET https://graph.microsoft.com/v1.0/servicePrincipals?$filter=appId eq '{app id}'
    

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

0 additional answers

Sort by: Most helpful