Reputation: 35
My Azure file copy properties within Azure Dev Ops are as follows:
Source: $(System.DefaultWorkingDirectory)/ArtifactName/Folder
Destination Type: Azure Blob
Container Name: container
Blob Prefix: [Blank]
When I go ahead and execute the task, the files within the source folder are successfully copied to:
container/folder/[files]
Where the above path has inherited it's naming from [Container Name] / [Source Folder Name] / [Source File Name]
What I would prefer is for the source folder name to not be inherited and therefore be:
container/[files]
Am I able to achieve this using the Azure file copy task in Azure Dev Ops?
Upvotes: 2
Views: 2187
Reputation: 30353
If you specify the source
as $(System.DefaultWorkingDirectory)/ArtifactName/Folder
. It copies a directory (and all of the files in that directory) to a blob container. The result is a directory in the container by the same name. ie. container/folder/[files]
If you want only the files be copied in the root container. You can specify the source
by using the wildcard symbol (*), like this $(System.DefaultWorkingDirectory)/ArtifactName/Folder/*
. It will upload the contents of a directory without copying the containing directory. ie. container/[files]
See below:
Source: $(System.DefaultWorkingDirectory)/ArtifactName/Folder/*
See azcopy document for more information.
Upvotes: 10