Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.28k stars 423 forks source link

--runtime-version value not respected when creating new function with dotnet-isolated #3406

Open pgbfnf opened 11 months ago

pgbfnf commented 11 months ago

az version 2.50.0

When creating a new function app (using existing premium plan), I requested:

$runtime = "dotnet-isolated"
$runtimeversion = "6"

az functionapp create `
    --name $functionApp `
    --resource-group $resourceGroup `
    --storage-account $storage `
    --plan $premiumPlan `
    --app-insights-key $aikey `
    --functions-version 4 `
    --https-only true `
    --runtime $runtime `
    --runtime-version $runtimeversion `
    --tags $tags

Note -this config is listed as supported under az functionapp list-runtimes :

      "runtime": "dotnet-isolated",
      "supported_functions_versions": [
        "4"
      ],
      "version": "6"

However, after creation, in the Azure Portal, the .NET Version is listed as ".NET Framework 4.8" and NOT ".NET 6 (LTS) Isolated" I have to manually fix this after creation.

sjuarezgx commented 10 months ago

Have you got any news about this issue?

AndreaPic commented 3 months ago

I've the same issue with runtime version 8

twisha commented 1 month ago

I am having the same issue with runtime version 8

here are my commands

az functionapp create --resource-group dev-azfunctions --consumption-plan-location eastus --runtime dotnet-isolated --runtime-version 8 --os-type linux --functions-version 4 --name <funcname> --storage-account <mystorageacc>

//following doesn't give output as expected
az functionapp config show --name <funcname> --resource-group dev-azfunctions --query 'linuxFxVersion' -o
 tsv

I set the runtime version using the following command

az functionapp config set --name <funcname> --resource-group dev-azfunctions --linux-fx-version '"DOTNET-ISOLATED|8.0"'

//following now shows expected output DOTNET-ISOLATED|8.0
az functionapp config show --name <funcname> --resource-group dev-azfunctions --query 'linuxFxVersion' -o
 tsv
Mar8x commented 3 weeks ago

Issue with azure-cli 2.60.0 on Updating Runtime Version

We are continuing to experience an issue with azure-cli version 2.60.0 where it incorrectly handles runtime version updates for dotnet-isolated functions on Windows. Despite a successful update, the CLI outputs a misleading warning that suggests the version is invalid.

Workaround: To bypass this issue, you can manually set the runtime version using the following command:

az functionapp config set --net-framework-version '8' --resource-group $RESOURCE_GROUP --name $FUNC_NAME

This command does indeed update the runtime version correctly, but it triggers a confusing message:

Invalid version: for runtime dotnet-isolated and os windows. Supported versions for runtime dotnet-isolated and os windows are: ['8', '7', '6', '.4.8']. Run 'az functionapp list-runtimes' for more details on supported runtimes.

Note: The warning message "Invalid version" is incorrect as the runtime version '8' is actually supported and the update is applied successfully. This seems to be a bug in the CLI's error messaging rather than a failure in updating the setting.

It would be beneficial for the Azure CLI team to address this misleading error message in a future update to prevent confusion and ensure clearer communication regarding the actual status of the runtime version update.

romlodihc commented 1 week ago

I just checked this out with version 2.61.0 of the CLI. This version seems to fix the issue