5

I'm having issues with deploying my github code to azure storage via azure pipeline. It deploys via AZCopy, but it's going into a subdirectory, which I believe is the reason I'm getting a 404 since the index.html file isn't in the root directory. How can I get my pipeline to deploy storage blob for the root directory?

enter image description here

steps:
- task: AzureFileCopy@2
  displayName: 'AzureBlob File Copy'
  inputs:
    SourcePath: dist/
    azureSubscription: '<subscription was here>'
    Destination: AzureBlob
    storage: ivflowstorageaccount
    ContainerName: '$web'

The folder it copies to $web has my dist files in it so the previous steps seem fine, but I just don't know why it's not copying to root directory. I appreciate any help!

enter image description here

JMooreWeb
  • 61
  • 1
  • 3

2 Answers2

5

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.

Dick Bos
  • 384
  • 3
  • 8
1

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.

Vito Liu
  • 7,525
  • 1
  • 8
  • 17