I need to bind to an output blob, but the blob path needs to be computed dynamically in my function. How do I do it?
相关问题
- running headless chrome in an microsoft azure web
- Docker task in Azure devops won't accept "$(pw
- Register MicroServices in Azure Active Directory (
- Removing VHD's from Azure Resource Manager aft
- Cannot use the Knowledge academic API
相关文章
- SQL Azure Reset autoincrement
- How to cast Azure DocumentDB Document class to my
- Can't get azure web role to run locally using
- Azure WebApp - Unable to auto-detect the runtime s
- How to change region for Azure WebSite
- Azure webjob vs cloud service
- Azure data transfer Identity Column Seed Jumped by
- Download Azure web app?
Binder
is an advanced binding technique that allows you to perform bindings imperatively in your code as opposed to declaratively via thefunction.json
metadata file. You might need to do this in cases where the computation of binding path or other inputs needs to happen at runtime in your function. Note that when using anBinder
parameter, you should not include a corresponding entry infunction.json
for that parameter.In the below example, we're dynamically binding to a blob output. As you can see, because you're declaring the binding in code, your path info can be computed in any way you wish. Note that you can bind to any of the other raw binding attributes as well (e.g.
QueueAttribute
/EventHubAttribute
/ServiceBusAttribute
/etc.) You can also do so iteratively to bind multiple times.Note that the type parameter passed to
BindAsync
(in this caseTextWriter
) must be a type that the target binding supports.And here is the corresponding metadata:
There are bind overloads that take an array of attributes. In cases where you need to control the target storage account, you pass in a collection of attributes, starting with the binding type attribute (e.g.
BlobAttribute
) and inlcuding aStorageAccountAttribute
instance pointing to the account to use. For example:Have consolidated all of the information from this an other posts along with comments and created a blog post that demonstrates how to use Binder with a real world scenario. Thanks to @mathewc this became possible.