It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Destination content-type is application/octet-stream

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:

Screenshot from 2019-07-31 16-20-22.png

Actual result:

Screenshot from 2019-07-31 16-25-40.png

2 answers

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'

Screenshot from 2019-08-01 13-41-11.png

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 :)

Like Johan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,027 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you