Skip to content

[BUG]: AzureFileCopy@6 is breaking on pipeline with error 'The term 'New-AzStorageContext' is not recognized. #20150

Closed
@abhinab22mohanty

Description

New issue checklist

Task name

AzureFileCopy

Task version

6.242.6

Issue Description

We recently upgraded the Azure DevOps (ADO) service connection from using an Azure Resource Manager service principal (automatic) to Azure Resource Manager using Workload Identity federation with OpenID Connect (automatic). There were couple successful runs but recently started getting error "The term 'New-AzStorageContext' is not recognized as the name of a cmdlet"

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

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

Azure DevOps Server type

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

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows 11

Relevant log output

2024-07-16T00:26:49.0813915Z ##[section]Starting: AzureFileCopy@6 (windows_build_container)
2024-07-16T00:26:49.0819407Z ==============================================================================
2024-07-16T00:26:49.0819519Z Task         : Azure file copy
2024-07-16T00:26:49.0819566Z Description  : Copy files to Azure Blob Storage or virtual machines
2024-07-16T00:26:49.0819634Z Version      : 6.242.6
2024-07-16T00:26:49.0819685Z Author       : Microsoft Corporation
2024-07-16T00:26:49.0819739Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
2024-07-16T00:26:49.0819820Z ==============================================================================
2024-07-16T00:26:52.1404395Z ##[command]Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\3.0.2\Az.Accounts.psd1 -Global
2024-07-16T00:26:53.4767258Z ##[command]Update-AzConfig -DisplayBreakingChangeWarning False -AppliesTo Az
2024-07-16T00:26:53.6520511Z 
2024-07-16T00:26:53.7094087Z ##[command]Enable-AzureRmAlias -Scope Process
2024-07-16T00:26:55.7931368Z ##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
2024-07-16T00:26:55.9181172Z ##[command]Clear-AzContext -Scope Process
2024-07-16T00:26:55.9505739Z ##[command]Connect-AzAccount 
2024-07-16T00:26:55.9506025Z Name                           Value                                           
2024-07-16T00:26:55.9506231Z ----                           -----                                           
2024-07-16T00:26:55.9506378Z Tenant                         975f013f-7f24-47e8-a7d3-abc4752bf346            
2024-07-16T00:26:55.9506514Z Scope                          Process                                         
2024-07-16T00:26:55.9506721Z Environment                    AzureCloud                                      
2024-07-16T00:26:55.9507153Z ApplicationId                  ***            
2024-07-16T00:26:55.9507372Z ServicePrincipal               True                                            
2024-07-16T00:26:55.9507449Z 
2024-07-16T00:26:55.9507557Z 
2024-07-16T00:26:55.9507594Z 
2024-07-16T00:26:56.0177372Z ##[warning]The feature related to parameter name 'FederatedToken' is under preview.
2024-07-16T00:26:57.3002063Z Key                          Value Applies To Scope       Help Message         
2024-07-16T00:26:57.3006293Z ---                          ----- ---------- -----       ------------         
2024-07-16T00:26:57.3015610Z DisplayBreakingChangeWarning False Az         CurrentUser Controls if warnin...
2024-07-16T00:26:57.3015718Z 
2024-07-16T00:26:57.3020261Z Environments : {[AzureChinaCloud, AzureChinaCloud], [AzureCloud, AzureCloud], 
2024-07-16T00:26:57.3020651Z                [AzureUSGovernment, AzureUSGovernment]}
2024-07-16T00:26:57.3021981Z Context      : Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext
2024-07-16T00:26:57.3022188Z 
2024-07-16T00:26:57.3439634Z ##[command]Set-AzContext 
2024-07-16T00:26:57.3439948Z Name                           Value                                           
2024-07-16T00:26:57.3440108Z ----                           -----                                           
2024-07-16T00:26:57.3440257Z SubscriptionId                 bc970a64-0a20-44e7-a673-a1b9f20b0ca0            
2024-07-16T00:26:57.3440335Z 
2024-07-16T00:26:57.3440378Z 
2024-07-16T00:26:57.3440421Z 
2024-07-16T00:26:57.5202374Z 
2024-07-16T00:26:57.5207244Z Name               : SxGICon_OneChat_RD (bc970a64-0a20-44e7-a673-a1b9f20b0ca0) 
2024-07-16T00:26:57.5207554Z                      - 975f013f-7f24-47e8-a7d3-abc4752bf346 - 
2024-07-16T00:26:57.5208079Z                      ***
2024-07-16T00:26:57.5209029Z Subscription       : bc970a64-0a20-44e7-a673-a1b9f20b0ca0
2024-07-16T00:26:57.5209983Z Account            : ***
2024-07-16T00:26:57.5211342Z Environment        : AzureCloud
2024-07-16T00:26:57.5212363Z Tenant             : 975f013f-7f24-47e8-a7d3-abc4752bf346
2024-07-16T00:26:57.5212766Z TokenCache         : 
2024-07-16T00:26:57.5213464Z VersionProfile     : 
2024-07-16T00:26:57.5214543Z ExtendedProperties : {}
2024-07-16T00:26:57.5214840Z 
2024-07-16T00:26:58.0652238Z ##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2024-07-16T00:26:58.1028890Z ##[section]Finishing: AzureFileCopy@6 (windows_build_container)

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Below is the task we are running

        - task: AzureFileCopy@6
          inputs:
            SourcePath: '$(OUTPUTROOT)/build/dist/main.bundle*.js'
            azureSubscription: 'SxGICon_OCC_INT_MI'
            Destination: 'AzureBlob'
            storage: 'occstoragecommondev'
            ContainerName: 'chat-client-bundle-cdn-dev'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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