question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to publish .NET5 function app without forcing wrong worker runtime value

See original GitHub issue

I’ve created a function app on azure using following command

az functionapp create --name <APP_NAME> --storage-account <STORAGE_ACC> --plan <SERVICE_PLAN> --resource-group <RESOURCE_GROUP> --runtime dotnet-isolated --runtime-version 5.0 --functions-version 3

Created a .NET5 function project using func init and selecting dotnet isolated option.

When I try to publish the app

func azure functionapp publish <APP_NAME>

I get following message: Your Azure Function App has 'FUNCTIONS_WORKER_RUNTIME' set to 'dotnetIsolated' while your local project is set to 'None'.

If I specify the language in the end of the command

func azure functionapp publish <APP_NAME> --csharp

I still get the error: Your Azure Function App has 'FUNCTIONS_WORKER_RUNTIME' set to 'dotnetIsolated' while your local project is set to 'dotnet'..

So each time I deploy the function I have to use the --force switch and update the value on Azure Portal after the Function app is deployed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:18

github_iconTop GitHub Comments

1reaction
asparrowhawkcommented, Jun 9, 2021

@gzdorik-brightgrove Have you changed to the build output directory or publish directory before you issue the func azure functionapp publish command? Is the local.settings.json file present in the directory? The only time I saw “Can’t determine project language …” message was when the local.settings.json file was not present in the directory.

For your information:

❯ func --version
3.0.3442
1reaction
asparrowhawkcommented, May 4, 2021

@RyanMarcotte I have been having the same issue, but have been using a cut down local.settings.json file in the same publish output directory:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
  }
}

As I expect the additional values, for AzureWebJobsStorage etc, would overwrite those already setup in Azure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot error: Azure Functions Runtime is unreachable
The most common reason for this is that the function app has lost access to its storage account.
Read more >
Migrate apps from Azure Functions version 3.x to 4.x
This article shows you how to upgrade your existing function apps running on version 3.x of the Azure Functions runtime to be able...
Read more >
Your azure function app has functions_worker_runtime set ...
I encountered the same error when publishing a function using below command from Travis CI build. func azure functionapp publish <APP_NAME>.
Read more >
Running (Mostly) Minimal .NET 6 APIs in Azure Functions
Up to .NET 5, the documentation stated that the only way to get a newer version of .NET running in the current stable...
Read more >
The Good and the Bad of .NET Framework Programming
NET development platform is best served with Visual Studio IDE used for building, debugging, and publishing applications across all platforms ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found