Matthew Pourroy
Matthew Pourroy

Reputation: 15

Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired, resource name 'ProStrideSkating-api-dev'

Full error message: "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired. Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'ProStrideSkating-api-dev'. Error: Could not fetch access token for Azure. Status code: invalid_client, status message: 7000222 - [2024-01-10 19:23:44Z]: AADSTS7000222: The provided client secret keys for app '***' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds.[error]Unhandled: Cannot read properties of undefined (reading 'getApplicationURL')"

So far, I followed the advice of both Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired and Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired. Failed to get resource ID

I've created a both a new token and a federated credential. When I try to update the "AzureAd": "Client Id" and "TenantId" with the updated credentials and rerun the pull request, I still get the same error message. I made sure to double check the "ClientId" and "TenantId" to make sure the credentials match the secret and the federated credential and they do.
Certificates and Secrets

Federated Credential

Configuration

Upvotes: 0

Views: 4793

Answers (1)

Matthew Pourroy
Matthew Pourroy

Reputation: 15

Just had to update my pipeline with the new Service Principal Name, then it worked.

Upvotes: 0

Related Questions