Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

610 views 15 9
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