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

Nested binding properties not supported? #38152

Closed
piquet-h opened this issue Sep 3, 2019 — with docs.microsoft.com · 10 comments
Closed

Nested binding properties not supported? #38152

piquet-h opened this issue Sep 3, 2019 — with docs.microsoft.com · 10 comments

Comments

Copy link

piquet-h commented Sep 3, 2019

Trying to bind a cosmosDb query to an input based on a json payload from event grid
{
"data" : { "username" : "fred" }
…. rest of event grid stuff
}

Can only bind to the outer properties. This is different to the description earlier in the document that talks about using dot notation to bind to nested properties.

Needs to be clarified, or alternatively, have the bug fixed.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Copy link
Author

piquet-h commented Sep 3, 2019

Hmm - seems to be the case.
Azure/azure-webjobs-sdk#1726

@msrini-MSFT
Copy link
Contributor

@piquet-h , Thank you for your feedback. We will investigate and get back to you shortly.

@PramodValavala-MSFT
Copy link
Member

PramodValavala-MSFT commented Sep 4, 2019

@piquet-h Thanks for the feedback! I believe the underlying issue should be resolves as part of the issue that you've mentioned. In the meantime, I guess a note in the doc should help customers hitting the same issue.

If you are using C#, I believe you could use runtime binding to overcome this. This also supported for CSX functions.

We are assigning this issue to the content author for further review.

@wisesimpson
Copy link
Contributor

@piquet-h Thanks for the feedback! I believe the underlying issue should be resolves as part of the issue that you've mentioned. In the meantime, I guess a note in the doc should help customers hitting the same issue.

If you are using C#, I believe you could use runtime binding to overcome this. This also supported for CSX functions.

We are assigning this issue to the content author for further review.

Instead of C#, is there a solution for javascript? Thanks

@PramodValavala-MSFT
Copy link
Member

@wisesimpson Because of the way non-C# languages work in Azure Functions, runtime binding is not possible.

Alternatives would be

  • Directly use the native SDKs as required
  • Send the required data in a queue message (using the output binding) and let this message trigger another function where you can directly use the data as needed

@wisesimpson
Copy link
Contributor

@PramodValavala-MSFT
If I want to build a simple page, triggered by http request and response with some data from cosmos db. Is it still possible to using the second alternative (using queue message)? I don't know if it's possible to carry the http response to the following function?

@PramodValavala-MSFT
Copy link
Member

@wisesimpson You'd want to serve the page statically and have JavaScript make the call to fetch the data as required. You can use patterns like Async HTTP APIs to achieve something like that.

@wisesimpson
Copy link
Contributor

@PramodValavala-MSFT Thanks for your reply. I follow your link and started to create durable functions. Another issue popped up but please forgive me if it's not specific to this topic. Here's the issue:
In the Orchestrator, I called context.df.callActivity("Action1", {"keywords":"test","top":2})
In the "Action1"'s function.json, I added a cosmosDB binding with sqlQuery as SELECT TOP {top} * FROM e WHERE CONTAINS(e.content,{keywords}).
I got error messages "The count value provided for a TOP clause must be an integer.".
I've searched and tried using udf like SELECT TOP udf.toInteger({top}) *...
or built-in function like SELECT TOP StringToNumber({top}) *...
None of them works. Can you help me out? Thanks

ps: The other argument keywords is well received and usable to sqlQuery.

@PramodValavala-MSFT
Copy link
Member

@wisesimpson I believe it would be best to create a thread on MSDN or StackOverflow with your last query, so that the discussion is visible to a larger audience.

@cachai2
Copy link
Contributor

cachai2 commented Nov 10, 2020

#please-close please refer to linked feature request issue Azure/azure-webjobs-sdk#1726

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

No branches or pull requests

9 participants