Can't run/debug Azure Function isolated (V4) .NET in Rider when using Launch Settings profile. Fails to set the host
Hi,
I have a simple Azure Function V4 running in isolated mode on .NET 6.0. This function app essentially has a bog standard Http trigger function that uses the boilerplate code except I've removed the local.settings.json file and added the launchSettings.json with one environment variable. The Repo can be found here https://github.com/assadf/SimpleFuncApp.
When I try to debug this in Rider using the .NET Launch Settings profile i.e.
I get the following error:
It seems like the host isn't resolved. Now when I run this same solution in Visual Studio 2022, it works fine.
My launchsettings.json is as follows:
{
"profiles": {
"SimpleFuncApp": {
"commandName": "Project",
"commandLineArgs": "--port 7093",
"launchBrowser": false,
"environmentVariables": {
"AZURE_FUNCTIONS_ENVIRONMENT": "Development",
"MyName": "Bob"
}
}
}
}
After changing the commandLineArgs to the following:
"commandLineArgs": "--host localhost --port 7093",
I get the following error:
Just be clear, I am able to run Azure Function isolated V4 successfully in Rider when I run the standard Azure Functions host configuration i.e:

I'm using Rider 2022.2.4 and have Azure Toolkit for Rider v3.50.0.1490-2022 installed. Running this on Windows 10.
Any ideas on what I need to do to get this to work in Rider?
Please sign in to leave a comment.
Just bumping this again. Any ideas?
Hello Assad,
Thank you for contacting Rider support.
Apologies for keeping you so long without an answer.
This is a known usability problem. Azure Function project is supposed to be run with via Azure Function Host run configuration that uses the
{AzureToolsInstallPath}/AzureFunctionsCoreTools/v**{Version}**/**{Exact version}**/funccommandlet.While using the .NET Launch Settings Profile, having the
"commandName": "Project"and"commandLineArgs": "--port 7137"set in launchsettings.json, Rider launches your project viadotnet {PathToOutputDir}/{ProjectName}.dll {Arguments}. You can try to launch your .dll from the terminal and you will see the similar error.Microsoft template includes the launchSettings.json for some reason, but actually, VS doesn’t use it in the default run configuration (same as Rider). Try launching your project in Visual Studio and take a look at the port in run output. Then match it with the one set in your launchSettings.json. They are different, so that VS, (same as Rider, while using the Azure Function Host run configuration) doesn’t use the launchSettings.json.
Rider generates that configuration, since the launchSettings.json file exists, but it is not supposed to work.
You are supposed to run your project using the Azure Function Host run configuration (which uses the azure
funccommandlet same as Visual Studio).If you have any other questions or difficulties, please let me know.
Have a nice day!
Thx Dmitry Kazantsev for the response. I'll use the Azure Function Host.