Skip to content

[Batch] az batch pool create: Update outdated help text and examples - #34322

Merged
xuming-ms merged 4 commits into
Azure:devfrom
mskeyansong:keyan/batch-cleanup-outdated-help
Nov 17, 2026
Merged

xuming-ms merged 4 commits into
Azure:devfrom
mskeyansong:keyan/batch-cleanup-outdated-help

Conversation

@mskeyansong

@mskeyansong Keyan Song (mskeyansong) commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests Suppressions
️✔️ None ️✔️ 130/130 ️✔️ None

Related command
az batch pool create, az batch pool supported-images list, az batch account create, az batch account set

Description
Help text still described features that Azure Batch has retired
(retirement list):

  • az batch pool create said 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.
  • --image described managed image IDs (Microsoft.Compute/images) and used a Windows Server 2012 R2 example. Pools
    from 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 in
    the API 2025-06-01 examples).

Other help fixes:

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), the
cloud_service_configuration.target_os_version parameter entry, and the identity_type argument settings for
az batch account create/set (--identity-type was 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 -h
  • azdev test batch, azdev style batch, azdev linter batch

History Notes
[Batch] az batch pool create: Update help for --image and remove Cloud Services Configuration text
[Batch] az batch pool supported-images list: Add examples


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

Copilot AI balanced review requested due to automatic review settings November 2, 2026 20:02
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 2, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Keyan Song (@mskeyansong)! We will review the pull request and get back to you soon.

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.

🟡 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed in 648b819: both az batch pool create examples now pass --account-endpoint.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@mskeyansong

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan
Yong Zhang (yonzhan) requested a review from a team November 2, 2026 22:16
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@mskeyansong

Copy link
Copy Markdown
Contributor Author

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?

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@naga-nandyala Naga Nandyala (naga-nandyala) added Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR and removed X Engineering Agent Reviewed Agent reviewed this PR labels Nov 3, 2026
@x-engineering-agent

x-engineering-agent Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

X Engineering Agent Pull request review: Comments

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 identity_type registrations were ineffective overrides, not supported runtime options: neither account handler accepts that parameter, and ordinary argument settings cannot add it. Removed legacy helpers have no remaining Batch consumers; the pinned SDK lacks the retired Cloud Services field and supports both documented Gallery ID forms.

Check Status Detail
Upstream CI Passed The handoff reports one completed, passing check and no failures for…
Agent live tests Not run This is a review-only PR.
Regression coverage Unverified For batch: 1 focused test file(s) changed.
Risk Risk 45/100 Medium Medium; owner review required
Review details

Upstream CI

The handoff reports one completed, passing check and no failures for e0de3033336a47b53b91da765c5f4a0faabd22cb. Upstream CI is separate from the mocked request assertions below; no Agent live test was dispatched.

Test validation

  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: For batch: 1 focused test file(s) changed. Scenario coverage is unverified; review the issue's required conditions, test setup, and assertions before approval. Changed tests invoke az batch pool create, but invocation alone does not verify the required scenario or output. No linked issue was found in the PR timeline; inspect the source issue and its required scenario manually.

Review follow-up: the referenced issues #29622 and #31201 were inspected through the sanitized issue helper. In src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py, the new tests assert missing-endpoint rejection and exact Ubuntu/Gallery request construction at a mocked SDK boundary. They do not prove rendered help, Entra authentication, or service acceptance.

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 src/azure-cli/azure/cli/command_modules/batch/_help.py, exercise the documented Ubuntu and Gallery pool-create examples with an authenticated Batch account, and confirm the created pool's image configuration. Also inspect account create/set help for escaped example key identifiers and supported-images help for account prerequisites and keyless authentication guidance. This is a suggested human follow-up, not a missing-test finding.

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

  • design: In src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py:786-790, consider deriving EXAMPLE_ARGS from the published _help.py example rather than maintaining a separate copy. Changing the documented command currently does not change the arguments these tests exercise.

Risk assessment

45/100 · Medium

The Medium rating is driven by security-sensitive behavior, public CLI behavior.

  • Change scope: 6 changed files, 120 changed lines (+81 / -39), including 5 production files.
  • Affected components: batch
  • Risk drivers: security-sensitive behavior (+28); public CLI behavior (+18)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is required for batch before merge.

Ask the Agent

Tick a box to queue an action. Requires write access to this repository.

  • Re-review this PR
  • Run Agent live tests on this PR

X Engineering Agent · Reviewer · React with +1 or -1 to train the agent

@x-engineering-agent x-engineering-agent Bot 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.

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

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.

Medium 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

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Nov 3, 2026
@mskeyansong

Copy link
Copy Markdown
Contributor Author

Thanks, added in 065d83f: TestBatchPoolCreate runs the new two-node Ubuntu 24.04 example through az batch pool create with the SDK's create_pool mocked and checks the pool request (vmSize, targetDedicatedNodes, image publisher/offer/SKU and nodeAgentSKUId). With Batch config and environment variables cleared, it also covers explicit versus missing endpoint, and versioned and versionless Gallery image IDs.

Re-recording test_batch_pool_cmd.yaml and test_batch_pools_and_nodes.yaml, and checking supported-images live, needs a Batch test account that I don't have yet. Aditya Pujara (@a0x1ab) could you run the pipelines once more?

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@mskeyansong

Copy link
Copy Markdown
Contributor Author

Hi NoriZC Teresa Ritorto (@teresaritorto), could you take a look? It updates old az batch pool create help (fixes #29622, #31201), checks are green, and I'd like it in the December release. Thanks! ADO: https://msazure.visualstudio.com/AzureBatch/_workitems/edit/40378647

@xuming-ms

Copy link
Copy Markdown
Contributor

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>
@mskeyansong
Keyan Song (mskeyansong) force-pushed the keyan/batch-cleanup-outdated-help branch from 065d83f to e0de303 Compare November 16, 2026 15:42
@mskeyansong

Copy link
Copy Markdown
Contributor Author

Thanks xuming-ms! Rebased on dev and resolved the conflict (both new test classes kept in test_batch_commands.py). Style, linter and the Batch tests pass locally.

@yonzhan
Yong Zhang (yonzhan) requested a review from a team November 16, 2026 21:50
@xuming-ms

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@xuming-ms
xuming-ms merged commit 348d9fb into Azure:dev Nov 17, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad Batch az batch customer-reported Issues that are reported by GitHub users external to the Azure organization. Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Reference feedback]: az cli command doesn't work as documented az batch account | example links need to be escaped in reference content

8 participants