How to get message body attribute on blob input?

126 views Asked by At

I have an azure function with a service bus trigger:

  public static async Task<string> Run(
        [ServiceBusTrigger("sometopic", "somesub",Connection = "SbConnectionString")] Message message,
        [Blob("files/upload/{userId}/user.jpeg", FileAccess.Write)] Stream file,
        string userId,
        ILogger log)
    {

          ..some code
    }

But I´m getting this error:

The 'Run' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'ResponseTopicEmail'. Microsoft.Azure.WebJobs.Host: Unable to resolve binding parameter 'userId'. Binding expressions must map to either a value provided by the trigger or a property of the value the trigger is bound to, or must be a system binding expression (e.g. sys.randguid, sys.utcnow, etc.).

Is there a way to get some property from the Message body and use it to get the blob output?

0

There are 0 answers