Imperative binding patterns
See original GitHub issueI don’t know if it is possible but I would like to have a named parameter in my outputbinding like this:
{
"type": "queue",
"name": "queueoutput",
"queueName": "{queuename}",
"connection": "AzureWebJobsStorage",
"direction": "out"
}
And have the code decide what queuename to use. Scenario is, rest call in -> route to correct queue which will trigger corresponding function.
Right now I have to add all queue’s declaratively, as you can imagine, it can grow exponentially so having the ability to define the desired queue code would help a lot!
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Azure Functions bindings expressions and patterns
NET languages, you can use an imperative binding pattern, as opposed to the declarative bindings in function.json and attributes.
Read more >Azure Functions: Use imperative binding to control output ...
Azure Function is great, especially binding feature is awesome. But we need to control how binding work in run time, rather than compiled ......
Read more >Azure Functions imperative bindings
Imperative binder pattern The imperative binder uses a pattern where you add the Binder object in the signature of your Run method. ·...
Read more >Triggers and bindings in Azure Functions
Binding to a function is a way of declaratively connecting another resource to the function; bindings may be connected as input bindings, output ......
Read more >Azure Function Triggers and Bindings
NET languages, you can use an imperative binding pattern, as opposed to the declarative bindings in function.json and attributes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TylerLeonhardt - I have reopened https://github.com/Azure/azure-functions-host/issues/4207. yes, host should set typedData.json if the input data is infact json.
@bgelens -
yes, you can. Please see https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-expressions-patterns#dot-notation
Here is an extension to the above example: Sample input data in
queue1
Corresponding function.json to bind queuename to
input.name
for the outputbindingYou will not be able to set queuename for an output binding from within the function code. But Binding expressions allow you to use result from an input binding. Following sample shows how to specify
queuename
from an output binding from queueTrigger dataSample queue trigger data from queue with name
queue1
Now, you can set value for
outputQueueItem
for outputbinding which will be pushed to queue with namequeue2
Hope this helps!