Azure functions pinned to unsupported dotnet runtime ~4

Stephan van Rooij 61 Reputation points MVP
2022-05-03T18:15:55.907+00:00

I've this DOTNET 6 Azure Functions running. We are using ARM to deploy everything and that is what we also used to create this Azure Functions App.

Through the ARM template we set the following AppSettings:

  • FUNCTIONS_EXTENSION_VERSION to ~4
  • FUNCTIONS_WORKER_RUNTIME to dotnet

As that seems to be the way to configure Azure Functions for .NET 6 according to the documentation. https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions?tabs=in-process%2Cazure-cli%2Cv4&pivots=programming-language-csharp#azure

In the Configuration -> Function Runtime settings I'm getting this strange message, which I guess is a bug.

Your app is pinned to an unsupported runtime version for 'dotnet'. For better performance, we recommend using one of our supported versions instead: ~3.

Can we safely ignore this message? And if so, when will it be removed? As this is General Available since november 8th 2021 according to https://techcommunity.microsoft.com/t5/apps-on-azure-blog/azure-functions-4-0-and-net-6-support-are-now-generally/ba-p/2933245

The solution seems to be, to add netFrameworkVersion to the siteConfig section of the ARM template with the value v6.0. This does nothing more than remove the warning in the portal, but since the warning can be pretty alarming for users you should add this anyway if you're creating a new functions app from an ARM template.

   ....  
   "siteConfig": {  
     "appSettings": [....],  
     "netFrameworkVersion": "v6.0"  
   },  
   ...  
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,657 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Jeff Johnson 26 Reputation points
    2022-06-24T15:52:16.253+00:00

    How do I edit the site config from the portal?

    4 people found this answer helpful.

  2. VenkateshDodda-MSFT 19,646 Reputation points Microsoft Employee
    2022-05-04T08:12:03.187+00:00

    anonymous user Thanks for reaching out. Apart from those above-mentioned app settings You need to add another app setting netFrameworkVersion : v6.0 to bind your function app with runtime version as .Net 6.0. To repro this issue in my local environment i have created the ARM template below

    **ARM template: **

    {
        "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
            "storageAccountName":{
                "type": "string",
                "defaultValue":<StorageAccountName>
            },
            "serverFarmeName": {
                "type": "string",
                "defaultValue":<AppserviceplanName>
            },
            "applicationInsightsName": {
                "type": "string",
                "defaultValue": <FunctionappinsightsName>
            },
            "netframeworkversion": {"type": "string","defaultValue":"v6.0"}
        },
        "functions": [],
        "variables": {},
        "resources": [
        {
            "type" : "Microsoft.Storage/storageAccounts",
            "apiVersion": "2021-08-01",
            "name":"[parameters('storageAccountName')]",
            "kind": "Storage",
            "location":"[resourceGroup().location]",
            "sku": {
                "name": "Standard_LRS",
                "tier": "Standard"
            }
        },
        {
            "type": "Microsoft.Web/serverfarms",
            "apiVersion": "2021-03-01",
            "location":"[resourceGroup().location]",
            "name":"[parameters('serverFarmeName')]",
            "sku": {
                "name": "P1v2",
                "tier": "PremiumV2",
                "size": "P1v2",
                "family":"Pv2",
                "capacity": 1
            },
            "properties": {
                "hyperV": false,
                "isXenon": false
            }
    
        },
        {
            "type": "Microsoft.Insights/components",
            "apiVersion": "2020-02-02-preview",
            "name":"[parameters('applicationInsightsName')]",
            "location":"[resourceGroup().location]",
            "properties": {
                "Application_Type": "web",
                "DisableIpMasking": true
            }
        },
        {
            "name": <FunctionAppName>,
            "type": "Microsoft.Web/sites",
            "apiVersion": "2021-03-01",
            "location": "[resourceGroup().location]",
            "kind": "functionapp",
            "dependsOn": [
                "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
                "[resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))]"
            ],
            "properties": {
                "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverFarmeName'))]",
                "siteConfig": {
                    "appSettings": [
                        {
                            "name": "AzureWebJobsStorage",
                            "value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
                        },
                        {
                            "name": "FUNCTIONS_EXTENSION_VERSION",
                            "value": "~4"
                        },
                        {
                            "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
                            "value": "[reference(resourceId('Microsoft.Insights/components',parameters('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
                        },
                        {
                            "name": "FUNCTIONS_WORKER_RUNTIME",
                            "value": "dotnet"
                        },
                        {
                            "name":"APPLICATIONINSIGHTS_CONNECTION_STRING",
                            "value":"[reference(resourceId('Microsoft.Insights/components',parameters('applicationInsightsName')),'2015-05-01').ConnectionString]"
                        }
                    ],
                    "netFrameworkVersion": "[parameters('netFrameworkVersion')]",
                    "alwaysOn": true,
                    "use32BitWorkerProcess": true
                }
            }
        }
        ],
        "outputs": {}
    }
    

    I have tested this ARM template from my end, and it is working fine and would suggest you test it from your end as well.
    Alternatively, you can also refer to this blog post in which it is documented what all the probable causes and how to fix this issue as well.

    Feel Free to reach back to me if you have any further questions.

    1 person found this answer helpful.

  3. RobLSSE 1 Reputation point
    2023-01-06T10:00:36.14+00:00

    For me the answer was updating both the netFrameworkVersion and <platform>FxVersion fields in the config to make the warning disappear. In my case I am running on Linux so that is the one I updated.

    ...  
    "netFrameworkVersion": "v6.0",  
    "phpVersion": "",  
    "pythonVersion": "",  
    "nodeVersion": "",  
    "powerShellVersion": "",  
    "linuxFxVersion": "DOTNET|6.0",  
    "windowsFxVersion": null,  
    ...  
    
    0 comments No comments