{"id":10186,"date":"2025-05-23T07:00:53","date_gmt":"2025-05-23T14:00:53","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=10186"},"modified":"2025-05-19T19:56:57","modified_gmt":"2025-05-20T02:56:57","slug":"now-in-public-preview-azure-functions-trigger-for-azure-cosmos-db-for-mongodb-vcore","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/now-in-public-preview-azure-functions-trigger-for-azure-cosmos-db-for-mongodb-vcore\/","title":{"rendered":"Now in Public Preview: Azure Functions Trigger for Azure Cosmos DB for MongoDB vCore"},"content":{"rendered":"<p>The Azure Cosmos DB trigger for Azure Functions is now in public preview\u2014available for C# Azure Functions using Azure Cosmos DB for MongoDB vCore!<\/p>\n<p>This new capability allows developers to easily trigger Azure Functions in response to changes in a MongoDB vCore collection, making it simple to build real-time, event-driven applications with minimal setup.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture1.png\"><img decoding=\"async\" class=\"size-full wp-image-10187 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture1.png\" alt=\"Picture1 image\" width=\"432\" height=\"254\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture1.png 432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture1-300x176.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/a><\/p>\n<h2>\ud83d\udd0d What\u2019s New?<\/h2>\n<p>Until now, change feed-based triggers in Azure Functions were only available for the API for NoSQL. With this new extension, MongoDB developers using Azure Cosmos DB\u2019s vCore architecture now get first-class serverless support.<\/p>\n<p>The Cosmos DB trigger for MongoDB vCore listens for inserts and updates in your MongoDB vCore collections and automatically calls your Azure Function with the relevant change data\u2014enabling reactive, event-driven workflows with ease.<\/p>\n<p>&nbsp;<\/p>\n<h2>\u2728 Key Benefits<\/h2>\n<ul>\n<li>Real-time Processing: React instantly to changes in your MongoDB vCore collections.<\/li>\n<li>Simplified Architecture: No need to poll or manage custom change stream logic.<\/li>\n<li>Scalable and Serverless: Leverage the power of Azure Functions for effortless scale.<\/li>\n<li>Tightly Integrated: Built specifically for the Azure Cosmos DB for MongoDB vCore platform.<\/li>\n<\/ul>\n<h2>\ud83d\udee0 Use Cases<\/h2>\n<ul>\n<li>Sync data changes across services<\/li>\n<li>Trigger workflows or notifications<\/li>\n<li>Real-time analytics and dashboards<\/li>\n<li>Clean, transform, or enrich data as it&#8217;s written<\/li>\n<\/ul>\n<h2>Input and Output Bindings in C# for MongoDB vCore<\/h2>\n<p>With Azure Functions and MongoDB vCore, bindings make data access incredibly simple no need to write boilerplate code to connect to your database.<\/p>\n<h2>Input Bindings<\/h2>\n<p>Input bindings allow your function to read documents directly from a MongoDB vCore collection with just a few lines of code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture4.png\"><img decoding=\"async\" class=\"size-full wp-image-10189 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture4.png\" alt=\"Picture4 image\" width=\"432\" height=\"229\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture4.png 432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture4-300x159.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/a><\/p>\n<p>Yes, the same familiar [CosmosDBInput] attribute works with MongoDB vCore \u2013 just point it to your vCore connection string.<\/p>\n<h2>Output Bindings<\/h2>\n<p>Output bindings let you write documents to your MongoDB vCore collection without managing connections or SDKs.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture3-1.png\"><img decoding=\"async\" class=\"size-full wp-image-10190 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture3-1.png\" alt=\"Picture3 image\" width=\"432\" height=\"243\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture3-1.png 432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture3-1-300x169.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/a><\/p>\n<h2>Trigger Support<\/h2>\n<p>You can also react to data changes in MongoDB vCore using Cosmos DB triggers. For example, whenever a document is inserted or updated in a collection, your Azure Function can automatically execute.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture5.png\"><img decoding=\"async\" class=\"size-full wp-image-10191 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture5.png\" alt=\"Picture5 image\" width=\"432\" height=\"243\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture5.png 432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/05\/Picture5-300x169.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><\/a><\/p>\n<h2>\ud83d\udd27 Getting Started<\/h2>\n<p>To get started, use Azure Functions v2 or later with a C# function app, and connect it to your MongoDB vCore account using the new Cosmos DB trigger binding for MongoDB vCore. You\u2019ll find detailed documentation and code samples to walk you through the setup.<\/p>\n<p>This feature is currently in public preview, and your feedback is invaluable as we expand support to additional languages and platforms.<\/p>\n<h2>\ud83d\udcac Let Us Know What You Think<\/h2>\n<p>We\u2019d love to hear how you\u2019re planning to use this feature or any ideas for improvement. Share your feedback through<a href=\"https:\/\/feedback.azure.com\/d365community\"> Azure Feedback<\/a>\u00a0 or <a href=\"https:\/\/github.com\/Azure\/Azure-functions-mongodb-extension\">GitHub issues<\/a>.\nStart building serverless MongoDB apps like never before with Cosmos DB for MongoDB vCore and Azure Functions!<\/p>\n<h2><strong>Leave a review<\/strong><\/h2>\n<p>Tell us about your Azure Cosmos DB experience! Leave a review on PeerSpot and we\u2019ll gift you $50.\u00a0<a id=\"menuros8\" class=\"fui-Link ___1q1shib f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn\" title=\"https:\/\/peerspotdotcom.my.site.com\/proreviews\/?salesopportunityproduct=00kpy000004tkxjia4&amp;productpeerspotnumber=30881&amp;calendlyaccount=peerspot&amp;calendlyformlink=peerspot-product-reviews-ps-gc-vi-sf-50&amp;giftcard=50\" href=\"https:\/\/peerspotdotcom.my.site.com\/proReviews\/?SalesOpportunityProduct=00kPy000004TKXJIA4&amp;productPeerspotNumber=30881&amp;CalendlyAccount=peerspot&amp;CalendlyFormLink=peerspot-product-reviews-ps-gc-vi-sf-50&amp;giftCard=50\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Link Get started here\">Get started here<\/a>.<\/p>\n<h2><strong>About Azure Cosmos DB<\/strong><\/h2>\n<p>Azure Cosmos DB is a fully managed and serverless NoSQL and vector database for modern app development, including AI applications. With its SLA-backed speed and availability as well as instant dynamic scalability, it is ideal for real-time NoSQL and MongoDB applications that require high performance and distributed computing over massive volumes of NoSQL and vector data.<\/p>\n<p>To stay in the loop on Azure Cosmos DB updates, follow us on\u00a0<a id=\"menurosb\" class=\"fui-Link ___1q1shib f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn\" title=\"https:\/\/twitter.com\/azurecosmosdb\" href=\"https:\/\/twitter.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Link X\">X<\/a>,\u00a0<a id=\"menurose\" class=\"fui-Link ___1q1shib f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn\" title=\"https:\/\/aka.ms\/azurecosmosdbyoutube\" href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Link YouTube\">YouTube<\/a>, and\u00a0<a id=\"menurosh\" class=\"fui-Link ___1q1shib f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn\" title=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Link LinkedIn\">LinkedIn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Azure Cosmos DB trigger for Azure Functions is now in public preview\u2014available for C# Azure Functions using Azure Cosmos DB for MongoDB vCore! This new capability allows developers to easily trigger Azure Functions in response to changes in a MongoDB vCore collection, making it simple to build real-time, event-driven applications with minimal setup. \ud83d\udd0d [&hellip;]<\/p>\n","protected":false},"author":80443,"featured_media":10192,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-10186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api"],"acf":[],"blog_post_summary":"<p>The Azure Cosmos DB trigger for Azure Functions is now in public preview\u2014available for C# Azure Functions using Azure Cosmos DB for MongoDB vCore! This new capability allows developers to easily trigger Azure Functions in response to changes in a MongoDB vCore collection, making it simple to build real-time, event-driven applications with minimal setup. \ud83d\udd0d [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/80443"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=10186"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10186\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/10192"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=10186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=10186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=10186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}