Giter VIP home page Giter VIP logo

Comments (3)

fallsimply avatar fallsimply commented on July 19, 2024

There is an official way, using input/output bindings.
I'd also recommend you install the Azure Functions VSCode Extension (and VSCode if your not already using it)

Samples

listen for updates in the database
cosmosTrigger1/function.json

{
  "bindings": [
    {
      "type": "cosmosDBTrigger",
      "name": "documents",
      "direction": "in",
      "leaseCollectionName": "leases",
      "connectionStringSetting": "AzureWebJobsStorage",
      "databaseName": "database",
      "collectionName": "collections",
      "createLeaseCollectionIfNotExists": "true"
    }
  ]
}

Docs

In the docs, any tab other than C# should have the same function.json as you should use with Rust.

Sidenote: This question could have been asked on StackOverflow as all this info is publicly documented but it takes a good amount of research and a while to understand!

Good luck with your handler and if you need some more help feel free to reply but I can't help with Rust code/syntax

from functions-custom-handlers.

captain-yossarian avatar captain-yossarian commented on July 19, 2024

This question could have been asked on StackOverflow

@fallsimply I have published the question on SO.
I'm waiting for your answer ))

from functions-custom-handlers.

judedaryl avatar judedaryl commented on July 19, 2024

For anyone who had the same issue. The cosmos db data can be found under Data.”name” ( name is the name you set on the in binding ) in the request body.

I was building my http triggers first and thought the behavior was the same with “enableForwardingHttpRequest” set to true, but this only works for http triggers with every other trigger the function host sends the raw data to a with a post method and route equal to the folder name where the function.json is found.

from functions-custom-handlers.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.