Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az storage blog sync sets content-type on .js files to text/plain #10302

Closed
vidarkongsli opened this issue Aug 22, 2019 · 11 comments
Closed

az storage blog sync sets content-type on .js files to text/plain #10302

vidarkongsli opened this issue Aug 22, 2019 · 11 comments
Assignees
Labels
AzCopy az storage copy/remove; az storage blob sync Storage az storage
Milestone

Comments

@vidarkongsli
Copy link

Bug description
When using az storage blob sync to synchronize files to an Azure storage blob container, .js files get content-type text/plain.

Expected behavior
Content type should be application/javascript.

Environment summary

  • azure-cli 2.0.70
  • command-modules-nspkg 2.0.3
  • core 2.0.70 **
  • nspkg 3.0.4
  • telemetry 1.0.3
  • Extension: azure-devops 0.12.0
  • Running in Azure DevOps task 'Azure CLI' version 1.155.1

Additional context
Using Azure DevOps task 'AzCopy' instead yields the correct content type.

@vidarkongsli
Copy link
Author

Actual command run by the Azure DevOps task: az storage blob sync --container $web --source D:\a\r1\a\_web\drop --account-name nottherealname

@mmyyrroonn mmyyrroonn added the Storage az storage label Aug 23, 2019
@Juliehzl Juliehzl added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Aug 23, 2019
@Juliehzl Juliehzl added this to the Sprint 69 milestone Aug 23, 2019
@Juliehzl
Copy link
Contributor

@vidarkongsli Have you specify content-type when using AzCopy? If you just using azcopy sync “D:\a\r1\a\_web\drop” $destination_container_url , I think the .js file may still in text/plain. But I think we should support specifying content-type for such command.

@vidarkongsli
Copy link
Author

vidarkongsli commented Aug 23, 2019

The Azure File Copy DevOps Task runs the following, which works as far as content-type is concerned: & "AzCopy\AzCopy.exe" /Source:"d:\a\r1\a\_web\drop" /Dest:"https://nottherealname.blob.core.windows.net/``$web" /@:"d:\a\_temp\xpegyge5mi8mvvhfle67ds4i" /XO /Y /SetContentType /Z:"AzCopy" /V:"AzCopy\AzCopyVerbose_de1f860a-99a8-44d6-9a60-1877695d89d2.log" /S

So yes, the switch /SetContentType is used.

@Juliehzl Juliehzl added this to Waiting Authors in Storage Features Aug 25, 2019
@Juliehzl Juliehzl moved this from Waiting Authors to Server Attention in Storage Features Aug 25, 2019
@Juliehzl Juliehzl moved this from Server Attention to To do in Storage Features Aug 25, 2019
@Juliehzl Juliehzl moved this from To do to SDK Attention in Storage Features Aug 26, 2019
@yonzhan yonzhan modified the milestones: Sprint 69, Backlog Aug 26, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Aug 26, 2019

It is blocked by azcopy issue.

@Juliehzl
Copy link
Contributor

@vidarkongsli we will add content-type flag for azure cli command later, but need some support from azcopy team.

@haroldrandom haroldrandom added bug This issue requires a change to an existing behavior in the product in order to be resolved. Storage az storage labels Oct 25, 2019
@rerime
Copy link

rerime commented Jan 23, 2020

Is any progress?

@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 24, 2020
@yonzhan yonzhan modified the milestones: Backlog, S165 Jan 24, 2020
@yonzhan yonzhan modified the milestones: S165, S166 Feb 15, 2020
@yonzhan yonzhan modified the milestones: S166, S167 Mar 5, 2020
@yonzhan yonzhan modified the milestones: S167, S168 Mar 26, 2020
@Lectem
Copy link

Lectem commented Apr 7, 2020

I just encountered the issue too while using the AzureFileCopy task.
It seems like by default, windows does not have the content type set for .js (or some application removes it).

a workaround is to have the following script:

        - script: reg add HKCR\.js /v "Content Type" /d application/javascript /f
          displayName: Add .js content type to registry

@Juliehzl Juliehzl added the AzCopy az storage copy/remove; az storage blob sync label Apr 8, 2020
@Juliehzl
Copy link
Contributor

Juliehzl commented Apr 8, 2020

az storage blob sync depends on AzCopy and in latest AzCopy 10.3.4, setting content type is not supported. @zezha-msft Can you help plan for content type setting in AzCopy support?

@zezha-msft
Copy link

Hi @Juliehzl, we will target 10.5 for this fix. Thanks for the reminder!

@yonzhan yonzhan modified the milestones: S168, S169 - For Build Apr 18, 2020
@yonzhan yonzhan modified the milestones: S169 - For Build, S170 May 13, 2020
@yonzhan yonzhan modified the milestones: S170, S171 May 30, 2020
@yonzhan yonzhan modified the milestones: S171, S172 Jun 19, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 11, 2020

@zezha-msft was this issue resolved?

@Juliehzl
Copy link
Contributor

please try in next release.

@jsntcy jsntcy removed this from Coding in Storage Features Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AzCopy az storage copy/remove; az storage blob sync Storage az storage
Projects
None yet
Development

No branches or pull requests

8 participants