Reputation: 28306
Given the signature below, how can I access the value of {name}
inside the code block?
For a simple example, I wish to log the name of the file added to the queue. Using the signature below, I get the image stream, as expected, but I don't see a way to access the filename {name}
from the stream.
[FunctionName("Foo")]
public static void Run([BlobTrigger("%queue%/{name}")]Stream image,
TraceWriter log)
{
*** Use the value of {name} here...
}
Upvotes: 0
Views: 1236
Reputation: 8235
[FunctionName("Foo")]
public static void Run([BlobTrigger("%queue%/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name, TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
string filename = name;
log.Info(filename);
}
Upvotes: 3