Repository navigation
{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
Conversation
Contributor
There was a problem hiding this comment.
🟢 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-updatesandbatch 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
Contributor
|
Thank you for your contribution Keyan Song (@mskeyansong)! We will review the pull request and get back to you soon. |
Contributor
Author
|
I'm moving this to draft while we confirm whether |
Collaborator
|
/azp run |
|
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>
Keyan Song (mskeyansong)
force-pushed
the
keyan/batch-preannounce-true-false
branch
from
December 4, 2026 18:31
3a87756 to
7b213bf
Compare
Keyan Song (mskeyansong)
marked this pull request as ready for review
December 4, 2026 18:31
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation — ️✔️ All clear
Related command
az batch application setaz batch account createDescription
az batch application set --allow-updatesandaz batch account create --mi-system-assignedtake a value, and today any value except an empty one means true, evenfalse:--allow-updates falsesends"allowUpdates": true, so package versions can be overwritten, although the help says "Specify either 'true' or 'false'".--mi-system-assigned falsegives 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 falseand later uploads the same package version again would start to fail oncefalsemeans false, and scripts that pass other values, such asyes,1or an empty value, would fail once onlytrueorfalseis 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_changewith anAzCLILogicChangefor the module'sTARGET_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 ortruemeans true,falsemeans false (any letter case), and any other value, including an empty one, gets an error.az batchalready uses this type for many of its other yes/no options, and other modules use it for--mi-system-assigned(for exampleaz eventhubsandaz 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 tofalsewhen they move to 2.100.0, not before: until then,falsestill 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 falseshows: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 falseshows: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).--allow-updates=and--mi-system-assigned=(an empty value) show the warning too. Withtrue(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_preannouncementschecks that both entries target 2.100.0 and have the full messages. With the management clients mocked,TestBatchTrueFalseWarningchecks thatfalse,False,FALSE,no,0,yes,1and an empty value each log the warning once, and thattrue,True,TRUEand leaving the option out log none. It also checks that both commands send what they send today:allowUpdatesis true for those non-empty values and false for an empty value;account createasks 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.azentry point with the management clients mocked (azure-mgmt-batch 19.0.0), stdout, exit codes and request bodies (where a request is sent) matchdev; the only difference is the new warning on stderr.azdev generate-breaking-change-report batchlists the two new entries.azdev test batch,azdev style batch, andazdev 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;trueandfalseare accepted in any letter case, andfalsemeans 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.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.