azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

[Flex Consumption] publish-settings-only downgrades runtime stack from .NET 9 isolated to .NET 8

Open MSFTJim opened this issue 1 month ago • 2 comments

Version

  • Plan: Flex Consumption
  • Runtime: .NET 9 isolated
  • Core Tools version: 4.5.0
  • OS: GitHub Codespaces - Ubuntu 24.04.02 LTS (Noble Numbat)
  • Azure CLI version: 2.80.0

Description

When using Azure Functions Core Tools with the --publish-settings-only flag against a Function App on the Flex Consumption plan, the runtime stack is silently downgraded from .NET 9 isolated to .NET 8 isolated. This behavior is unexpected and inconsistent with other tooling (e.g., VS Code extension, Azure CLI).

EXPECTED BEHAVIOR

  • --publish-settings-only should only sync App Settings
  • Runtime stack should remain unchanged (Dotnet-isolated - 9.0)

WORKAROUND Developers can safely use either Azure CLI or the VS Code extension to update App Settings. Both approaches leave the runtime stack untouched.

Steps to reproduce

STEPS TO REPRODUCE

  1. Create a new resource group az group create --name rgFuncRepro --location eastus2

  2. Create a new storage account (globally unique name) az storage account create
    --name reprostoragetr
    --resource-group rgFuncRepro
    --location eastus2
    --sku Standard_LRS

  3. Create a Function App on Flex Consumption az functionapp create
    --name reprofunc01
    --resource-group rgFuncRepro
    --storage-account reprostoragetr
    --flexconsumption-location eastus2
    --runtime dotnet-isolated
    --runtime-version 9
    --os-type Linux

  4. Confirm runtime stack in portal → Properties Expected: Dotnet-isolated - 9.0

  5. Run Core Tools publish-settings-only func azure functionapp publish reprofunc01 --publish-settings-only

  6. Observe CLI output "Updating function app runtime setting with 'dotnet-isolated 8.0'"

  7. Check portal → Properties again Actual: Runtime stack downgraded to Dotnet-isolated - 8.0

  8. Cleanup az group delete --name rgFuncRepro --yes --no-wait

MSFTJim avatar Nov 30 '25 12:11 MSFTJim

WORKAROUND UNTIL FIXED

Developers should avoid using Core Tools with the --publish-settings-only flag on Flex Consumption, as it downgrades the runtime stack from .NET 9 isolated to .NET 8 isolated.

Safe alternatives:

  1. Use Azure CLI to update App Settings: az functionapp config appsettings set
    --name <FunctionAppName>
    --resource-group <ResourceGroupName>
    --settings "MySetting=MyValue"

  2. Use VS Code extension: Right-click Function App → Upload Local Settings

Both approaches update App Settings without changing the runtime stack. The downgrade problem is specific to Core Tools --publish-settings-only.

MSFTJim avatar Nov 30 '25 12:11 MSFTJim

Good work-- detailing this issue and work around. Time saver- Thanks Jim

timrobertsusa avatar Nov 30 '25 15:11 timrobertsusa