Azure functions creation with ~4 not working as expected

Dariusz Jalowiec 6 Reputation points
2022-08-31T19:45:43.507+00:00

Hi, When I create an azure function app using command :

    az functionapp create \    
    --name "$functionApp"\  
    --resource-group "$resourceGroup" \  
    --storage-account "$storageAccount" \  
    --consumption-plan-location $location \  
    --runtime dotnet \  
    --runtime-version 6 \  
    --functions-version 4 \  

I expect the function app to be created to using function app version 4 with runtime version 6 , but in my azure account I see the error that I am using unsupported version (aka 3.1 on v4)
236674-image.png

If I leave the optional runtime-version entirely off I see the same behavior, saying unsupported version.

to fix this error I have to manually set the runtime version 6 with command :

   az functionapp config set \    
    --net-framework-version v6.0 \  
    --name "$functionApp"\  
    --resource-group "$resourceGroup" \  

this then fixes the warning and we correctly use v6:
236703-image.png

If I do the same process using the azure UI it works as expected and I dont need to run any manual commands after to fix this:

236579-image.png

no warning:
236704-image.png

So my question is, why is the setting --runtime-version 6 being ignored when running the command with CLI? Or is there some other way to specify v6 in the create command?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,326 Reputation points Microsoft Employee Moderator
    2022-09-09T01:37:47.12+00:00

    I hit the same issue as you and tried different permutations of the command which yield the same result. But the FUNCTIONS_EXTENSION_VERSION and FUNCTIONS_WORKER_RUNTIME were appropriately set.

    239258-image.png

    I'm not sure if this is a CLI issue or Portal issue. With the --debug argument, I could see that ~4 and 6 were being passed as part of the request body but somewhere there is a disconnect. I reported the issue.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.