azure-pipelines-tasks: AzureFileCopyV4: Cannot process command because of one or more missing mandatory parameters: storageAccountName endpoint.

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: AzureFileCopyV4

Environment

Server: Azure Pipelines BuildID: 62698

Agent: Private OS: Windows 10 Agent version: 2.204.0

Issue Description

We have been using AzureFileCopyV4 for some time without any issues. This is how it looks:

- ${{ each value in parameters.devArtifactsToUpload }}:
  - task: AzureFileCopy@4
    displayName: 'Azure Storage Upload: Dev: ${{ value }}'
    condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))  
    inputs:
      sourcePath: '${{ value }}'
      azureSubscription: 'DevSubscription'
      destination: azureBlob
      storage: 'devdownload'
      containerName: 'dev'
      blobPrefix: 'appname'

Today is started showing a following error in log: ##[error]Cannot process command because of one or more missing mandatory parameters: storageAccountName endpoint.

We tried replacing storage parameter with storageAccountName and error changed to##[error]Cannot bind argument to parameter 'storageAccountName' because it is an empty string.

Then we tried using storageAccountRM but got the original error.

In logs I noticed that task version changed from 4.208 to 4.210. Quickly tried to look up in git and the only change I found was this one: https://github.com/microsoft/azure-pipelines-tasks/commit/54890ae78f07407ce068ac9d8c5978733e9e2190#diff-c93f3e2a28c08abcdeb2b740037dcb0814b6f47166dc5cd9f96fb2cf77323cc6 which says to fix this bug: https://github.com/Azure/azure-powershell/issues/19209

Task logs

Full log when we first seen the issue:

Starting: Azure Storage Upload: Dev: c:\ado-agent\ado_work\8\s\install\output\L-Installer.*
==============================================================================
Task         : Azure file copy
Description  : Copy files to Azure Blob Storage or virtual machines
Version      : 4.210.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
==============================================================================
Added TLS 1.2 in session.
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\5.7.0\AzureRM.psd1 -Global
Clear-AzureRmContext -Scope Process
Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
Add-AzureRMAccount -ServicePrincipal -Tenant cf655ab2-3e87-45b5-98e9-da03ee45e21c -Credential System.Management.Automation.PSCredential -Environment AzureCloud
 Set-AzureRmContext -SubscriptionId e86aadf2-8372-4b81-9763-74a3bb4dc793 -TenantId cf655ab2-3e87-45b5-98e9-da03ee45e21c
Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop
Clear-AzureRmContext -Scope Process -ErrorAction Stop
##[error]Cannot process command because of one or more missing mandatory parameters: storageAccountName endpoint.
Finishing: Azure Storage Upload: Dev: c:\ado-agent\ado_work\8\s\install\output\L-Installer.*

Full log when we first tried to fix the issue:

Starting: Azure Storage Upload: Dev: c:\ado-agent\ado_work\8\s\install\output\L-Installer.*
==============================================================================
Task         : Azure file copy
Description  : Copy files to Azure Blob Storage or virtual machines
Version      : 4.210.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
==============================================================================
Added TLS 1.2 in session.
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\5.7.0\AzureRM.psd1 -Global
Clear-AzureRmContext -Scope Process
Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
Add-AzureRMAccount -ServicePrincipal -Tenant cf655ab2-3e87-45b5-98e9-da03ee45e21c -Credential System.Management.Automation.PSCredential -Environment AzureCloud
 Set-AzureRmContext -SubscriptionId e86aadf2-8372-4b81-9763-74a3bb4dc793 -TenantId cf655ab2-3e87-45b5-98e9-da03ee45e21c
Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop
Clear-AzureRmContext -Scope Process -ErrorAction Stop
##[error]Cannot bind argument to parameter 'storageAccountName' because it is an empty string.
Finishing: Azure Storage Upload: Dev: c:\ado-agent\ado_work\8\s\install\output\L-Installer.*

Log start in the build form yesterday when all was working fine:

Starting: Azure Storage Upload: Dev: c:\ado-agent\ado_work\8\s\install\output\L-Installer.*
==============================================================================
Task         : Azure file copy
Description  : Copy files to Azure Blob Storage or virtual machines
Version      : 4.208.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
==============================================================================
Added TLS 1.2 in session.
Import-Module -Name C:\Program Files\WindowsPowerShell\Modules\AzureRM\5.7.0\AzureRM.psd1 -Global
Clear-AzureRmContext -Scope Process
Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
Add-AzureRMAccount -ServicePrincipal -Tenant cf655ab2-3e87-45b5-98e9-da03ee45e21c -Credential System.Management.Automation.PSCredential -Environment AzureCloud
 Set-AzureRmContext -SubscriptionId e86aadf2-8372-4b81-9763-74a3bb4dc793 -TenantId cf655ab2-3e87-45b5-98e9-da03ee45e21c
 & "AzCopy\AzCopy.exe" login --service-principal --application-id "***" --tenant-id="cf655ab2-3e87-45b5-98e9-da03ee45e21c" --aad-endpoint "[https://login.windows.net/"](https://login.windows.net/%22)
INFO: If you set an environment variable by using the command line, that variable will be readable in your command line history. Consider clearing variables that contain credentials from your command line history.  To keep variables from appearing in your history, you can use a script to prompt the user for their credentials, and to set the environment variable.
INFO: SPN Auth via secret succeeded.
INFO: AzCopy.exe: A newer version 10.16.0 is available to download

INFO: AzCopy.exe: A newer version 10.16.0 is available to download

Uploading files from source path:...

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15 (1 by maintainers)

Most upvoted comments

I have the same issue with version 4.210 and this is working for me at the moment, its a temporary fix only - but running this as a powershell script before the copy task should work:

$v210="$(Agent.WorkFolder)/_tasks/AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43/4.210.0"
$v208 ="$(Agent.WorkFolder)/_tasks/AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43/4.208.0"
if(Test-Path $v210){
  rm -r $v210
}
   
copy  $v208 $v210 -r

Worth noting I’ve only tested this on a pipeline running on a VM I control - not sure it’ll work if you’re using pooled agents as it relies on the old, working version of the task being present from a previous run on the machine.