4

I created a C# Blob Trigger Function. It generated this code by default:

public static void Run(Stream myBlob, string name, TraceWriter log)
{
    log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}

and immediately was presented the following error in a red popup.

Error: Function ($BlobTriggerCSharp1) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.BlobTriggerCSharp1'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'name' 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.).

Chris Harrington
  • 1,238
  • 2
  • 15
  • 28

2 Answers2

9

Fix was to change the Path setting in "Integrate" to have an appended "/{name}"

Chris Harrington
  • 1,238
  • 2
  • 15
  • 28
  • Yes, you can change that path template as you need to. You could also just remove the {name} expression if you don't need it (removing the corresponding method param). – mathewc Feb 09 '17 at 04:15
0

In my case I had a mismatch between the /{name} and the actual method parameter name (I'd renamed it to blobName without thinking, but not updated the template to match).

Once I used the same in both places i.e. name (or blobName), it worked.

wislon
  • 723
  • 5
  • 21