microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.51k stars 2.62k forks source link

[REGRESSION]: AzureAppConfiguration@10 unable to retrieve token. #20386

Open KristofKuli opened 3 months ago

KristofKuli commented 3 months ago

New issue checklist

Task name

AzureAppConfiguration

Breaking task version

10.245.0

Last working task version

6.5.0

Regression Description

AzureAppConfiguration@6 seems to be deprecated, therefore we have switched to AzureAppConfiguration@10, which is now failing with the following error:

[debug][Thu, 05 Sep 2024 07:14:29 GMT] : [] : @azure/msal-common@14.13.0 : Info - Sending token request to endpoint: https://login.microsoftonline.com/45597f60-6e37-4be7-acfb-4c9e23b261ea/oauth2/v2.0/token

[debug][Thu, 05 Sep 2024 07:14:29 GMT] : [] : @azure/msal-common@14.13.0 : Warning - No client info in response

[debug]MSAL - retrieved token - isFromCache?: false

[error]A HTTP error occurred

Name: RestError Code: REQUEST_SEND_ERROR Status code:undefined Url: https://.azconfig.io/kv?api-version=2023-10-01&key=%2Fietv%2Fcentral%2Fms%2F*&label=%00 Error message: "agent-base" has no default implementation, you must subclass and override callback()

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04

Relevant log output

Azure App Configuration Task is starting up...
Azure Subscription: <subscription name>
App Configuration Endpoint: https://<app-name>.azconfig.io
Selection Mode: Default
Key Filter: '/ietv/central/ms/*'
Label Filter: (No label)
##[debug]MSAL - Proxy setup with no-auth is: http://192.168.1.1:8080
##[debug]MSAL - ServicePrincipal - clientSecret is used.
##[debug][Thu, 05 Sep 2024 07:14:29 GMT] : [] : @azure/msal-node@2.11.0 : Info - acquireTokenByClientCredential called
##[debug][Thu, 05 Sep 2024 07:14:29 GMT] : [<ID>] : @azure/msal-node@2.11.0 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/45597f60-6e37-4be7-acfb-4c9e23b261ea/oauth2/v2.0/token.
##[debug][Thu, 05 Sep 2024 07:14:29 GMT] : [<ID>] : @azure/msal-common@14.13.0 : Info - Sending token request to endpoint: https://login.microsoftonline.com/45597f60-6e37-4be7-acfb-4c9e23b261ea/oauth2/v2.0/token
##[debug][Thu, 05 Sep 2024 07:14:29 GMT] : [<ID>] : @azure/msal-common@14.13.0 : Warning - No client info in response
##[debug]MSAL - retrieved token - isFromCache?: false
##[error]A HTTP error occurred 
Name: RestError 
Code: REQUEST_SEND_ERROR 
Status code:undefined 
Url: https://<app-name>.azconfig.io/kv?api-version=2023-10-01&key=%2Fietv%2Fcentral%2Fms%2F*&label=%00 
Error message: "agent-base" has no default implementation, you must subclass and override `callback()` 
ClientRequestId: <ID>
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId=<ID>;]A HTTP error occurred 
Name: RestError 
Code: REQUEST_SEND_ERROR 
Status code:undefined 
Url: https://<app-name>.azconfig.io/kv?api-version=2023-10-01&key=%2Fietv%2Fcentral%2Fms%2F*&label=%00 
Error message: "agent-base" has no default implementation, you must subclass and override `callback()` 
ClientRequestId: 7c4ed9d1-9830-4966-b5a1-a434c16d3bbc
##[debug]
##[debug]task result: Failed
##[debug]Processed: ##vso[task.complete result=Failed;done=true;]
Finishing: Gathering App Config for - IEC webhook

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 
SUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

No response

caracha1 commented 3 months ago

I beleive this is releated to the issue we have, using the AzureCLI@2 task. We can get servicePrincipalId, idToken, and tenantId but servicePrincipalKey is not set into the environment. This started today, and we had to update AzureAppConfiguration@10 in other pipelines, as AzureAppConfiguration@8 was not available anymore.

dyf182 commented 3 months ago

having the same issue, using AzureAppConfiguration@6 until this morning with no issue

MaryanneNjeri commented 3 months ago

After doing some investigation of the error A task is missing. The pipeline references a task called 'AzureAppConfiguration' with version 'x'. This indicates that the specific task version can not be found we also realized that the extension task name somehow got updated to AzureAppConfiguration.azure-app-configuration-task.custom-build-release-task.AzureAppConfiguration after the built in task was deployed which I suspect could be causing the extension task to go missing.

We are currently looking into resolving the issue for the missing task for older versions

KristofKuli commented 3 months ago

So using the old task name would make it possible to use the old versions?

MaryanneNjeri commented 3 months ago

Version 10 had to be removed to restore the functionality of previous versions and we have updated the guidance here to reflect this.