azure-pipelines-tasks: Azure File Copy Task Fails with Azure PS Version 1.4.0
When a build agent has Azure PS Cmdlets version 1.4.0
installed the Azure File Copy Task will fail with the following error:
Cannot bind argument to parameter 'storageKey' because it is an empty string.
The previous version of Azure PS Cmdlets 1.3.2
works fine.
Raw Task Logs with Azure PS 1.4.0
2016-05-08T06:24:48.9801943Z Executing the powershell script: C:\Agent\tasks\AzureFileCopy\1.0.52\AzureFileCopy.ps1
2016-05-08T06:24:49.1676994Z Looking for Azure PowerShell module at C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1
2016-05-08T06:24:49.9958542Z AzurePSCmdletsVersion= 1.4.0
2016-05-08T06:24:50.0583559Z Get-ServiceEndpoint -Name ******** -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext
2016-05-08T06:24:50.0739805Z tenantId= ********
2016-05-08T06:24:50.0739805Z azureSubscriptionId= ********
2016-05-08T06:24:50.0739805Z azureSubscriptionName= ********
2016-05-08T06:24:50.2146097Z Add-AzureRMAccount -ServicePrincipal -Tenant ******** -Credential System.Management.Automation.PSCredential
2016-05-08T06:24:50.7982308Z Select-AzureRMSubscription -SubscriptionId ******** -tenantId ********
2016-05-08T06:24:51.0235517Z ##[debug]Loading AzureUtilityGTE1.1.0.ps1
2016-05-08T06:24:57.3994077Z ##[error]Cannot bind argument to parameter 'storageKey' because it is an empty string.
Raw Task Logs with Azure PS 1.3.2
2016-05-08T06:56:10.0177511Z Executing the powershell script: C:\Agent\tasks\AzureFileCopy\1.0.52\AzureFileCopy.ps1
2016-05-08T06:56:10.2052547Z Looking for Azure PowerShell module at C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1
2016-05-08T06:56:11.0646512Z AzurePSCmdletsVersion= 1.3.2
2016-05-08T06:56:11.1271528Z Get-ServiceEndpoint -Name ******** -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext
2016-05-08T06:56:11.1427777Z tenantId= ********
2016-05-08T06:56:11.1427777Z azureSubscriptionId= ********
2016-05-08T06:56:11.1427777Z azureSubscriptionName= ********
2016-05-08T06:56:11.2834062Z Add-AzureRMAccount -ServicePrincipal -Tenant ******** -Credential System.Management.Automation.PSCredential
2016-05-08T06:56:11.7897892Z Select-AzureRMSubscription -SubscriptionId ******** -tenantId ********
2016-05-08T06:56:11.9616688Z ##[debug]Loading AzureUtilityGTE1.1.0.ps1
2016-05-08T06:56:14.5176791Z Uploading files from source path: 'D:\Agent\Work\326ad65b5\********.Backend.CI\Backend\artifacts\package.zip' to storage account: '********' in container: '********' with blobprefix: 'deployments/********'
2016-05-08T06:56:16.7210196Z Uploaded files successfully from source path: 'D:\Agent\Work\326ad65b5\********.Backend.CI\Backend\artifacts\package.zip' to storage account: '********' in container: '********' with blobprefix: 'deployments/********'
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (11 by maintainers)
Commits related to this issue
- Resolving issue #1660 — committed to microsoft/azure-pipelines-tasks by vincent1173 8 years ago
- Resolving bug #1660 — committed to microsoft/azure-pipelines-tasks by vincent1173 8 years ago
While waiting for the fix, we’ve manually patched
AzureFileCopy\1.0.54\AzureUtilityGTE1.0.ps1
as follows:The line:
is what has been changed.
I also have this issue now with 1.0.69. Surely this shouldn’t be closed…
@soccerjoshj07 , Closing the issue as the new Azure File Copy V3 should fix this issue.
@vincentdass This shouldn’t be closed - still an issue in Azure DevOps pipelines as @mkusmiy alluded to.
A fix that worked for me is by modifying line 27 of AzureUtilityGTE1.0.ps1 (@mkusmiy , you had a small typo in your snippet above, missing the “_” in $.ResourceType and $.Name)
from
$azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)}
to
$azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)}
Edit: V2 of the task (in preview) also worked.
@stack111 , It’s currently in progress. Will be updating the status soon.
I got this problem again, now with the task version 1.0.69 @kmkumaran Any plans to have this fixed?
We have the sing-off planned sometime next sprint. I will post back to this thread once we have it ready.