I am trying to deploy a APP using Azure DEVOPS CI/CD Pipelines, however I am receiving the following error:
2022-01-19T19:55:37.5454688Z ##[error]Error: Failed to fetch App Service 'xxxxx' publishing credentials. Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired. For more information refer https://aka.ms/azureappservicedeploytsg
I checked the Client Secret and they are expired. I asked to the admin create a new one, however still receiving the same error when deploying.
Anyone have an idea? Can be because we still have these two expired keys? Do I have to change something in appsettings? (I do not think so right?)

When getting this error on my build pipeline, I was able to follow the steps in this answer (copied below) to solve it. The only other thing I had to do was select a 'Resource group' before hitting Verify in step 5.
Go to Project settings > Service connections, and then select the service connection you want to modify.
Select Edit in the upper-right corner, and then make any change to your service connection. The easiest and recommended change is to add a description.
Select Save to save the service connection. Don't try to verify the service connection at this step.
Exit the service connection edit window, and then refresh the service connections page.
Select Edit in the upper-right corner, and now select Verify. (You may need to select a valid Resource group first if one isn't already selected.)
Select Save to save your service connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With