Azure Pipeline/AZ Copy not copying to root directory in storage blob Azure Pipeline/AZ Copy not copying to root directory in storage blob azure azure

Azure Pipeline/AZ Copy not copying to root directory in storage blob


Usually, without specifying Blob Prefix, the content in the specified folder is copied to the root of the container by default.

According to the screenshot, It seems like the directory structure is as follows.

dist -ivflow    -index.html

The file index.html is in the folder ivflow, and you want to copy the index.html to root directory in storage blob, we can delete the index.html file and recopy the file to root directory via the task Azure file copy(SourcePath: dist/ivflow/ivflow).

If you want to remove all directory structure and only copy file to storage blob, we recommend that you copy the folder one by one from the bottom folder.

In addition, please try to use AzureFileCopy@3 instead of AzureFileCopy@2.


I had the same problem. You need to replace SourcePath: dist/ with SourcePath: dist/*. Then the content of the subfolder will be copied to the root of $web instead of the subfolder itself.