Repository navigation
[Batch] az batch: Allow = in values of key=value arguments such as --environment-settings and --metadata - #34321
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. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the Azure Batch parser change to preserve embedded equals signs in argument values.
No open issues 🎉
What changed in this PR
Fixes #24887 by allowing embedded = characters in Azure Batch key=value argument values, including connection strings and padded base64 tokens.
Changes:
- Updates metadata, dictionary, and environment-setting parsers to split only on the first
=, while still rejecting input without a separator. - Adds regression coverage for embedded equals signs and malformed dictionary input.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py |
Updates parser tests and adds dictionary-format coverage. |
src/azure-cli/azure/cli/command_modules/batch/_validators.py |
Preserves equals signs within values in all three parsers. |
Review effort: Balanced
|
@microsoft-github-policy-service agree company="Microsoft" |
|
Please fix CI issues |
|
Yong Zhang (@yonzhan) thanks! The only failures were the Windows MSI/ZIP build jobs. They stopped in the build script's pip step ( |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Values for `--environment-settings`, `--metadata`, and other `key=value` arguments were split on every `=`, so values such as connection strings or base64 text were rejected. Split on the first `=` only, as resource files already do. Fixes Azure#24887 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1d70941 to
5b5f87b
Compare
|
Yong Zhang (@yonzhan) thanks for the re-run! The Windows jobs still failed because the PR's merge commit was built on an older dev without #34328. I rebased on the latest dev, could you run the pipelines once more? |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Keyan Song (@mskeyansong) Static inspection of head To addressTick each item as you address it.
Review detailsUpstream CIThe supplied snapshot reports 52 completed checks, 52 passed, and no failures. Failure relevance counts: 0 PR-related, 0 unrelated, 0 uncertain/unverified. The author reports 61 Batch tests passed in playback plus style/linter validation; this review did not independently execute those commands. Test validation
Static evidence supplement: The separately supplied context bundle does contain issue #24887. Its quoted SQL connection-string case reaches End-to-end issue-scenario regression coverage not verified: the Batch service response and displayed CLI environment values are not exercised. The mocked response contains only For focused maintainer verification, rerun Risk assessment0/100 · Low The Low rating reflects the detected change scope with no elevated security, reliability, customer, operational, dependency, sovereign-cloud, generated-output, or cross-component signal.
Ask the Agent Tick a box to queue an action. Requires write access to this repository.
|
Runs the command through the CLI's argument parsing with the Batch client's `create_task` and `get_task` mocked. A quoted SQL connection string (spaces and several `=`) and a second variable reach the task request with their exact names and values; a setting without `=` is still rejected and nothing is sent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
I added a test in 048d5a8 that runs Re-recording |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Hi JaysonTaiMicrosoft Teresa Ritorto (@teresaritorto), could you take a look? It fixes #24887, checks are green, and I'd like it in the December release. Thanks! ADO: https://msazure.visualstudio.com/AzureBatch/_workitems/edit/40378640 |
🤖 PR Validation — ️✔️ All clear
Related command
az batch task create,az batch pool create,az batch pool reset,az batch job create,az batch job-schedule create(every argument that takeskey=valuepairs)Description
Fixes #24887.
Values of
key=valuearguments were split on every=, so any value that contains=was rejected with"Incorrectly formatted environment settings" (or the metadata equivalent). Common values hit this: connection strings
(
CONN=Server=tcp:x;Database=y) and base64 text that ends in=.The three parsers (
metadata_item_format,string_dictionary_format,environment_setting_format) now split on thefirst
=only, the same wayresource_file_formatalready does. Input without any=is still rejected.Testing Guide
test_batch_metadata_item_format,test_batch_environment_setting_format; newtest_batch_string_dictionary_format.azdev test batch(61 passed, playback),azdev style batch,azdev linter batch.az batch task create --job-id job1 --task-id task1 --command-line "cmd /c set" --environment-settings "CONN=Server=tcp:x;Database=y"now sends
{"name": "CONN", "value": "Server=tcp:x;Database=y"}instead of failing.History Notes
[Batch]
az batch task create: Allow=in--environment-settingsvalues[Batch]
az batch pool create: Allow=in--metadataand--start-task-environment-settingsvaluesThis checklist is used to make sure that common guidelines for a pull request are followed.