azure-functions-templates icon indicating copy to clipboard operation
azure-functions-templates copied to clipboard

Service bus trigger boiler plate code is incorrect

Open kshyju opened this issue 2 years ago • 0 comments

The boiler plate code generated for a service bus trigger in a V4 in-proc app is not correct. The class is static, but the function method is not. It causes Compiler Error CS0708 and the function app project cannot be built.

I was using Visual studio version 17.1.0. To reproduce, Use "Add-> New Azure function-> Select "Service bus queue trigger"

Code generated by tooling is below.

public static class Function6
{
    [FunctionName("Function6")]
    public void Run([ServiceBusTrigger("myqueue", Connection = "MyServiceBusConnStr")]string myQueueItem, ILogger log)
    {
        log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
    }
}

kshyju avatar Mar 04 '22 01:03 kshyju