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

Latest Azure CLI Versions[2.34.0 and 2.34.1] - storage blob upload change in behavior #21591

Closed
MisbaIram opened this issue Mar 10, 2022 · 4 comments · Fixed by #21682
Closed
Assignees
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage
Milestone

Comments

@MisbaIram
Copy link

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

On uploading a blob for example a html file or a image file using the latest AZ CLI versions[2.34.0 and 2.34.1] using the upload command, the content-type is being set as application/octet-stream
The content-type header value for blobs uploaded az storage upload blobwould be based off the file extension in older versions. Now they are always application/octetstream:
image

az storage blob upload
--account-name
--container-name
--name helloworld
--file helloworld
--auth-mode login

Expected behavior
The previous versions of Azure CLI were automatically updating the Header content-type. The new version, however, is not doing that anymore

Windows
https://azcliprod.blob.core.windows.net/msi/azure-cli-.msi

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels Mar 10, 2022
@ghost ghost added this to the Backlog milestone Mar 10, 2022
@ghost ghost assigned evelyn-ys Mar 10, 2022
@ghost ghost added the Auto-Assign Auto assign by bot label Mar 10, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 11, 2022

storage

@zwolf
Copy link

zwolf commented Mar 11, 2022

Also seeing this behavior in 2.34 versions. I am using azure/login and azure/cli Github Actions and was not specifying a version (as recommended by MS in this issue).

The bump to 2.34.1 caused site deploys to fail because index.html files were suddenly not overwriting as expected, using az storage blob upload. After fixing this by adding the --overwrite flag (see this issue), the new uploads had an incorrect content-types: files with html and txt extensions became application/octet-stream, causing browsers download the file rather than display it. I did have .js, .css, and .png files detect their correct content-types, but they were uploaded with az storage blob upload-batch.

This behavior was soon made even more confusion yesterday (March 10) by the sudden reversion of the "latest" azure-cli version 2.34.1 back to 2.33.1 within a few hours. I'm not sure where to look to see which version the Action will use as latest without running it, so right now I don't know whether my scripts require the --overwrite and --content-type flags to az storage blob upload without running it.

I'm planning on pinning the CLI version in the action, with keeping up with CLI updates unfortunately becoming another task to manage.

@calvinhzy calvinhzy self-assigned this Mar 17, 2022
calvinhzy added a commit that referenced this issue Mar 18, 2022
…ad not auto guessing file type (#21682)

* fix storage blob upload not auto guessing file type

* fix so it works with --data
@justin-caldicott
Copy link

Had the exact same experience as you @zwolf, first the --overwrite requirement (which interestingly now shows as a warning that it's in preview), then the content-type bug for a root html file. I'm using Azure devops and hadn't ran the pipeline in a while. Lucky finding this issue!

Perhaps breaking changes, like requiring --overwrite should be saved for major releases?

@calvinhzy
Copy link
Member

@justin-caldicott Can you share your CLI version and the command that resulted in the content-type bug? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage
Projects
None yet
6 participants