Description
We developed our own extension task with a dependency on:
- "azure-pipelines-task-lib": "4.17.3",
- "azure-pipelines-tasks-azure-arm-rest": "3.249.1",
but as soon as we update to:
- "azure-pipelines-task-lib": "5.0.0",
- "azure-pipelines-tasks-azure-arm-rest": "3.252.2",
we receive the error message:
Error Stack: TypeError: Cannot read properties of undefined (reading 'retrieveSecret')
We use the getAzureEndpoint function to retrieve the token of the service connection to connect to azure, the same way as AzurePowershellV5 does let endpointObject= await new AzureRMEndpoint(serviceName).getEndpoint();
Note: AzurePowershellV5 does not have the issue yet, since the latest version is published a while ago and is not depending on the versions of the packages mentioned above. But a republish should result in the similar issue.
We tried to get to the root cause but we were not able to point to the exact issue, I guess there is a relation with the decommissioning of AzureRM and the TLS 1.0/1.1, but that is just a guess.
Full message in debug mode:
##[debug]Get Azure Endpoint
##[debug]USE_MSAL=true
##[debug]MSAL - USE_MSAL override is found: true
Wrapper Execution Failed: Cannot read properties of undefined (reading 'retrieveSecret')
Error Stack: TypeError: Cannot read properties of undefined (reading 'retrieveSecret')
at Object.getEndpointAuthorizationScheme (/home/vsts/work/_tasks/*****/node_modules/azure-pipelines-tasks-azure-arm-rest/node_modules/azure-pipelines-task-lib/task.js:447:32)
at AzureRMEndpoint.<anonymous> (/home/vsts/work/_tasks/*****/node_modules/azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint.js:52:45)
at Generator.next (<anonymous>)
at /home/vsts/work/_tasks/*****/node_modules/azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint.js:8:71
at new Promise (<anonymous>)
at __awaiter (/home/vsts/work/_tasks/*****/node_modules/azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint.js:4:12)
at AzureRMEndpoint.getEndpoint (/home/vsts/work/_tasks/*****/node_modules/azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint.js:32:16)
at /home/vsts/work/_tasks/*****/dist/wrapper.js:2:1490785
at /home/vsts/work/_tasks/*****/dist/wrapper.js:2:1490824
Error Name: TypeError
Full Error: TypeError: Cannot read properties of undefined (reading 'retrieveSecret')