Repository navigation
[Batch] az batch pool create: Update outdated help text and examples - #34322
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution Keyan Song (@mskeyansong)! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
🟡 Changes recommended
The example omits --account-endpoint, so it fails with the shown credentials unless a Batch endpoint is already configured.
1 open issue
What changed in this PR
Updates Azure Batch CLI help to reflect retired features and current image options, clarifies account requirements, and removes unused code from retired commands.
Changes:
- Replace obsolete pool and image guidance with Azure Compute Gallery information and an Ubuntu 24.04 example.
- Document supported-images authentication requirements and format example Key Vault URLs as code.
- Remove unused certificate validators, node-agent SKU formatting, and a Cloud Services parameter entry.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/batch/_validators.py |
Remove unused certificate validators. |
src/azure-cli/azure/cli/command_modules/batch/_params.py |
Refresh image help and format example key URLs. |
src/azure-cli/azure/cli/command_modules/batch/_parameter_format.py |
Remove the obsolete Cloud Services parameter entry. |
src/azure-cli/azure/cli/command_modules/batch/_help.py |
Update pool creation and supported-images help and examples. |
src/azure-cli/azure/cli/command_modules/batch/_format.py |
Remove the unused node-agent SKU table formatter. |
Review effort: Balanced
| az batch pool create --json-file batch-pool-create.json --account-name clibatch --account-key BatchAccountKey | ||
| - name: Create a Batch pool of two Ubuntu 24.04 compute nodes. | ||
| text: > | ||
| az batch pool create --id mypool --vm-size Standard_D4ds_v5 --target-dedicated-nodes 2 --image canonical:ubuntu-24_04-lts:server --node-agent-sku-id "batch.node.ubuntu 24.04" --account-name clibatch --account-key BatchAccountKey |
There was a problem hiding this comment.
Thanks, fixed in 648b819: both az batch pool create examples now pass --account-endpoint.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
@microsoft-github-policy-service agree company="Microsoft" |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
3edae12 to
ee7f3ae
Compare
|
Aditya Pujara (@a0x1ab) thanks for running the pipelines! The Windows jobs failed because the PR's merge commit was built on an older dev without #34328. I rebased on the latest dev, could you run them once more? |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Keyan Song (@mskeyansong) No actionable semantic defects confirmed in the six-file Batch change. Upstream CI passed, but regression coverage for the documented help and authentication scenarios remains unverified. The removed Review detailsUpstream CIThe handoff reports one completed, passing check and no failures for Test validation
Review follow-up: the referenced issues #29622 and #31201 were inspected through the sanitized issue helper. In Recording risk: pool examples and account prerequisites changed, but no recordings changed and mocked requests do not establish the real service response. Focused verification: render the affected examples in Inspection covered all six changed files, the listed semantic targets, and relevant registration, validation, formatting, authentication and SDK call paths. Rendered help, live authentication, service acceptance and all-platform runtime behavior were not verified. Additional notes
Risk assessment45/100 · Medium The Medium rating is driven by security-sensitive behavior, public CLI behavior.
Ask the Agent Tick a box to queue an action. Requires write access to this repository.
|
There was a problem hiding this comment.
Review comments are inline on the changed lines. See the X Engineering Agent Report.
| az batch pool create --json-file batch-pool-create.json --account-name clibatch --account-key BatchAccountKey --account-endpoint https://clibatch.eastus.batch.azure.com | ||
| - name: Create a Batch pool of two Ubuntu 24.04 compute nodes. | ||
| text: > | ||
| az batch pool create --id mypool --vm-size Standard_D4ds_v5 --target-dedicated-nodes 2 --image canonical:ubuntu-24_04-lts:server --node-agent-sku-id "batch.node.ubuntu 24.04" --account-name clibatch --account-key BatchAccountKey --account-endpoint https://clibatch.eastus.batch.azure.com |
There was a problem hiding this comment.
Add focused coverage for the new pool example
The existing BatchDataPlaneScenarioTests.test_batch_pool_cmd still creates Ubuntu 18.04; its JSON fixture uses Windows with zero dedicated nodes. Please add a recorded scenario for this two-node Ubuntu 24.04 example and assert the returned VM size, target dedicated count, image reference and node-agent SKU, then verify playback. This is a batch scenario-coverage gap, not a confirmed runtime regression. The endpoint omission reported earlier is already fixed here.
X Engineering Agent · Reviewer · React with +1 or -1 to train the reviewer
|
Thanks, added in 065d83f: Re-recording |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Hi NoriZC Teresa Ritorto (@teresaritorto), could you take a look? It updates old |
|
Can you please rebase from dev and resolve the conflict before I merge it? |
- `az batch pool create`: remove the Cloud Services Configuration text (Cloud Services pools retired on 2024-02-29). `--image` now describes Azure Compute Gallery image IDs (VHD and managed image pools retired on 2026-03-31) and uses an Ubuntu 24.04 example instead of Windows Server 2012 R2 (retired). Add an example that creates a pool with arguments. - `az batch pool supported-images list`: explain that a Batch account is needed and add examples (Azure#31201). - `az batch account create/set`: show the example key identifier in `--encryption-key-identifier` as code, so reference docs don't treat it as a link (Azure#29622). - Remove unused code: certificate validators, the node agent SKU table formatter, and a Cloud Services parameter entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
--identity-type was removed from az batch account create/set in Azure#23032 (Jul 2022); these settings had no effect. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run the two-node Ubuntu 24.04 example through az batch pool create with the SDK's create_pool mocked and check the pool request. Check the missing-endpoint error with Batch environment variables and config cleared. Check that versioned and versionless Azure Compute Gallery image IDs reach virtualMachineImageId unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
065d83f to
e0de303
Compare
|
Thanks xuming-ms! Rebased on dev and resolved the conflict (both new test classes kept in |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |

🤖 PR Validation — ️✔️ All clear
Related command
az batch pool create,az batch pool supported-images list,az batch account create,az batch account setDescription
Help text still described features that Azure Batch has retired
(retirement list):
az batch pool createsaid to choose between Cloud Services Configuration and Virtual Machine Configuration.Cloud Services pools were retired on 2024-02-29 and their arguments were removed in {Batch} Upgrade api to track2 v2024-02-01 #30501.
--imagedescribed managed image IDs (Microsoft.Compute/images) and used a Windows Server 2012 R2 example. Poolsfrom VHD and managed images were retired on 2026-03-31 (Azure Compute Gallery images are the replacement), and
Windows Server 2012 R2 Marketplace images were retired on 2024-12-05. The help now describes Azure Compute Gallery
image IDs, using the SDK's wording, and uses an Ubuntu 24.04 example (
canonical:ubuntu-24_04-lts:server, as inthe API 2025-06-01 examples).
Other help fixes:
az batch pool create: add an example that creates a pool from arguments.az batch pool supported-images list: explain that the command needs a Batch account, with examples foraz batch account loginand for--account-name/--account-endpointwith Microsoft Entra ID ([Reference feedback]: az cli command doesn't work as documented #31201).az batch account create/set: show the example key identifier in--encryption-key-identifieras code, so thereference docs build doesn't treat it as a link (az batch account | example links need to be escaped in reference content #29622).
Dead code removed (no callers):
validate_cert_file,validate_cert_settings(certificate commands were removed in#30501),
pool_node_agent_skus_list_table_format(the node agent SKU command no longer exists), thecloud_service_configuration.target_os_versionparameter entry, and theidentity_typeargument settings foraz batch account create/set(--identity-typewas removed from those commands in #23032, so the settings had no effect).Fixes #29622
Fixes #31201
Testing Guide
az batch pool create -h,az batch pool supported-images list -h,az batch account create -hazdev test batch,azdev style batch,azdev linter batchHistory Notes
[Batch]
az batch pool create: Update help for--imageand remove Cloud Services Configuration text[Batch]
az batch pool supported-images list: Add examplesThis checklist is used to make sure that common guidelines for a pull request are followed.