I'm adding a new azure function (isolated process) to a running .net 7 project, but got the compile error "The attribute 'ServiceBusTrigger' is a WebJobs attribute and not supported in the .NET Worker (isolated process)".
We're using isolated process for .net 7 at the moment and it can't be changed.
Even the simple function generated by chatGPT also can't be built because of that error
[Function("MyServiceBusTriggerFunction")] public static void Run( [ServiceBusTrigger("", "")] ServiceBusReceivedMessage message, FunctionContext context) { }
Any help will be much appreciated.
I have reproduced the issue at my environment using .Net 7 isolated process with service Bus triggered function and got the expected result
Please check if you have below items in your .csproj file. You can refer to this SO Thread for more details about the error.
I have created a default service Bus queue triggered function using VS code.
I have below files created in vs code
Code:
local.settings.json:
Output: