I have some experience with Azure Functions but I am new to isolated worker process and v4.
I get this 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.).
Note that solutions from other posts may not work because of v4 or because of isolated worker process usage. My problem is similar but not the same.
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. How can I get rid of this error/warning message to make my (basic) Azure Function app work?