1
votes

I'm running Visual Studio v15.3 and trying to create an Azure Function. I'm having trouble binding an output to a Service Bus Queue. I get the following error when I startup:

Microsoft.Azure.WebJobs.Host: Error indexing method 'CreateRawTransactions.Run'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'outputSbQueue' to type String&. Make sure the parameter Type is supported by the binding. 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.).

My function.cs code...

public static class CreateRawTransactions
{
        [FunctionName("CreateRawTransactions")]
        public static HttpResponseMessage Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, 
                                              TraceWriter log,
                                              [ServiceBus("outqueue", AccessRights.Manage, Connection = "ServiceBusConnection")] out string outputSbQueue)
        {
          outputSbQueue = "Hello ";
        }  
}

and the function.json

{
  "bindings": [
    {
      "name": "outputSbQueue",
      "type": "serviceBus",
      "queueName": "testqueue",
      "connection": "ServiceBusConnection",
      "direction": "out",
      "accessRights": "listen"
    }
  ],
  "disabled": false

}

and the local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "AzureWebJobsDashboard": ""
  },
  "ConnectionStrings": {
    "ServiceBusConnection": "Endpoint=sb://..."

  }
}

As an update, I changed the input trigger from an HttpTrigger to a ServiceBusTrigger and it works. Seems like it is something to do with using an HttpTrigger.

1
Possibly the same issue as this ?Garth Mason

1 Answers

0
votes

This sounds like https://github.com/Azure/azure-webjobs-sdk-script/pull/1804, and has been fixed. If you get an updated CLI, it should work.