Azure function – No job functions found

Posted: January 9, 2024  |  Categories: Azure

I describe a solution to a “No job functions found” error. I observe this error when attempting to create an Azure function running on an Azure isolated host.

The problem

Creating and attempting to run an Azure function following this QuickStart yields this error.

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.)

The boiler-plate code is generated from the VSCode template by selecting

PromptSelectionPrompt
Select a language for your function projectChoose C#.Select a language for your function project
Select a .NET runtimeChoose .NET 6.0 Isolated (LTS).Select a .NET runtime
Select a template for your project’s first functionChoose Azure Blob Storage trigger.Select a template for your project’s first function
Provide a function nameType SetBlobIndex.Provide a function name
Provide a namespaceType Bidone.EDI.Batch.Functions.Provide a namespace
Local App settingSelect create newCreate new Local app settings
SubscriptionSelect Bidone/Dev/TestProvide subscription
Storage AccountChoose edidevstorageProvide storage account
Container PathChoose edi-batch-extract-archiveProvide Container path
Select how you would like to open your projectSelect Open in current window. 

using System.IO;
using System.Threading.Tasks;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace Bidone.EDI.Batch.FunctionApps
{
    public class SetBlobIndex
    {
        private readonly ILogger<SetBlobIndex> _logger;

        public SetBlobIndex(ILogger<SetBlobIndex> logger)
        {
            _logger = logger;
        }

        [Function(nameof(SetBlobIndex))]
        public async Task Run([BlobTrigger("edi-batch-extract-archive/{name}", 
        Connection = "edistoragedev_STORAGE")] 
        Stream stream, 
        string name)
        {
            using var blobStreamReader = new StreamReader(stream);
            var content = await blobStreamReader.ReadToEndAsync();
            _logger.LogInformation($"C# Blob trigger function Processed blob\n Name: {name} \n Data: {content}");
        }
    }
}

Running the project locally with F5 you see

Microsoft.Azure.WebJobs.Extensions.Storage.Blobs: Could not load type 'Microsoft.Azure.WebJobs.ParameterBindingData' from assembly 'Microsoft.Azure.WebJobs, Version=3.0.34.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Value cannot be null. (Parameter 'provider')

Register Azure Functions binding extensions by editing the host.json file.

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      },
      "enableLiveMetricsFilters": true
    }
  },
  "concurrency": {
    "dynamicConcurrencyEnabled": true,
    "snapshotPersistenceEnabled": true
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.0.0, 5.0.0)"
  }
}

Now running locally again using func host start –verbose, you get the error.

The solution

After much wailing and gnashing I teeth I found I did not have the correct version of the Azure SDK functions SDK. Even after installing the correct version from the link in Develop Azure Functions locally using Core Tools | Microsoft Learn I still got the same error, and the version of the SDK did not change in Visual Studio Code or Visual Studio.

Finally, after installing with chocolately, func host start runs locally without error. I had forgotten that the Azure Core Function Tools was installed on my machine with

choco install azure-functions-core-tools

Thus, an MSI install does not change the SDK version that my IDE uses. Thus I had to remove the Azure Core Function Tools SDK from add remove programs and then run.

choco upgrade azure-functions-core-tools

In conclusion this is trap if you use chocalately. Once used you must use it all the time.

turbo360

Back to Top