Skip to content

When mixing Imperative bindings for blob and Declarative bindings for Queue messages, queue messages are written first even when Blob messages are explicitly flushed #1986

@hrkulkarMsft

Description

@hrkulkarMsft

I am using a binder to construct the blob name at runtime in my Azure Function. Additionally, I have a queue binding that is declarative. I write to the blob and then flush and close the text writer. Then I add the queue message to the collection. However, the queue message is written before the blob, resulting in the next function in the chain seeing an error.

Investigative information

  • Timestamp: 2017-09-30T00:21:00Z
  • Invocation ID:
    bc72ea3d-0170-4e30-9a4e-6c78504b8498 (parent job, which publishes blob & queue).
    4b77107d-4a80-433a-8bf4-d50c2788b84f (sample queue message job)
  • Region: NCUS

Repro steps

  1. Create an Azure Function
  2. Set an Azure Queue as the output.
  3. Have the function output a blob using a binder.
  4. Write to the blob, and then the queue. Example:

` using (var writer = await binder.BindAsync(attributes))
{
writer.Write(output);
writer.Flush();
writer.Close();
}

await outputQueueItem.AddAsync(new SomePoco {Name =  blobName});

`
5. Create an Azure Function which takes a QueueMessage with SomePoco as a trigger, and takes a blob with the Name of SomePoco as input.

Expected behavior

I expect the write to the blob to be blocking, and for the queue message to be written after the blob has been written.

Actual behavior

The blob messages are not written until the parent function completely finishes execution. While the queue messages are written while the parent function is still running.

Known workarounds

Have a copy of the function which processes the SomePoco queue messages, except it accepts input from the poison queue message stream. Then use this to manually clear out poison queue messages.

Related information

Provide any related information

  • Programming language used: C#

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions