1

I have built an Azure Webjob that takes a queue trigger and an blob reference as input, processes the file and creates multiple output blob files (it's breaking a PDF into individual pages). In order to output the multiple blobs, I have code in the job that explicitly creates the storage/container connection and does the output. It would be cleaner to let webjobs handle this if it's possible using attributes.

Is there a way to output multiple blobs to a container? I can output multiple queue messages using the QueueAttribute and an ICollector, but I don't see if that's possible with a Blob (like a container reference where I can send multiple blobs). Thanks.

1 Answer 1

2

Correct - BlobAttribute does not support an ICollector binding. In the current beta release, we have added some new bindings that might help you a bit. For example, you can now bind to a CloudBlobContainer and you could use that to create additional blobs. See the release notes for more details.

Another possibility would be for you to use the IBinder binding (example here). It allows you to imperatively bind to a blob. You could do that multiple times in your function.

Sign up to request clarification or add additional context in comments.

2 Comments

The CloudBlobContainer looks like a good solution when out of beta. For now, with IBinder, just to extend the example to my situation, does this look correct to bind a MemorySteam: MemoryStream pdfPage = binder.Bind<MemoryStream>(new BlobAttribute("page/" + page.id + ".pdf")); myPdfLib.SaveAsSteam(pdfPage);
Yes that looks right. You can use the 1.1.0-beta1 release now from nuget if you wish (unless you're saying you don't want to use pre-release packages). We should be out of beta very soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.