You need at least one agent to run your build or release. Get an agent for Linux, macOS, or Windows.
That is not correct. The task works only on windows agents.
I tried to execute it on a ubuntu-latest and got: The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@M0ns1gn0r Thank you for the feedback.
The documentation has been updated and is pending review.
@msebolt the docs haven't been updated yet, wouldn't it be better to close this when the docs update is merged.
i.e. by adding Fixes #6434 to the PR description?
I just wasted time on this :(
@timja We apologize for the confusion.
The change is available, see...
...has Linux removed from the description.
I would say it's still unclear. Why not directly write "you need at least one Windows agent..."
Don't you need 2? Isn't it true the agent running the task as well as the destination machine must both be Windows?
I have encountered the same problem today. Information about a Windows agent could be valuable.
I would also add that the first half of the documentation states this task uses azcopy v10, and links to the azcopy docs which mention that azcopy works on Linux (it does).
But then the Q&A of this article mentions PowerShell and WinRM. Neither of those things are necessary to upload a blob from a Linux agent.
When will this task support Linux? Can that date be communicated in the article?
It's not enough to say "Windows only"; needs to be updated to include a Linux version.
@RoopeshNair -- please look into this issue.
Here's my workaround replacement for this task that does the equivalent of the AzureFileCopy task on Linux to copy a folder to pre-existing blob container and return Sastoken that can be passed on to subsequent tasks in pipeline:
#
#
param (
[string]$sourcePath,
[string]$resourceGroupName,
[string]$storageAccountName,
[string]$containerName,
[string]$outputContainerUri,
[string]$outputContainerSasToken
)
$storageContext = New-AzStorageContext -StorageAccountName $storageAccountName
$tokenTimeOutInMinutes = 120
Write-Host "Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes"
$START=$(date -u -d "-$tokenTimeOutInMinutes minutes" '+%Y-%m-%dT%H:%M:%SZ')
$EXPIRE=$(date -u -d "$tokenTimeOutInMinutes minutes" '+%Y-%m-%dT%H:%M:%SZ')
$KEY=(Get-AzStorageAccountKey -Name $storageAccountName -ResourceGroupName $resourceGroupName)[0].Value
$SAS=$(az storage account generate-sas --account-name "$storageAccountName" --account-key "$KEY" --start "$START" --expiry "$EXPIRE" --https-only --permissions acdlpruw --resource-types sco --services bfqt | sed 's/%3A/:/g;s/\"//g')
azcopy cp "$sourcePath/*" "https://$storageAccountName.blob.core.windows.net/$($containerName)?$SAS" --recursive=true
if ($outputContainerUri) {
Write-Host "##vso[task.setvariable variable=$outputContainerUri;isSecret=false]$($storageContext.StorageAccount.BlobStorageUri.PrimaryUri.ToString())$containerName/"
}
if ($outputContainerSasToken) {
Write-Host "##vso[task.setvariable variable=$outputContainerSasToken;isSecret=true]?$SAS"
}
This works on Ubuntu 16 or 18, where AzCopy has been pre-installed via:
wget -q https://aka.ms/downloadazcopy-v10-linux -O azcopy_linux_amd64_10.tar.gz
tar xvzf azcopy_linux_amd64_10.tar.gz
cp ./azcopy_linux_amd64_10.3.4/azcopy /usr/bin
chmod +x /usr/bin/azcopy
azcopy --version
Hope that helps someone!
This issue hasn't been updated in more than 180 days, so we've closed it. If you feel the issue is still relevant and needs fixed, please reopen it and we'll take another look. We appreciate your feedback and apologize for any inconvenience.
Issue bankruptcy? Please reopen.
Most helpful comment
Issue bankruptcy? Please reopen.