Skip to content

az storage blob upload can overwrite a blob without needing the --overwrite parameter in az cli version 2.33.1 , however in version 2.34.1 it requires the overwrite parameter. #21779

@miniGweek

Description

@miniGweek

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az storage blob upload

Detailed command

az storage blob upload --account-name <my-storage-account> --container-name '$web' --file <my-file> --auth-mode login
Errors:

The specified blob already exists.
RequestId:xxxx-xxxxx-xxxx
Time:2022-03-24T04:01:57.5064729Z
ErrorCode:BlobAlreadyExists
If you want to overwrite the existing one, please add --overwrite in your command.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Install the latest azure cli on your workstation - As of raising this bug this is v2.34.1
  • Attempt to overwrite an existing blob in a container
  • az storage blob upload --account-name --container-name '$web' --file --auth-mode login
  • You will get the error The specified blob already exists
  • Now install the version v2.33.1 of azure cli and try the same steps as above
  • The file can be re-uploaded/overwritten again and again without any error.
  • So in summary:
    • If you have azure cli v2.33.1 - az storage blob upload allows the upload of the same file to the same location allowing it to be overwritten.
    • if you have azure cli v2.34.1 - az storage blob upload doesn't allow the upload of the same file to the same location, instead throws an error Blob already exists and requires the experimental parameter --overwrite to be supplied.

Expected Behavior

  • I don't expect this breaking change to be introduced. Azure CLI tasks ( for azure pipelines ) is using azure CLI v2.33.1 and the file upload works smoothly, but I am afraid as soon as the Azure CLI task gets upgraded to v2.34.1 my pipeline code will break.

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.34.1

Extensions:
azure-devops 0.22.0
desktopvirtualization 0.1.1
interactive 0.4.5
log-analytics 0.2.2
next 0.1.2
rdbms-connect 1.0.1

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions