所以我有以下函数头:
[FunctionName("listenServiceBus")]
public static void Run([ServiceBusTrigger("metadataingest", AccessRights.Manage, Connection = "ServiceBus")]string mySbMsg,
ExecutionContext context, [ServiceBus("successqueue", Connection = "DEVservicebus", EntityType = Microsoft.Azure.WebJobs.ServiceBus.EntityType.Queue)]out string outputSuccess,
[ServiceBus("failqueue", Connection = "DEVservicebus", EntityType = Microsoft.Azure.WebJobs.ServiceBus.EntityType.Queue)]out string outputFailure, ILogger Log)
在这里我绑定到两个单独的服务总线,以输入和输出函数。我的function.json文件如下所示:
{
"bindings": [
{
"type": "serviceBusTrigger",
"connection": "ServiceBus",
"queueName": "metadataingest",
"accessRights": "manage",
"name": "mySbMsg"
},
{
"name": "outputSuccess ",
"type": "serviceBus",
"queueName": "successqueue",
"connection": "DEVservicebus",
"direction": "out"
},
{
"name": "outputFailure",
"type": "serviceBus",
"queueName": "failqueue",
"connection": "DEVservicebus",
"direction": "out"
}
],...
我遇到以下错误:
No job functions found. Try making your job classes and methods public. If
you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure
you've called the registration method for the extension(s) in your startup
code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
并且:
listenServiceBus: The binding name outputSuccess is invalid. Please assign
a valid name to the binding.
我当前正在运行.Net.Sdk.Function 1.0.12。有人知道任何解决方法吗?
答案 0 :(得分:0)
请参见绑定中的"name": "outputSuccess ",
,在outputSuccess之后似乎有多余的空格。您应该删除它,然后重试。