When I use Azure Storage deploy v1.1.1 to deploy static website build files to blobstore, the files are uploaded and the content-type is set to application/octet-strem. This is a problem, because when you then visit the static website, the index.html file is downloaded as a file instead of shown as a web page
I need *.html files to be uploaded with content-type text/html and *.js files as application/javascript
bitbucket-pipelines.yml:
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
image: node:10.15.3
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm test
- npm run-script build
- step:
name: Deploy to test
deploymend: test
trigger: manual
caches:
- node
script:
- npm install --production
- npm run-script build --production
- pipe: microsoft/azure-storage-deploy:1.1.1
variables:
SOURCE: 'build'
DESTINATION: $AZURE_STORAGE_DESTINATION
DESTINATION_SAS_TOKEN: $AZURE_STORAGE_SAS_TOKEN
DEBUG: 'true'
Desired result:
Actual result:
In azcopy 10 the file type issue supposedly has been fixed. Is there a reason the pipe still uses the outdated 7.3 version?
I have the same issue as the original commenter (deploying to a static site on Azure, even with the `--set-content-type` flag set, results in .svg files getting the wrong type.
I have also read that a later version of azcopy fixes the issue.
And I also wonder why the pipe is still on 7.3 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created an issue here https://bitbucket.org/site/master/issues/19294/the-azure-storage-deploy-uses-outdated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found the source code for this pipe suggested that the version of azcopy they use is v7.3 and the documentation for azcopy mime-content-type gave me the --set-content-type flag, which solved alot of my problems.
But svg and json files are still being set to type application/octet-stream
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
image: node:10.15.3
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm test
- npm run-script build
- step:
name: Deploy to test
deploymend: test
trigger: manual
caches:
- node
script:
- npm install --production
- npm run-script build --production
- pipe: microsoft/azure-storage-deploy:1.1.1
variables:
SOURCE: 'build'
DESTINATION: $AZURE_STORAGE_DESTINATION
DESTINATION_SAS_TOKEN: $AZURE_STORAGE_SAS_TOKEN
EXTRA_ARGS: '--set-content-type'
DEBUG: 'true'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.