No job functions found. Try making your job classes and methods public
If you are using Azure Functions in .NET 5 or higher with the out-of-proces execution model you need to replace your FunctionName
with Function
, otherwise the function will not be detected.
Before:
[FunctionName("CreateData")]
After:
[Function("CreateData")]
You should upgrade to the latest Microsoft.NET.Sdk.Functions
(1.0.6
as of today) and Microsoft.Azure.WebJobs.Service.Bus
(2.1.0-beta4
if running on full framework). You might need to remove the ServiceBus reference first in order to upgrade SDK.
The Microsoft.Azure.Eventhubs
package also needs to be removed. All relevant types etc are in Microsoft.Azure.WebJobs.Service.Bus
Also remember to check "Include prerelease" in the package manager in order to find 2.1.0-beta4
.
Another gotcha I found especially if you are converting from another project or version.
In the VS csproj file, make sure AzureFunctionsVersion is present
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
...etc
the tooling adds this automatically but not added if you are modifying a project where this was missing. Hope this helps you save the 3 hours it cost me :-).