An Azure service that stores unstructured data in the cloud as blobs.
Azure DevOps Blobcopy
Singh, Gaurav
5
Reputation points
Hello Team,
I have tested the script in last three lines it works fine with the Azure powershell , when executed with a storage key
when executed in the pipeline, I am getting an error
##[error]Upload to container: 'testcontainer' in storage account: 'XXXXXXXXXtest' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
I have tested the script in last three lines it works fine with the Azure powershell , when executed with a storage key
when executed in the pipeline
I am getting an error
##[error]Upload to container: 'testcontainer' in storage account: 'XXXXXXXXXtest' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
Script
- task: AzureCLI@3
displayName: Copy Latest MSI File
inputs:
azureSubscription: '$(svcConnection)'
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
$ctx = New-AzStorageContext -StorageAccountName '$(storageAccount)'
$latestMSIFile = Get-AzStorageBlob -Container '$(containerName)' -Context $ctx | Where-Object { $_.Name -like "*.msi" } | Sort-Object -Property LastModified -Descending | Select-Object -First 1
Start-AzStorageBlobCopy -Context $ctx -SrcContainer '$(containerName)' -SrcBlob $latestMSIFile.Name -DestContainer '$(containerName)' -DestBlob "SmartScreenPopAssistantInstaller_latest.msi" -Force
Azure Blob Storage
Azure Blob Storage
Sign in to answer