Skip to content

[BUG]: AzureFileCopy@5 crashed with "The term 'New-AzStorageContext' is not recognized as the name of a cmdlet .." #19546

Open
@florinbuda85

Description

New issue checklist

Task name

AzureFileCopy@5

Task version

5.234.0

Issue Description

Ussing the following code:

  • task: AzureFileCopy@5
    inputs:
    SourcePath: '$(System.DefaultWorkingDirectory)/App.zip'
    Destination: 'AzureBlob'
    storage: 'name_of_the_storage'
    ContainerName: 'name_of_the_container'
    azureSubscription: 'ServicePrincipalName'
    CleanTargetBeforeCopy: true

I only managed to get the following error:

##[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.

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 Server

Relevant log output

Import-Module -Name C:\Users\abcdabcd\Documents\WindowsPowerShell\Modules\Az.Resources\1.9.0\Az.Resources.psd1 -Global
Disconnect-AzAccount -Scope Process -ErrorAction Stop
Clear-AzContext -Scope Process -ErrorAction Stop
##[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.
Finishing: AzureFileCopy

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

No response

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