Error message"Failed to refresh the Token for request to" when terraform plan

Zhao Mingyang (GI-DE) 30 Reputation points

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", 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

    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$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