-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input & Output bindings #289
Conversation
The feature is not complete yet, but I think it's worth running through a review. What's left to do:
|
Also tagging @ChristianEder |
examples/queue/index.ts
Outdated
const greeting = new azure.appservice.HttpEventSubscription('greeting', { | ||
resourceGroup, | ||
route: "{name}", | ||
inputOutputs: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why inputOutputs
and not bindings
? Or 2 distinct properties, 1 for inputs, 1 for outputs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had both of your versions in the past drafts :)
I thought bindings
might be confusing because they don't include the trigger (and the HTTP output), while technically a trigger is also a binding.
Two separate properties could make sense... I guess I'd need to have two distinct types then, to avoid misplacing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your remark about bindings
might be true. I personally would prefer to have 2 separate properties, but that’s not a strong opinion. If you choose to make it into two properties, you could probably relatively easy prevent misplacing by adding & {direction:“out“}
to the type definition of outputs (and similar for inputs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i woudl prefer two separate properties as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I like it too
sdk/nodejs/appservice/zMixins.ts
Outdated
// Nothing is returned if a function has no output bindings | ||
void | | ||
// A dictionary is returned if a function has output bindings | ||
Record<string, any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this into the main description? Also, can you doc what the keys/values are for this dictionary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
sdk/nodejs/appservice/zMixins.ts
Outdated
}; | ||
|
||
FunctionApp.prototype.getFunctionKeys = function(this: FunctionApp, functionName) { | ||
return pulumi.all([this.id, functionName]).apply(async ([id, functionName]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
export function combineBindingSettings(trigger: BindingSettings<BindingDefinition>, | ||
inputs?: InputBindingSettings[], | ||
outputs?: OutputBindingSettings[]) { | ||
const all = [trigger, ...inputs || [], ...outputs || []]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow. i didn't know that works. looks like that parses as ...(inputs || [])
.
@@ -44,7 +44,7 @@ const sampleFile = new azure.storage.Blob("test.html", { | |||
const fileServer = new azure.appservice.HttpEventSubscription("file-server", { | |||
resourceGroup, | |||
route: "{name}", | |||
inputOutputs: [ | |||
inputs: [ | |||
storageContainer.input("blob", { blobName: "{name}" }), | |||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i far prefer this :)
This is awesome. Sorry it took so long to get in! |
Introduce the concepts of Input and Output bindings to all Azure Function mixins. Started with Storage Queue Outputs and Storage Table Inputs.