I'm trying to create an Azure Function that triggers on an AZ ServiceBus Queue message. The message contains a GUID string, matching the name of a BLOB on AZ storage. I'd like to have that BLOB available through an input binding but I'm not sure how...
I tried :
public static async Task Run(
[ServiceBusTrigger("outgoing-mail", Connection = "QueueConnString")] string inputMessage,
[Blob("email-messages/{inputMessage}", FileAccess.Read)] Stream mailBlob,
[SendGrid(ApiKey = "%SendgridApiKey%")] IAsyncCollector<SendGridMessage> messageCollector,
ILogger log)
I also tried {serviceBusTrigger} on the blob path by-the-way but either way, I get the following exception :
Microsoft.Azure.WebJobs.Host: Error indexing method 'SendMailQueueWorker'. Microsoft.Azure.WebJobs.Host: Unable to resolve binding parameter 'inputMessage'. Binding expressions must map to either a value provided by the trigger or property of the value the trigger is bound to or must be a system binding expression (e.g. sys.randguid, sys.utcnow, etc.).
I'm sure the input message of the queue is a string, how can I use this message content in the input binding of the BLOB?
[edit]
I added the feature request to UserVoice, so if you're running into this issue as well, please vote!
https://feedback.azure.com/forums/355860-azure-functions/suggestions/37528912-combine-servicebus-queue-message-with-storage-inpu
[/edit]