microsoft / azure-pipelines-tasks

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

[BUG]: AzurePowerShell@5 is failing to find parameter FederatedToken #19874

Closed cskaggs-ms closed 4 months ago

cskaggs-ms commented 5 months ago

New issue checklist

Task name

AzurePowerShell@5

Task version

2.6.0

Issue Description

Background

Expected Behavior

Actual Behavior

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

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

msazure.visualstudio.com

Operation system

Windows 11

Relevant log output

##[debug]Connect-AzAccount: D:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\5.239.9\ps_modules\VstsAzureHelpers_\InitializeAzModuleFunctions.ps1:438
##[debug]Line |
##[debug] 438 |              & $command @args
##[debug]     |                         ~~~~~
##[debug]     | A parameter cannot be found that matches parameter name 'FederatedToken'.

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Use AzurePowerShell@5 in 2.6.0 with a service connection authenticating using a federated credential
v-bsanthanak commented 5 months ago

@cskaggs-ms - Please share the complete debug logs to proceed with investigation.

v-schhabra commented 4 months ago

@cskaggs-ms Please share the logs?

cskaggs-ms commented 4 months ago

Hi, I'm closing this issue, I've determined the issue was that I was on Azure Powershell version 2, when I needed to update to version 11. Version 2 must not have had the parameter Federated Credentials