I have some experience with Azure Functions but I am new to isolated worker process and v4.
I get an annoying warning/error message:
No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
Please realise that solutions from other posts may not work directly because v4 or because of isolated worker process usage. My problem is similar but not the same.
This is frustrating.
typing func --version
gives this output:
4.0.5455
Here is my csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.20.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.4" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
</ItemGroup>
</Project>
Here is my Program.cs
:
using Microsoft.Extensions.Hosting;
namespace YourFunctionApp
{
class Program
{
static void Main()
{
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
// Add any additional services needed here
})
.Build();
host.Run();
}
}
}
Here is my local.settings.json :
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"FUNCTIONS_EXTENSION_VERSION": "~4"
}
}
Here is my host.json :
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true
}
}
},
"functionTimeout": "00:05:00"
}
In the properties folder, here is my serviceDependencies.json:
{
"dependencies": {
"appInsights1": {
"type": "appInsights"
}
}
}
and my launchsettings.json:
{
"profiles": {
"FunctionApp3": {
"commandName": "Project",
"commandLineArgs": "--port 7111",
"launchBrowser": false
}
}
}
To give some more context, I use VS 2022 on a Windows 10 Pro device. Please help me to get rid of this annoying error/warning message to make my (basic) Azure Function app working.
The error message "No job functions found" in Azure Functions indicates that
the Azure Functions runtime could not find any functions to execute within your project.
I have created an HTTP-triggered Azure Function v4 with a runtime stack of .NET 6.0 isolated process in Visual Studio. To run the Function App, there must be at least one function in the application. In my Function App, I used an HTTP trigger function. Please see below:
.csproj:
function code:
Program.cs:
host.json:
local.settings.json:
The above Http trigger function executed successfully. Check below:
Output: