Skip to content

{Batch} Pre-announce that false will mean false in az batch application set --allow-updates and az batch account create --mi-system-assigned - #34511

Open
Keyan Song (mskeyansong) wants to merge 2 commits into
Azure:devfrom
mskeyansong:keyan/batch-preannounce-true-false

Conversation

@mskeyansong

@mskeyansong Keyan Song (mskeyansong) commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

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

Related command
az batch application set
az batch account create

Description
az batch application set --allow-updates and az batch account create --mi-system-assigned take a value, and today any value except an empty one means true, even false:

  • --allow-updates false sends "allowUpdates": true, so package versions can be overwritten, although the help says "Specify either 'true' or 'false'".
  • --mi-system-assigned false gives the new account a system-assigned identity, unless a user-assigned identity is also given with --mi-user-assigned (then only that identity is sent, and the warning below still prints).

Customers may have built automation against this. A script that passes --allow-updates false and later uploads the same package version again would start to fail once false means false, and scripts that pass other values, such as yes, 1 or an empty value, would fail once only true or false is accepted. So this is a breaking change.

This PR pre-announces it for 2.100.0 (June 2027). When either option gets a value other than true (any letter case), the command prints a warning. The warnings are registered in the module's _breaking_change.py (register_conditional_breaking_change with an AzCLILogicChange for the module's TARGET_VERSION, as described in How to introduce breaking changes), so they can appear on Learn's upcoming breaking changes page; a new validator prints them. What the commands send doesn't change now; the PR with the change will follow in the breaking change window.

ADO: https://msazure.visualstudio.com/AzureBatch/_workitems/edit/40882829, https://msazure.visualstudio.com/AzureBatch/_workitems/edit/40882830

The change in 2.100.0
Both options will use az's flag-or-value type, get_three_state_flag(): the option alone or true means true, false means false (any letter case), and any other value, including an empty one, gets an error. az batch already uses this type for many of its other yes/no options, and other modules use it for --mi-system-assigned (for example az eventhubs and az servicebus). Today the option alone gets an error (expected one argument), so that part only adds a way to say true. An empty value, which today means false (--allow-updates= sends "allowUpdates": false, and --mi-system-assigned= asks for no system-assigned identity), will be rejected. Scripts that use it should switch to false when they move to 2.100.0, not before: until then, false still means true. The warning prints for an empty value too.

Testing Guide

  • az batch application set -g <rg> -n <account with auto-storage> --application-name <existing app> --allow-updates false shows: WARNING: '--allow-updates false' will stop package versions from being overwritten in 2.100.0. From then on, only 'true' or 'false' (any letter case) will be accepted, and '--allow-updates' alone will mean 'true'. Today any value except an empty one lets package versions be overwritten, even 'false'. To keep allowing overwrites, use 'true' before 2.100.0 (June 2027).
  • az batch account create -g <rg> -n <new account> -l <region> --no-wait --mi-system-assigned false shows: WARNING: '--mi-system-assigned false' will create the account without a system-assigned identity in 2.100.0. From then on, only 'true' or 'false' (any letter case) will be accepted, and '--mi-system-assigned' alone will mean 'true'. Today any value except an empty one gives the account a system-assigned identity, even 'false', unless a user-assigned identity is also given. To keep getting a system-assigned identity, use 'true' before 2.100.0 (June 2027).
  • Both --allow-updates= and --mi-system-assigned= (an empty value) show the warning too. With true (any letter case), without the option, or with -h, there's no new warning. The option alone still fails as today (expected one argument), with no warning.
  • test_batch_preannouncements checks that both entries target 2.100.0 and have the full messages. With the management clients mocked, TestBatchTrueFalseWarning checks that false, False, FALSE, no, 0, yes, 1 and an empty value each log the warning once, and that true, True, TRUE and leaving the option out log none. It also checks that both commands send what they send today: allowUpdates is true for those non-empty values and false for an empty value; account create asks for a system-assigned identity for those non-empty values, and for no identity with an empty value or without the option. And it checks that each option alone still exits with code 2 (expected one argument), without the warning or a request.
  • In 21 runs through the az entry point with the management clients mocked (azure-mgmt-batch 19.0.0), stdout, exit codes and request bodies (where a request is sent) match dev; the only difference is the new warning on stderr.
  • azdev generate-breaking-change-report batch lists the two new entries.
  • azdev test batch, azdev style batch, and azdev linter --ci-exclusions --min-severity medium --repo ./ --src HEAD --tgt <merge base with dev>.

History Notes
None ({Batch} title): this pre-announcement only adds a warning. The 2.100.0 PR's note will say: either option alone means true; true and false are accepted in any letter case, and false means false; any other value, including an empty one, is rejected.


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 December 1, 2026 18:04

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.

🟢 Approval recommended

No active review issues block the Batch boolean-handling deprecation notices.

No open issues 🎉

What changed in this PR

This PR pre-announces stricter boolean handling for two Batch options in Azure CLI 2.100.0 (June 2027), without changing current request behavior.

Changes:

  • Registers breaking-change notices for batch application set --allow-updates and batch account create --mi-system-assigned.
  • Adds warnings for supplied values other than case-insensitive true, including empty values.
  • Adds mocked command tests covering warning messages, quiet cases, and unchanged request bodies.
File Description
src/​azure-cli/​azure/​cli/​command_modules/​batch/​tests/​latest/​test_batch_breaking_change.py Tests notice registration, warning conditions, and preserved request behavior.
src/​azure-cli/​azure/​cli/​command_modules/​batch/​_validators.py Adds the conditional warning validator.
src/​azure-cli/​azure/​cli/​command_modules/​batch/​_params.py Attaches the validator to both affected options.
src/​azure-cli/​azure/​cli/​command_modules/​batch/​_breaking_change.py Registers both notices targeting 2.100.0.

Review effort: Balanced

@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 Dec 1, 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.

@mskeyansong

Copy link
Copy Markdown
Contributor Author

I'm moving this to draft while we confirm whether --allow-updates and --mi-system-assigned should be switches or take true/false.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

…gned`

`az batch application set --allow-updates` and `az batch account create --mi-system-assigned` treat
any value except an empty one as true, even `false`. The tests expect a warning for 2.100.0 when the
value isn't `true` (any letter case), no warning for `true` or no value, and the request bodies as
they are today.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-mi-system-assigned`

Register the change for 2.100.0 in `_breaking_change.py` (a conditional `AzCLILogicChange`), and
print it with a new validator only when `az batch application set --allow-updates` or
`az batch account create --mi-system-assigned` gets a value other than `true` (any letter case).
The requests don't change. Bugs 40882829 and 40882830.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mskeyansong
Keyan Song (mskeyansong) force-pushed the keyan/batch-preannounce-true-false branch from 3a87756 to 7b213bf Compare December 4, 2026 18:31
@mskeyansong
Keyan Song (mskeyansong) marked this pull request as ready for review December 4, 2026 18:31

This branch has not been deployed

No deployments
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants