Skip to content

[BUG]: AzureFileCopy@6 fails to use workload identity federation still trying to use service principal #21402

@warmitu

Description

@warmitu

New issue checklist

Task name

AzureFileCopy

Task version

6.260.0

Issue Description

I configured a simple AzureFileCopy task using v6 to use a newly created service connection (as per Create an app registration with workload identity federation (automatic)).

At runtime the task still fails and I can see that is still trying to connect using a service principal (see log).

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

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows 2022

Relevant log output

2025-10-22T20:37:41.8534964Z ##[section]Starting: Azure Storage QA
2025-10-22T20:37:41.8543010Z ==============================================================================
2025-10-22T20:37:41.8543131Z Task         : Azure file copy
2025-10-22T20:37:41.8543191Z Description  : Copy files to Azure Blob Storage or virtual machines
2025-10-22T20:37:41.8543272Z Version      : 6.260.0
2025-10-22T20:37:41.8543336Z Author       : Microsoft Corporation
2025-10-22T20:37:41.8543397Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
2025-10-22T20:37:41.8544144Z ==============================================================================
2025-10-22T20:38:03.6871388Z Added TLS 1.2 in session.
2025-10-22T20:38:04.0348713Z ##[command]Import-Module -Name C:\Modules\az_12.5.0\Az.Accounts\5.3.0\Az.Accounts.psd1 -Global
2025-10-22T20:38:17.6982877Z ##[command]Update-AzConfig -CheckForUpgrade False -AppliesTo Az -Scope Process
2025-10-22T20:38:17.9606215Z 
2025-10-22T20:38:18.0699873Z ##[command]Get-AzConfig -AppliesTo Az
2025-10-22T20:38:18.1175853Z ##[command]Update-AzConfig -DisplayBreakingChangeWarning False -AppliesTo Az -Scope Process
2025-10-22T20:38:18.1425621Z ##[command]Enable-AzureRmAlias -Scope Process
2025-10-22T20:38:21.0108877Z ##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
2025-10-22T20:38:21.1632007Z ##[command]Clear-AzContext -Scope Process
2025-10-22T20:38:21.2112300Z ##[command]Connect-AzAccount 
2025-10-22T20:38:21.2112536Z Name                           Value                                                                                   
2025-10-22T20:38:21.2112769Z ----                           -----                                                                                   
2025-10-22T20:38:21.2113008Z Tenant                         2bf815c4-7580-442b-bd7e-a2b9d04ea89f                                                    
2025-10-22T20:38:21.2113216Z Scope                          Process                                                                                 
2025-10-22T20:38:21.2113427Z Environment                    AzureCloud                                                                              
2025-10-22T20:38:21.2114013Z ApplicationId                  ***                                                    
2025-10-22T20:38:21.2114219Z ServicePrincipal               True                                                                                    
2025-10-22T20:38:21.2114333Z 
2025-10-22T20:38:21.2114431Z 
2025-10-22T20:38:21.2114596Z 
2025-10-22T20:38:22.6077504Z Key                          Value Applies To Scope   Help Message                                                     
2025-10-22T20:38:22.6081622Z ---                          ----- ---------- -----   ------------                                                     
2025-10-22T20:38:22.6103033Z CheckForUpgrade              False Az         Process When enabled, Azure PowerShell will check for updates automati...
2025-10-22T20:38:22.6124967Z DisplayBreakingChangeWarning False Az         Process Controls if warning messages for breaking changes are displaye...
2025-10-22T20:38:22.6127343Z 
2025-10-22T20:38:22.6127660Z Environments : {[AzureChinaCloud, AzureChinaCloud], [AzureCloud, AzureCloud], [AzureUSGovernment, AzureUSGovernment]}
2025-10-22T20:38:22.6128108Z Context      : Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext
2025-10-22T20:38:22.6128354Z 
2025-10-22T20:38:22.7079317Z ##[command]Set-AzContext 
2025-10-22T20:38:22.7079592Z Name                           Value                                                                                   
2025-10-22T20:38:22.7082230Z ----                           -----                                                                                   
2025-10-22T20:38:22.7082632Z SubscriptionId                 9bf767b9-0a46-4512-bcc5-6fac0ec461a4                                                    
2025-10-22T20:38:22.7082957Z 
2025-10-22T20:38:22.7083111Z 
2025-10-22T20:38:22.7084949Z 
2025-10-22T20:38:23.4221254Z 
2025-10-22T20:38:23.4226602Z Name               : Microsoft Azure Sponsorship (9bf767b9-0a46-4512-bcc5-6fac0ec461a4) - 
2025-10-22T20:38:23.4227140Z                      2bf815c4-7580-442b-bd7e-a2b9d04ea89f - ***
2025-10-22T20:38:23.4227600Z Subscription       : 9bf767b9-0a46-4512-bcc5-6fac0ec461a4
2025-10-22T20:38:23.4228650Z Account            : ***
2025-10-22T20:38:23.4249429Z Environment        : AzureCloud
2025-10-22T20:38:23.4268140Z Tenant             : 2bf815c4-7580-442b-bd7e-a2b9d04ea89f
2025-10-22T20:38:23.4268767Z TokenCache         : 
2025-10-22T20:38:23.4269009Z VersionProfile     : 
2025-10-22T20:38:23.4269242Z ExtendedProperties : {}
2025-10-22T20:38:23.4269394Z 
2025-10-22T20:38:24.2150532Z ##[command]Import-Module -Name C:\Modules\az_12.5.0\Az.Resources\7.6.0\Az.Resources.psd1 -Global
2025-10-22T20:38:30.9096560Z ##[command]Import-Module -Name C:\Modules\az_12.5.0\Az.Storage\7.5.0\Az.Storage.psd1 -Global
2025-10-22T20:38:35.0891898Z ##[command]Import-Module -Name C:\Modules\az_12.5.0\Az.Compute\8.5.0\Az.Compute.psd1 -Global
2025-10-22T20:38:39.2464528Z ##[command]Import-Module -Name C:\Modules\az_12.5.0\Az.Network\7.10.0\Az.Network.psd1 -Global
2025-10-22T20:38:42.2008508Z ##[error]Storage account: dicomohifstorageqa not found. The selected service connection 'Service Principal' supports storage accounts of Azure Resource Manager type only.
2025-10-22T20:38:42.2630027Z ##[section]Finishing: Azure Storage QA

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions