简体   繁体   English

Azure存储队列的绑定参数

[英]Binding parameters for Azure Storage Queue

I follow the following tutorial to add messages to a queue using Azure Functions. 我遵循以下教程,使用Azure Functions将消息添加到队列中。

https://docs.microsoft.com/en-us/azure/azure-functions/functions-integrate-storage-queue-output-binding#add-code-that-uses-the-output-binding https://docs.microsoft.com/en-us/azure/azure-functions/functions-integrate-storage-queue-output-binding#add-code-that-uses-the-output-binding

It worked fine when I used Azure web portal to create the function. 当我使用Azure Web门户创建功能时,它运行良好。 Now I am using Visual Studio. 现在,我正在使用Visual Studio。 I am confused how to add queue parameter to my function definition. 我很困惑如何将队列参数添加到我的函数定义。

[FunctionName("PublishMessage")]
public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequest req,
    <<<<<<<<<<<<TODO: What to add here>>>>>>>>>>> ICollector<string> outputQueueItem,
    TraceWriter log)
{
    log.Info("C# HTTP trigger function processed a request.");

Here are tha parameters from function.json file (which i need to add to my function), 这是来自function.json文件的参数(我需要将其添加到函数中),

{
  "type": "queue",
  "name": "outputQueueItem",
  "queueName": "outqueue",
  "connection": "AzureWebJobsDashboard",
  "direction": "out"
}

应该像

[Queue("outqueue", Connection="AzureWebJobsDashboard")] ICollector<string> outputQueueItem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM