Skip to content

[BUG]: AzureFunctionApp@2 runtimeStack does not support DOTNET-ISOLATED|NET48 #21088

Open
@MrRosendahl

Description

@MrRosendahl

New issue checklist

Task name

AzureFunctionApp@2

Task version

No response

Issue Description

According to the AzureFunctionApp@2 documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-function-app-v2?view=azure-pipelines there is no support for DOTNET-ISOLATED|NET48 even though it is supported by azure functions, see the supported versions section here: https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#supported-versions and https://learn.microsoft.com/en-us/azure/azure-functions/migrate-version-3-version-4?tabs=netframework48%2Cazure-cli%2Cwindows&pivots=programming-language-csharp#choose-your-target-net-version

Even though the AzureFunctionApp@2 does not support .NET Framework 4.8 isolated worker the function app is created as .NET Framework 4.8, but there is a mismatch between the expected payload and the runtime.

We've noticed that your function app (THE_FUNCTION_APP) is configured with the FUNCTIONS_WORKER_RUNTIME setting as "dotnet-isolated", but expected value for the deployed application payload is "CSharp". This is an unoptimized state which limits performance and may impact application reliability. To help detect this, you may now see the AZFD0013 event raised at the Warning level in your logs. This will be raised to Error level in a future update. To ensure your app can run properly, for its current payload, you should set the FUNCTIONS_WORKER_RUNTIME value to "dotnet". You must also update any deployment automations you have, such as templates or CI/CD pipelines, so they specify the correct value as well. Please see https://aka.ms/functions-invalid-worker-runtime for more information.

FUNCTIONS_WORKER_RUNTIME is set to dotnet according to the guide (linked above) for creating a dotnet-isolated .NET Framework 4.8.

csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <RootNamespace>THE_ROOT_NAME</RootNamespace>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>

Bicep deploy:

resource functionApp 'Microsoft.Web/sites@2024-04-01' = {
  name: resourceName
  location: rgLocation
  tags: tags
  identity: {
    type: 'SystemAssigned'
  }
  kind: 'functionapp'
  properties: {
    siteConfig: { 
      ftpsState: 'Disabled'
      appSettings: [
        {
          name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
          value: appInsightsInstrumentationKey
        }
        {
          name: 'FUNCTIONS_EXTENSION_VERSION'
          value: '~4'
        }
        {
          name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING'
          value: keyVaultConnectionString
        }        
        {
          name: 'WEBSITE_RUN_FROM_PACKAGE'
          value: '1'
        }
        // See local.settings.template.json for these values
        {
          name: 'AzureWebJobsStorage'
          value: storageConnectionString
        }
        {
          name: 'FUNCTIONS_WORKER_RUNTIME'
          value: 'dotnet-isolated'
        }

https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureFunctionAppV2/task.json
Valid options in the task.json file are:

"options": {
        "DOTNET|6.0": "DOTNET|6.0",
        "DOTNET-ISOLATED|6.0": "DOTNET-ISOLATED|6.0",
        "DOTNET-ISOLATED|7.0": "DOTNET-ISOLATED|7.0",
        "DOTNET-ISOLATED|8.0": "DOTNET-ISOLATED|8.0",
        "DOTNET-ISOLATED|9.0": "DOTNET-ISOLATED|9.0",
        "JAVA|8": "JAVA|8",
        "JAVA|11": "JAVA|11",
        "JAVA|17": "JAVA|17",
        "JAVA|21": "JAVA|21",
        "NODE|14": "NODE|14",
        "NODE|16": "NODE|16",
        "NODE|18": "NODE|18",
        "NODE|20": "NODE|20",
        "PYTHON|3.8": "PYTHON|3.8",
        "PYTHON|3.9": "PYTHON|3.9",
        "PYTHON|3.10": "PYTHON|3.10",
        "PYTHON|3.11": "PYTHON|3.11"
      }

Nothing related to the supported DOTNET-ISOLATED|NET48 or DOTNET-ISOLATED|NET481 workers.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

vmImage: 'windows-latest'

Relevant log output

No need for logs, look at the supported azure function versions.

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

- task: AzureFunctionApp@2
  displayName: 'Deploying function app'
  inputs:
    azureSubscription: '${{ variables.azureSubscriptionName}}'
    appType: 'functionApp'
    appName: $(DEPLOYED_FUNCTION_APP_NAME)
    package: '$(Pipeline.Workspace)/CI/pipeline_artifact_$(Build.SourceBranchName)/function.zip' # A dotnet-isolated .NET Framework 4.8 function app (FUNCTIONS_WORKER_RUNTIME: dotnet-isolated, AzureFunctionsVersion: 4, TargetFramework: net48, OutputType: Exe, PlatformTarget: x64)
    # runtimeStack: 'DOTNET-ISOLATED|4.8' should be used as runtimeStack, not DOTNET-ISOLATED|8.0 or any other DOTNET-ISOLATED
    deploymentMethod: 'zipDeploy'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions