Coder Social home page Coder Social logo

azurefunctionsdotnet6demo's Introduction

Azure Functions + Cosmos DB Integration Demo

About

This project provides a number of Azure Functions, to illustrate the capabilities found in the Cosmos DB bindings for Azure Functions. Documentation around these capabilities and supported scenarios can be found here.

Architecture

The following diagram illustrates the components and data flow that make up this solution. Conceptually, the solution represents a very naive implementation of a retailer, with orders and products.

The infrastructure template provisions a single Cosmos DB account and database. Within the database, there are two containers, one for orders and one for products. Two of the Functions write orders to the Orders container. A Function listens to the Change Feed on the Orders container and uses data received from that to update available inventory numbers in the Products container. Additionally, several Functions query the Products container.

Architecture Diagram

Functions

Function Name Description
CreateOrder Demonstrates how to save the content of an HTTP post to a Cosmos DB container, using a synchronous approach
CreateOrder2 Demonstrates how to save the content of an HTTP post to a Cosmos DB container, using a asynchronous approach
GetProductByIdFromRoute Demonstrates getting a specific Cosmos DB document, based in parameters (partition key and id) provided in the HTTP route data
GetProducts Demonstrates how to use an IDocumentClient instance, provided by the ComsosDB Functions binding
GetProductsByDescription Demonstrates how to compose a SQL query, using parameters provided by the HTTP route data
OrdersChangeFeedProcessor Demonstrates how to trigger a Function, using the Cosmos DB trigger and Change Feed

Deploying

The pipeline folder contains an Azure DevOps pipeline deploy the required infrastructure and Azure DevOps pipeline that will build the Function code and deploy the Function app.

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.