[App Service] Fix az functionapp config appsettings set: stop emitting misleading Invalid version warning for Java 21/25 and .NET-isolated apps#33380
Open
ahmedmuhsin wants to merge 1 commit into
Conversation
…ntime version suffix Replaces the hand-maintained old_to_new_version map in _FunctionAppStackRuntimeHelper.resolve with three generic numeric normalization rules that bridge bare-integer and X.0 forms in both directions, plus the legacy Java 1.8 -> 8.0 case. Each candidate is only accepted if it exists in the API-returned runtime list, so genuinely invalid versions still raise the existing 'Invalid version' error. Fixes the misleading 'Invalid version: 21 for runtime java' warning emitted when running az functionapp config appsettings set on Linux Java 21/25 apps. Same false positive could be reproduced on .NET-isolated apps when the persisted version was stored as 8.0 instead of 8.
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
az functionapp config appsettings set: stop emitting misleading Invalid version warning for Java 21/25 and .NET-isolated appsaz functionapp config appsettings set: stop emitting misleading Invalid version warning for Java 21/25 and .NET-isolated apps
Collaborator
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
berndverst
approved these changes
May 14, 2026
Member
|
I've been following along for a few days (since the original emails about the issue). I'm the current Functions Sev2 on-call. This LGTM. |
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.
Related command
az functionapp config appsettings set(also any other command that goes through
_FunctionAppStackRuntimeHelper.resolve, but the customer-facing symptom is onappsettings setbecauseupdate_app_settings_functionappcallscheck_language_runtimefirst)Description
Fixes #33379.
az functionapp config appsettings seton a Linux Java 21 (or Java 25) Function App emits aWARNING: Invalid version: 21 for runtime java and os linux ...even though the app is healthy and the setting is applied. Same false-positive can be reproduced on .NET-isolated apps when the stored version is8.0(the Stacks API returns"8"for that runtime).Root cause:
_FunctionAppStackRuntimeHelper.resolveinappservice/custom.pyvalidates a runtime version by exact-matching against the Stacks API output. When that fails, it consults a hand-maintainedold_to_new_versionmap. The map covered Java up to 17 and a couple of .NET swaps, but Java 21/25 were never added — soJava|21(Portal/Bicep style) never reconciles with API value"21.0".check_language_runtimeswallows theValidationErroras alogger.warning, producing the customer-visible noise.Replace the static map with three generic numeric normalization rules that are tried only when the direct lookup fails — and only as candidates that must still exist in the actual runtimes list returned by the API:
"21"→"21.0"(bare integer → decimal form)"8.0"→"8"(decimal form → bare integer)"1.8"→"8.0"(legacy Java backwards compatibility)These three rules cover every entry the old map had and stay self-healing for future Java/.NET majors. A genuinely unknown version (
"99","21.5", etc.) still produces the existingInvalid version:ValidationError.This is the Functions-side analogue to PR #32461, which removed similar hardcoded Java lists from the Web Apps
_StackRuntimeHelper. The PR's_get_java_versions_from_*helpers are not borrowed here because the Functions code path doesn't walk the stacks tree the way the Web Apps listing does — a small normalization inresolve()is sufficient.Testing Guide
New tests in
test_functionapp_commands_thru_mock.pycover:"21"→"21.0") — repros the customer's bug"8.0"→"8")"1.8"→"8.0"still worksValidationError"21.5") still raisesValidationErrordisable_version_error=Truestill suppresses the error and returnsNoneRun locally with:
Or:
All 8 new tests pass; the rest of the file (31 tests total) and the sibling
test_webapp_commands_thru_mock.py(50 tests) still pass.azdev style appservicepasses.History Notes
[App Service] Fix #33379:
az functionapp config appsettings set: stop emitting a misleading "Invalid version" warning for Java/.NET runtime versions stored without a matching decimal suffix