Azure 和本地测试中的服务总线输出绑定抛出错误
Service Bus Output Bindings Throwing Error in both Azure and Local Testing
所以我有以下函数头:
[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.Anyone 知道任何解决方法吗?
请参阅您的绑定中的 "name": "outputSuccess ",
,看起来在 outputSuccess 之后还有一个额外的 space。您应该删除它并重试。
所以我有以下函数头:
[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.Anyone 知道任何解决方法吗?
请参阅您的绑定中的 "name": "outputSuccess ",
,看起来在 outputSuccess 之后还有一个额外的 space。您应该删除它并重试。