How To Configure Queue Name for Queue Trigger In Azure Function App

后端 未结 1 745
独厮守ぢ
独厮守ぢ 2021-02-07 09:48

I\'m creating a function app in Azure and want to use a queue trigger. I know how to configure the queue name at design time, e.g:

相关标签:
1条回答
  • 2021-02-07 10:08

    Could you not just reference the queue name as a setting (using the %settingName% syntax) for your App Function? Then in each function app you deploy have change the setting to the required queue name.

    [FunctionName("MyTestFunction")]
    public static void Run([QueueTrigger("%MyQueueName%", Connection = "testdelete")]string myQueueItem, TraceWriter log)
    

    And specify the setting in local.settings.json for running locally

    {
      "Values: {
         "MyQueueName": "myqueue-items"
       }
    }
    
    0 讨论(0)
提交回复
热议问题