Skip to content

Instantly share code, notes, and snippets.

@MattJamesChampion
Last active January 15, 2021 09:27
Show Gist options
  • Save MattJamesChampion/66581b8da87273b32e2a5e611aec8976 to your computer and use it in GitHub Desktop.
Save MattJamesChampion/66581b8da87273b32e2a5e611aec8976 to your computer and use it in GitHub Desktop.
.NET 5 Azure Functions issues

The below has been tested with a newly created Azure Functions project targeting .NET Core 3.1 that is then converted to .NET 5 using the steps in this blog post. The project is able to run locally, but attempting to publish it fails. More specifically:

Attempting to run func azure functionapp publish <FunctionAppName> returns the following error:

Your Azure Function App has 'FUNCTIONS_WORKER_RUNTIME' set to 'dotnet' while your local project is set to 'None'.
You can pass --force to update your Azure app with 'None' as a 'FUNCTIONS_WORKER_RUNTIME'

Attempting to run func azure functionapp publish <FunctionAppName> --csharp appears to work (since the following is displayed)

Getting site publishing info...
Creating archive for current directory...
Uploading 84.1 MB [###############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Functions in <FunctionAppName>:
    Example - [No Trigger Found]
        Invoke url: <InvokeURL>

When checking the Function app in the portal however:

  • On the "Overview" page: Microsoft.Azure.WebJobs.Script: Did not find functions with language [dotnet].
  • On the "Functions" page, the Function itself is listed but the following error is displayed at the top: Azure Functions runtime is unreachable

Attempting to run func azure functionapp publish <FunctionAppName> --dotnet appears to work (since the following is displayed)

Getting site publishing info...
Creating archive for current directory...
Uploading 84.1 MB [###############################################################################]
Upload completed successfully.
Deployment completed successfully.
Syncing triggers...
Functions in <FunctionAppName>:
    Example - [No Trigger Found]
        Invoke url: <InvokeURL>

I tried running func azure functionapp publish <FunctionAppName> --dotnet-isolated (since the value of FUNCTIONS_WORKER_RUNTIME in local.settings.json is dotnet-isolated, but that generates the following error instead:

Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]

Attempting to load the invokation URL return a 503 error with the text Function host is not running., but the function host is in an enabled and running state according to the portal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment