5
votes

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

1
Is there any update about this ticket? Feel free to let me know if you have any questions. If the answer could help, you may consider accepting it.Vito Liu

1 Answers

0
votes

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.