Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Destination content-type is application/octet-stream

Ørjan Solli July 31, 2019

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

1 vote
Johan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2019

In azcopy 10 the file type issue supposedly has been fixed. Is there a reason the pipe still uses the outdated 7.3 version?

John Young
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2019

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
Johan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2019
1 vote
Ørjan Solli August 1, 2019

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events