0

I would like to copy files to blob, but failing. I have blob prefix ''. What is should be and how to add?

ERROR:

[error]Upload to container: 'arm' in storage account: 'devopsstorageken' 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

YML:

pool:
  vmImage: 'vs2017-win2016'

steps:

- task: AzureFileCopy@4
    inputs:
    SourcePath: '$(Build.Repository.LocalPath)/ARMTemplates'
    azureSubscription: 'TestRG-Conn'
    Destination: 'AzureBlob'
    storage: 'devopsstorageken'
    ContainerName: 'arm'
Community
  • 1
  • 1
Kenny_I
  • 1,293
  • 1
  • 21
  • 41

2 Answers2

1

What about indentation? inputs: should be on the task level.

blobPrefix can be anything you want. For example, the name of the environment or simply blobPrefix: test.

Jeremy Caney
  • 6,191
  • 35
  • 44
  • 70
0

There are two work around:

  1. You can rollback that task to the old versions (v2 worked for me). In the old versions you don't need to do any extra job in Azure Portal.
  2. If you want to keep using the latest version, you need to make sure that the Service Principal used in that task has access to the Storage Account. Try to navigate to the Access control page and Add a role assignment (Storage Blob Data Contributor / owner role) to your Service Principal/Managed Identity.

Reference

Luiz Lelis
  • 303
  • 7
  • 9