Terraform apply fails with clientCredentialsToken already expired. | by Jack Roper | Mar, 2025


In this short article, I’ll explain why you might be receiving the following message in your Terraform pipelines, and how to troubleshoot and fix the issue.

"error":"invalid_client","error_description":"AADSTS700024: Client assertion 
is not within its valid time range.
Photo by Michael Dziedzic on Unsplash

An example of the full error you might receive is shown below:

│ Error: error loading state: Error retrieving keys for Storage Account 
"xxxx": autorest/Client#Do: Preparing request failed:
StatusCode=0 -- Original Error: clientCredentialsToken:
received HTTP status 401 with response:
{"error":"invalid_client","error_description":"AADSTS700024: Client assertion
is not within its valid time range. Current time: 2024-12-03T13:41:29.8012207Z
, assertion valid from 2024-12-03T12:10:16.0000000Z, expiry time of assertion
2024-12-03T12:20:16.0000000Z. Review the documentation at
https://learn.microsoft.com/entra/identity-platform/certificate-credentials .
Trace ID: 9d092184-8c0b-49a5-896e-13adb97d5000 Correlation ID:
7061541e-553b-43d4-825c-06b5f787bded Timestamp: 2024-12-03 13:41:29Z",
"error_codes":[700024],"timestamp":"2024-12-03 13:41:29Z","trace_id":
"9d092184-8c0b-49a5-896e-13adb97d5000",
"correlation_id":"7061541e-553b-43d4-825c-06b5f787bded"…


Share this content:

I am a passionate blogger with extensive experience in web design. As a seasoned YouTube SEO expert, I have helped numerous creators optimize their content for maximum visibility.

Leave a Comment