Migrate apps from Azure Functions version 3.x to version 4.x

Martin Choi 6 Reputation points
2023-01-31T04:53:37.37+00:00

Hello, I have an Azure function app project using Gradle. Currently the function app version is 3 and I am following the below doc. to migrate to version 4.

https://learn.microsoft.com/en-us/azure/azure-functions/migrate-version-3-version-4?tabs=net6-in-proc%2Cazure-cli%2Cwindows&pivots=programming-language-java

But I encountered a problem when I republished migrated project to the upgraded function app.

In the build.gradle of my Azure function app application, I have specified the FUNCTIONS_EXTENSION_VERSION = '~4' in appSettings

azurefunctions {
    subscription = 'xxxxx-xxxx-xxxx-xxxx-xxxx'
    resourceGroup = 'xxxxxxx'
    appName = 'xxxxxx'
    region = 'Southeast Asia'
    runtime {
        os = 'Linux'
        javaVersion = '8'
    }
    localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
    appSettings {
        FUNCTIONS_EXTENSION_VERSION = '~4'
    }
}

Then when I run the azureFunctionsDeploy, it pops up below error: Cannot deploy functions due to error: FUNCTIONS_EXTENSION_VERSION is empty or invalid, please check the configuration

enter image description here

Can I know how to fix this error? As I follow https://github.com/microsoft/azure-gradle-plugins/tree/master/azure-functions-gradle-plugin to add the FUNCTIONS_EXTENSION_VERSION = '~4' in appSettings.

Thank you.

Martin

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

1 answer

Sort by: Most helpful
  1. Adrian Gallo 80 Reputation points
    2023-01-31T06:52:27.5433333+00:00

    The issue might be that the FUNCTIONS_EXTENSION_VERSION is not being passed correctly to the Azure Functions app during deployment. You can try the following steps to resolve this issue:

    1. Verify that the azurefunctions block in the build.gradle the file is correctly formatted, and all the necessary information is provided.
    2. Make sure that the correct version of the Azure Functions Gradle plugin is being used in your project. You can check this by adding the following line to the build.gradle file: plugins { id "com.microsoft.azure.functions" version "1.7.0" }
    3. Try using the functions property instead of appSettings to set the FUNCTIONS_EXTENSION_VERSION:
    azurefunctions {
        subscription = 'xxxxx-xxxx-xxxx-xxxx-xxxx'
        resourceGroup = 'xxxxxxx'
        appName = 'xxxxxx'
        region = 'Southeast Asia'
        runtime {
            os = 'Linux'
            javaVersion = '8'
        }
        localDebug = "transport=dt_socket,server=y,suspend=n,address=5005"
        functions {
            FUNCTIONS_EXTENSION_VERSION = '~4'
        }
    }
    
    

    If the above steps do not work, you can try setting them FUNCTIONS_EXTENSION_VERSION directly in the Azure portal instead of through the Gradle configuration. To do this, go to the Azure portal, select your Functions app, and go to the Configuration tab. Add a new setting in the App settings section with the key FUNCTIONS_EXTENSION_VERSION and the value. ~4.

    I hope these steps help resolve the issue with the FUNCTIONS_EXTENSION_VERSION error in your Azure Functions app.

    0 comments No comments

Your answer

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