Skip to content
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

Difficult to handle nested tokens in IResolutionPolicy implementations #1726

Open
brettsam opened this issue May 25, 2018 · 5 comments
Open
Milestone

Comments

@brettsam
Copy link
Member

PR Azure/azure-webjobs-sdk-extensions#354 exposed some issues with our IResolutionPolicy. In short, nested tokens are really hard to handle in the same way that our other bindings handle them. We'll need to restructure how this works in order to get this working.

This directly affects Table and CosmosDB -- neither of their query bindings can handle nested property bindings today.

There's a pretty lengthy internal discussion on this that I won't paste here, but should be consulted when it comes time to do this.

@piquet-h
Copy link

piquet-h commented Sep 3, 2019

Given this is 12 months old - what information is required to progress this?

A common pattern is responding to event grid notifications. If the data is in the EventGrid schema notification, then it's going to be under the data property, which means, by default, it's nested.

I'd really like to be able to write a function.json with code similar to
"sqlQuery": "select * from transactions where transactions.atmVersion= 'strings/{data.version}'"

@antempus
Copy link

Jumping in here to say that this would be a much-needed improvement given that passing in multiple inputs isn't really supported; this would solve the need by allowing us to just use nested props on a complex object.

@u000fsr
Copy link

u000fsr commented Sep 28, 2020

any updates on the ability to nested properties in cosmos sql query?

@rubenmamo
Copy link

Solving this would be a great help and would really simplify development of functions which access cosmos db and where you pass some sort of identifier as a header

@brettsam
Copy link
Member Author

There's no update on this. It would require a restructuring of how our bindings pass information, and since there's a way to do this without any change, we've prioritized this lower than other issues.

The recommended solution is to pull in the Cosmos SDK and run the query in the function itself. For example, the code where we do this from our binding (which likely can be simplified if it's not a binding) is here: https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions.CosmosDB/Bindings/CosmosDBEnumerableBuilder.cs#L27-L48

It's not as easy as using the notation above, but hopefully this isn't a blocker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants