I have created an Azure Function (V2, .NETCore) for Service Bus Queue Trigger. But I am getting below error while running the project.Please find below the screenshots.
My Function Code is given below.
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
namespace FunctionTriggers
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([ServiceBusTrigger("myqueue", Connection = "ServiceBusConnString")]string myQueueItem, ILogger log)
{
log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
}
}
}
ServiceBusConnString
is also the storage account connection string. Please use service bus connection string. It should be likeEndpoint=sb://<your service bus name>.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<your share key>
. Regarding how to get it, please refer to docs.microsoft.com/en-us/azure/service-bus-messaging/… – Jim Xu