Skip to content

az functionapp config appsettings set emits misleading "Invalid version: 21 for runtime java" warning on Linux Java 21/25 apps #33379

@ahmedmuhsin

Description

@ahmedmuhsin

Title

az functionapp config appsettings set emits misleading "Invalid version: 21 for runtime java" warning on Linux Java 21/25 apps

Describe the bug

When updating app settings on a Linux Java 21 (or Java 25) Function App on a Dedicated plan with a built-in Java image, every invocation of az functionapp config appsettings set prints a WARNING: Invalid version: 21 for runtime java and os linux. Supported versions for runtime java and os linux are: ['25.0', '21.0', '17.0', '11.0', '8.0']. Run 'az functionapp list-runtimes' for more details on supported runtimes.

The warning is cosmetic — the app settings update itself succeeds — but it is confusing to users and looks like a deployment-time error in CI logs.

The same kind of false positive can be reproduced on .NET-isolated apps when the Bicep/portal-stored runtime version is 8.0 (the Stacks API returns "8" for that runtime).

Related command

az functionapp config appsettings set

(emitted by check_language_runtime_FunctionAppStackRuntimeHelper.resolve in appservice/custom.py)

Errors

PS C:\> az functionapp config appsettings set --name FA-demo-java-version --resource-group RG-demo-java-version --settings test_one=three
WARNING: Invalid version: 21 for runtime java and os linux. Supported versions for runtime java and os linux are: ['25.0', '21.0', '17.0', '11.0', '8.0']. Run 'az functionapp list-runtimes' for more details on supported runtimes.
[
  ...
]

Issue script & Debug output

Repro:

  1. Create a Linux Java 21 Function App on a Dedicated plan via the Portal (no other changes).
  2. Run az functionapp config appsettings set --name <app> --resource-group <rg> --settings test_one=three --debug.
  3. Observe the warning above. The setting is still applied.

Tested with multiple az versions including the latest. The Portal stores the runtime as Java|21 (no .0 suffix); the Stacks API returns the version as '21.0'. The CLI's lookup table old_to_new_version in _FunctionAppStackRuntimeHelper.resolve does not have an entry for 21 (or 25), so the version is reported as invalid even though Java 21 is fully supported.

Expected behavior

No warning. az functionapp config appsettings set should treat Java|21 as a valid configuration for a supported, available runtime.

More generally, the version normalization should not require a code change to add an entry every time a new Java/.NET major version ships.

Environment Summary

azure-cli                         2.85.0+ (also reproduces on previous releases)
core                              2.85.0

(Reproduced internally on the latest GA and on at least one previous release.)

Additional context

  • Linux Java 21 Function App, Dedicated plan, built-in Java image.
  • The warning text matches the API-returned versions exactly ('25.0', '21.0', '17.0', '11.0', '8.0'), confirming the API itself returned correct data — the validation logic in the CLI is what's wrong.
  • For Web Apps, a related (but distinct) Java-versions issue was fixed by PR [App Service] az webapp list runtimes: Update logic to include missing Java versions and remove hardcoded lists #32461. That PR was scoped to _StackRuntimeHelper (az webapp list-runtimes); the Functions counterpart _FunctionAppStackRuntimeHelper.resolve still uses a hardcoded version map.

A fix is in progress; will link the PR once filed.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions