Skip to content

[Batch] Fix #32086, #32090: az batch application package create: Fix blob not being uploaded - #32106

Merged
Zhiyi Huang (calvinhzy) merged 2 commits into
Azure:devfrom
calvinhzy:batch-application-package-create-fix
Sep 15, 2025
Merged

Zhiyi Huang (calvinhzy) merged 2 commits into
Azure:devfrom
calvinhzy:batch-application-package-create-fix

Conversation

@calvinhzy

@calvinhzy Zhiyi Huang (calvinhzy) commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

Related command

Description

Fix #32086 Fix #32090

Testing Guide

History Notes

[Batch] Fix #32086, #32090: az batch application package create: Fix blob not being uploaded


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Sep 12, 2025 •

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Sep 12, 2025 •

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions

Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@calvinhzy Zhiyi Huang (calvinhzy) changed the title {Batch} Fix #32090: az batch application package create: Fix the blob not being uploaded {Batch} Fix #32086, #32090: az batch application package create: Fix the blob not being uploaded Sep 12, 2025
@calvinhzy
Zhiyi Huang (calvinhzy) marked this pull request as ready for review September 15, 2025 03:40
Copilot AI review requested due to automatic review settings September 15, 2025 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the az batch application package create command where the blob content was not being properly uploaded to storage. The fix addresses the issue by ensuring the file is opened in binary mode and properly read before uploading to the blob storage.

  • Updates the blob upload mechanism to properly read and upload file content
  • Adds comprehensive test coverage to verify blob content upload and overwrite functionality
  • Includes a generated test recording file for storage batch copy operations

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/azure-cli/azure/cli/command_modules/batch/custom.py Fixes the blob upload logic by reading file content properly and enabling overwrite
src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_mgmt_commands.py Adds test coverage to verify blob content is correctly uploaded and can be overwritten
src/azure-cli/azure/cli/command_modules/storage/tests/latest/recordings/test_storage_blob_batch_copy.yaml Generated test recording file for storage operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@calvinhzy Zhiyi Huang (calvinhzy) changed the title {Batch} Fix #32086, #32090: az batch application package create: Fix the blob not being uploaded [Batch] Fix #32086, #32090: az batch application package create: Fix the blob not being uploaded Sep 15, 2025
@calvinhzy Zhiyi Huang (calvinhzy) changed the title [Batch] Fix #32086, #32090: az batch application package create: Fix the blob not being uploaded [Batch] Fix #32086, #32090: az batch application package create: Fix blob not being uploaded Sep 15, 2025
@calvinhzy
Zhiyi Huang (calvinhzy) merged commit 617ddcf into Azure:dev Sep 15, 2025
48 checks passed
@Menna13

Copy link
Copy Markdown

Issue is still persisting in our azure devops pipeline with azure-cli 2.77.0 version

Starting: Upload Pump application package to Batch Account (windows_build_container)

Task : Azure CLI
Description : Run Azure CLI commands against an Azure subscription in a Shell script when running on Linux agent or Batch script when running on Windows agent.
Version : 1.247.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-cli

C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" --version"
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

.....................................................

C:__w\1\s>az batch application package create --application-name pump --name batchpricelistdatappeeus --resource-group rg-pricelistdata-ppe-eus2-01 --version 1 --package-file=C:__w\1\s/Pump.zip
ERROR: The specified blob already exists.
RequestId:7ad0f268-801e-0080-569f-31b857000000
Time:2025-09-30T00:14:32.4164620Z
ErrorCode:BlobAlreadyExists

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 Batch az batch

Projects

None yet

5 participants