-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Hello Azure CLI Team,
I'm reporting what appears to be a regression or a breaking change in the behavior of the az batch application package create command starting with azure-cli version 2.77.0.
Description
In previous versions of the CLI (specifically tested with 2.76.*), running az batch application package create with a --version-name that already existed would successfully overwrite the package file in the underlying storage account. This allowed us to update application packages in place.
Since updating to version 2.77.0, the exact same command now fails with a BlobAlreadyExists error, preventing the update. This has broken our CI/CD pipelines, which relied on this behavior to deploy updates to static version tags like dev or latest.
Steps to Reproduce
- Use
azure-cliversion 2.77.0. - Create an initial application package version:
# Create version "my-version" with a first file az batch application package create --resource-group MyResourceGroup --account-name MyBatchAccount --application-name MyApp --version-name "my-version" --package-file "package-v1.zip"
- Attempt to update the same package version with a new file:
# In v2.76.* this would succeed. In v2.77.0 it fails. az batch application package create --resource-group MyResourceGroup --account-name MyBatchAccount --application-name MyApp --version-name "my-version" --package-file "package-v2.zip"
Expected Behavior
The command should successfully upload package-v2.zip, overwriting the existing blob for the my-version package, consistent with the behavior observed in azure-cli 2.76.*.
Actual Behavior
The command fails with the following error:
ERROR: The specified blob already exists.
RequestId:0e515875-b01e-001e-4370-21368c000000
Time:2025-09-09T10:00:48.3513309Z
ErrorCode:BlobAlreadyExists
Additional Context
This change forces us to adopt a "delete-then-create" workflow, which is less atomic and adds complexity to our deployment scripts. While we understand this might align with a stricter interpretation of the API, the previous behavior was extremely useful.
If this is the new intended behavior, please confirm. In that case, we would like to formally request a feature enhancement, such as an --overwrite flag, to restore the ability to update a package in a single, atomic command.
Thank you for your time and consideration.
Related command
az batch application package create
Errors
ERROR: The specified blob already exists.
RequestId:0e515875-b01e-001e-4370-21368c000000
Time:2025-09-09T10:00:48.3513309Z
ErrorCode:BlobAlreadyExists
Issue script & Debug output
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 336, in call
File "/opt/az/lib/python3.13/site-packages/azure/multiapi/storagev2/blob/v2022_11_02/_shared/response_handlers.py", line 189, in process_storage_error
exec("raise error from None") # pylint: disable=exec-used # nosec
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1, in
File "/opt/az/lib/python3.13/site-packages/azure/multiapi/storagev2/blob/v2022_11_02/_upload_helpers.py", line 106, in upload_block_blob
response = client.upload(
body=data,
...<11 lines>...
legal_hold=legal_hold,
**kwargs)
File "/opt/az/lib/python3.13/site-packages/azure/core/tracing/decorator.py", line 119, in wrapper_use_tracer
return func(*args, **kwargs)
File "/opt/az/lib/python3.13/site-packages/azure/multiapi/storagev2/blob/v2022_11_02/_generated/operations/_block_blob_operations.py", line 852, in upload
map_error(status_code=response.status_code, response=response, error_map=error_map)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.13/site-packages/azure/core/exceptions.py", line 163, in map_error
raise error
azure.core.exceptions.ResourceExistsError: The specified blob already exists.
RequestId:550a63f5-a01e-0060-4682-21a6cb000000
Time:2025-09-09T12:10:19.3841319Z
ErrorCode:BlobAlreadyExists
Expected behavior
The command should successfully upload package-v2.zip, overwriting the existing blob for the my-version package, consistent with the behavior observed in azure-cli 2.76.*.
Environment Summary
azure-cli 2.77.0
core 2.77.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.2
Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0
Additional context
No response