I am trying to run Azure Function(C#) with service bus trigger and using DAPR to publish message to another queue in VS Code. But I am getting below error when I try to run the code: "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.)."
Below is my Azure Function code
using System;
using System.Collections.Generic;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.WindowsAzure.Storage.Blob;
using Dapr.Client;
namespace Company.ERM
{
public class erman
{
[FunctionName("erman")]
public void Run([ServiceBusTrigger("erman", Connection = "CON_SERVICEBUS")]string myQueueItem, ILogger log)
{
log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
using var client = new DaprClientBuilder().Build();
client.PublishEventAsync("orderpubsub", "orders", "test");
}
}
}
The yaml file in Component folder that I am using is as given below
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: orderpubsub
spec:
type: pubsub.redis
version: v1
metadata:
- name: redisHost
value: localhost:6379
- name: redisPassword
value: ""
Below is the command that I am running to run the function using DAPR in VS code:
dapr run --app-id checkout --resources-path ./component/ -- func start --no-build --verbose
Please suggest if I am missing something .


