'netFrameworkVersion in Azure App Services Api App

I'm configuring a api app in azure with bicep. This is a dotnet core 3.1 app. For netFrameworkVersion i provide 'v3.1', this however doesn't work. The deployment of the Bicep template does work, but my application does not. The value of .NET version is empty in the portal. enter image description here

When i manually change the version in the portal, and do an export of my app, the returned ARM template is sets netFrameworkVersion to 'v4.0'. I am very confused, what is happening here? I can't seem to find any documentation about this.
enter image description here

enter image description here



Solution 1:[1]

You need to specify the CURRENT_STACK metadata inside the siteConfig property:

resource webapp 'Microsoft.Web/sites@2018-11-01' = {
  ...
  properties: {
    ...
    siteConfig: {
      ...
      metadata: [
        {
          name: 'CURRENT_STACK'
          value: 'dotnetcore'
        }
      ]
      ...
    }
    ...
  }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thomas