{"id":2694,"date":"2018-05-23T00:00:00","date_gmt":"2018-05-23T00:00:00","guid":{"rendered":"https:\/\/azure.microsoft.com\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb"},"modified":"2023-05-11T15:39:29","modified_gmt":"2023-05-11T22:39:29","slug":"serverless-real-time-notifications-in-azure-using-azure-cosmosdb","status":"publish","type":"post","link":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/","title":{"rendered":"Serverless real-time notifications in Azure using Azure #CosmosDB"},"content":{"rendered":"<p>\n<img loading=\"lazy\" decoding=\"async\" alt=\"header\" height=\"488\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp\" title=\"header\" width=\"1779\"><\/p>\n<p>There were lots of announcements at the <a href=\"https:\/\/developer.microsoft.com\/events\/build\/content\" target=\"_blank\" rel=\"noopener\">Microsoft Build 2018<\/a> conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you implement <strong>real-time<\/strong> messages and notifications quite easily, without worrying about instances or hosts.<\/p>\n<p>So it made me wonder, could I build something using my <strong>favorite globally-distributed and serverless database<\/strong>, <a href=\"https:\/\/azure.microsoft.com\/services\/cosmos-db\/\" target=\"_blank\" rel=\"noopener\">Azure Cosmos DB<\/a>, and Azure\u2019s serverless compute offering, <a href=\"https:\/\/azure.microsoft.com\/services\/functions\/\" target=\"_blank\" rel=\"noopener\">Azure Functions<\/a>? It turns out others were interested in this topic too.<\/p>\n<h2>Real-time, really?<\/h2>\n<p>For those of you that do not know, <a href=\"https:\/\/www.asp.net\/signalr\" target=\"_blank\" rel=\"noopener\">SignalR<\/a> is a library that\u2019s been around since 2013 for the ASP.NET Framework, recently rewritten for <a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\" target=\"_blank\" rel=\"noopener\">ASP.NET Core<\/a> under the name of <a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\/signalr\/introduction\" target=\"_blank\" rel=\"noopener\">SignalR Core<\/a>, that allows you to easily create <strong>real-time applications<\/strong> and push content to clients through the <strong>Websocket<\/strong> protocol, gracefully falling back to other alternatives depending on the client. It works great for games, dashboards\/monitoring apps, <a href=\"https:\/\/azure.microsoft.com\/blog\/have-fun-and-draw-awesome-on-the-cosmic-scale-azure-cosmosdb-pxdraw-canvas-today\/\" target=\"_blank\" rel=\"noopener\">collaborative apps<\/a>, mapping\/tracking apps, or any app requiring notifications.<\/p>\n<p>By leveraging the <a href=\"https:\/\/tools.ietf.org\/html\/rfc6455\" target=\"_blank\" rel=\"noopener\">Websocket<\/a> protocol, content can be pushed to clients without the overhead of opening multiple HTTP connections and over a single two-way TCP channel that is maintained for the entire session.<\/p>\n<h2>Going serverless!<\/h2>\n<p>One <strong>requirement<\/strong> of SignalR was that you, the developer, had to have a <strong>host<\/strong> to manage and maintain connections with clients, usually deployed as a Web instance. In Azure, you can do it in any of the PaaS offerings like App Service and Cloud Services. While it wasn\u2019t a complex task, it still meant you had to <strong>maintain<\/strong> and ensure the service could handle a number of connections and the load based on your design and user load definitions.<\/p>\n<p>With <strong>Azure SignalR<\/strong>, the <strong>host is provided for you<\/strong>. You only need to connect the clients and servers to the exposed service endpoint. You can even <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-signalr\/signalr-overview#how-does-it-scale\" target=\"_blank\" rel=\"noopener\">scale the service<\/a> based on your needs transparently.<\/p>\n<p>If you add a <strong>serverless database <\/strong>plus Azure Functions as a <strong>serverless platform<\/strong> to run all your code, then the result would be\u2026 Serverless, Serverless everywhere!<\/p>\n<h2>Streamlining notifications<\/h2>\n<p>The architecture would need:<\/p>\n<ul>\n<li>A <strong>client<\/strong> that can save data and receive real-time notifications. For simplicity, a <strong>web<\/strong> <strong>client<\/strong> was the faster option and to showcase we\u2019ve picked a common <strong>chat application<\/strong>.<\/li>\n<li>An <strong>API<\/strong> that can receive data from the clients and <strong>save<\/strong> them to the <strong>database<\/strong>.<\/li>\n<li>Some <strong>mechanism<\/strong> that can act upon new data and <strong>notify<\/strong> all clients in real-time.<\/li>\n<\/ul>\n<p>Since I was using Azure Functions (in <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-scale#consumption-plan\" target=\"_blank\" rel=\"noopener\">Consumption Plan<\/a>) as my compute layer, I distributed all functionality in four functions:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/FileServer.cs\" target=\"_blank\" rel=\"noopener\">FileServer<\/a> which acts as a serverless file server for static files that will let a web client browse and obtain the files in the <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/tree\/master\/src\/function\/ChangeFeedSignalR\/www\" target=\"_blank\" rel=\"noopener\">www<\/a> folder, as if there was a web host continually running (but shhh, there isn\u2019t!). The <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/www\/index.html\" target=\"_blank\" rel=\"noopener\">web client<\/a> is using <a href=\"https:\/\/www.npmjs.com\/package\/@aspnet\/signalr\" target=\"_blank\" rel=\"noopener\">Azure SignalR\u2019s npm package<\/a> for connectivity and transport protocol resolution. Alternatively, static assets could be served through <a href=\"https:\/\/azure.microsoft.com\/services\/cdn\/\" target=\"_blank\" rel=\"noopener\">Azure CDN<\/a> too.<\/li>\n<li><a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/SaveChat.cs\" target=\"_blank\" rel=\"noopener\">SaveChat<\/a>, which will receive chat messages from the connected web clients and save it to Cosmos DB using <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-bindings-cosmosdb#output\" target=\"_blank\" rel=\"noopener\">Output bindings<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/SignalRConfiguration.cs\" target=\"_blank\" rel=\"noopener\">SignalRConfiguration<\/a>, which will send the required information to the web client to initialize SignalR\u2019s Websocket connection.<\/li>\n<li><a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/FeedToSignalR.cs\" target=\"_blank\" rel=\"noopener\">FeedToSignalR<\/a>, which will trigger a <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/FeedToSignalR.cs\" target=\"_blank\" rel=\"noopener\">CosmosDB Trigger<\/a>, based on new data in Azure Cosmos DB, and broadcast it through Azure SignalR to all connected clients.<\/li>\n<\/ul>\n<p>In order to support custom routes, in particular for static web host, I implemented <a href=\"https:\/\/docs.microsoft.com\/azure\/azure-functions\/functions-proxies\" target=\"_blank\" rel=\"noopener\">Azure Functions Proxies<\/a> through a <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/proxies.json\" target=\"_blank\" rel=\"noopener\">proxies.json<\/a> file. So, when the user browses the base URL, it is instead calling one of the HTTP triggered functions.<\/p>\n<p>The complete flow is as follows:<\/p>\n<ul>\n<li>When the web client loads the static resources (e.g., browses the base URL), it pulls the SignalR configuration from <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/SignalRConfiguration.cs\" target=\"_blank\" rel=\"noopener\">SignalRConfiguration<\/a>.<\/li>\n<li>It will then negotiate with Azure SignalR the best transport protocol that the browser supports and connect.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"signalr\" height=\"374\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/140d7978-ada7-43c9-be0f-dc2f9b20845f.webp\" title=\"signalr\" width=\"688\"><\/p>\n<ul>\n<li>When the user writes a message, it will save it to Azure Cosmos DB via an Ajax call to <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/SaveChat.cs\" target=\"_blank\" rel=\"noopener\">SaveChat<\/a>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"chat\" height=\"486\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/91341b89-20b5-46ca-b444-cf21909ccaec.webp\" title=\"chat\" width=\"721\"><\/p>\n<ul>\n<li>Each chat line is stored as a document in Azure Cosmos DB.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"db\" height=\"265\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/5215ab15-61b9-4106-a8a5-a6562362b889.webp\" title=\"db\" width=\"925\"><\/p>\n<ul>\n<li>The <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/blob\/master\/src\/function\/ChangeFeedSignalR\/Functions\/FeedToSignalR.cs\" target=\"_blank\" rel=\"noopener\">FeedToSignalR<\/a> will trigger and broadcast it to all Azure SignalR connected clients.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"invocation\" height=\"276\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/3bc72e33-d634-48c5-bda2-9538aa486116.webp\" title=\"invocation\" width=\"823\"><\/p>\n<p>The final result is a <strong>complete serverless flow<\/strong> that consumes resources only when needed, and doesn\u2019t need to maintain any host or extra service layer.<\/p>\n<p>While this is just a chat app, it can easily be implemented in other flows like IoT, dashboards, system-wide broadcasts, and a big etcetera, dream big!<\/p>\n<h2>Next steps<\/h2>\n<p>The code is <a href=\"https:\/\/github.com\/ealsur\/serverlessnotifications\/\" target=\"_blank\" rel=\"noopener\">public in Github<\/a> and it even includes a nice button that will deploy the complete architecture for you in your Azure subscription in <a href=\"https:\/\/portal.azure.com\/#create\/Microsoft.Template\/uri\/https%3A%2F%2Fraw.githubusercontent.com%2Fealsur%2Fserverlessnotifications%2Fmaster%2Fazuredeploy.json\" target=\"_blank\" rel=\"noopener\">one click<\/a>!<\/p>\n<p><a href=\"https:\/\/portal.azure.com\/#create\/Microsoft.Template\/uri\/https%3A%2F%2Fraw.githubusercontent.com%2Fealsur%2Fserverlessnotifications%2Fmaster%2Fazuredeploy.json\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" alt=\"deploybutton\" height=\"42\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/018d6bb5-0d61-48c3-b267-84d1459dc44c.webp\" title=\"deploybutton\" width=\"198\"><\/a><\/p>\n<p>Clone, fork, and use it as a base for your new or current projects. Just remember that Azure SignalR is still in <strong>preview<\/strong>, the libraries or service APIs might change in the future. You can <a href=\"https:\/\/azure.microsoft.com\/try\/cosmosdb\/\" target=\"_blank\" rel=\"noopener\">try Azure Cosmos DB for free<\/a> today, no sign up or credit card required. Stay up-to-date on the latest Azure Cosmos DB news and features by following us on Twitter <a href=\"https:\/\/twitter.com\/search?q=%23cosmosDB&#038;src=typd\" target=\"_blank\" rel=\"noopener\">#CosmosDB<\/a>, <a href=\"https:\/\/twitter.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">@AzureCosmosDB<\/a>.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","footnotes":"","msx_community_cta_settings":[]},"categories":[1473],"tags":[],"audience":[3057,3055,3056],"content-type":[1511],"product":[1538],"tech-community":[],"topic":[],"coauthors":[871],"class_list":["post-2694","post","type-post","status-publish","format-standard","hentry","category-databases","audience-data-professionals","audience-developers","audience-it-implementors","content-type-best-practices","product-azure-cosmos-db"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Serverless real-time notifications in Azure using Azure #CosmosDB | Microsoft Azure Blog<\/title>\n<meta name=\"description\" content=\"There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Serverless real-time notifications in Azure using Azure #CosmosDB | Microsoft Azure Blog\" \/>\n<meta property=\"og:description\" content=\"There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026\" \/>\n<meta property=\"og:url\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Azure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/microsoftazure\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-23T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-11T22:39:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp\" \/>\n<meta name=\"author\" content=\"Matias Quaranta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@azure\" \/>\n<meta name=\"twitter:site\" content=\"@azure\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matias Quaranta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\"},\"author\":[{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/matias-quaranta\/\",\"@type\":\"Person\",\"@name\":\"Matias Quaranta\"}],\"headline\":\"Serverless real-time notifications in Azure using Azure #CosmosDB\",\"datePublished\":\"2018-05-23T00:00:00+00:00\",\"dateModified\":\"2023-05-11T22:39:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\"},\"wordCount\":834,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp\",\"articleSection\":[\"Databases\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\",\"name\":\"Serverless real-time notifications in Azure using Azure #CosmosDB | Microsoft Azure Blog\",\"isPartOf\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp\",\"datePublished\":\"2018-05-23T00:00:00+00:00\",\"dateModified\":\"2023-05-11T22:39:29+00:00\",\"description\":\"There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026\",\"breadcrumb\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp\",\"contentUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog home\",\"item\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Serverless real-time notifications in Azure using Azure #CosmosDB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#website\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\",\"name\":\"Microsoft Azure Blog\",\"description\":\"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.\",\"publisher\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\",\"name\":\"Microsoft Azure Blog\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp\",\"contentUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp\",\"width\":512,\"height\":512,\"caption\":\"Microsoft Azure Blog\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/microsoftazure\",\"https:\/\/x.com\/azure\",\"https:\/\/www.instagram.com\/microsoftdeveloper\/\",\"https:\/\/www.linkedin.com\/company\/16188386\",\"https:\/\/www.youtube.com\/user\/windowsazure\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117\",\"name\":\"shakir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"caption\":\"shakir\"},\"sameAs\":[\"https:\/\/azure.microsoft.com\"],\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Serverless real-time notifications in Azure using Azure #CosmosDB | Microsoft Azure Blog","description":"There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/","og_locale":"en_US","og_type":"article","og_title":"Serverless real-time notifications in Azure using Azure #CosmosDB | Microsoft Azure Blog","og_description":"There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026","og_url":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/","og_site_name":"Microsoft Azure Blog","article_publisher":"https:\/\/www.facebook.com\/microsoftazure","article_published_time":"2018-05-23T00:00:00+00:00","article_modified_time":"2023-05-11T22:39:29+00:00","og_image":[{"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp","type":"","width":"","height":""}],"author":"Matias Quaranta","twitter_card":"summary_large_image","twitter_creator":"@azure","twitter_site":"@azure","twitter_misc":{"Written by":"Matias Quaranta","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#article","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/"},"author":[{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/matias-quaranta\/","@type":"Person","@name":"Matias Quaranta"}],"headline":"Serverless real-time notifications in Azure using Azure #CosmosDB","datePublished":"2018-05-23T00:00:00+00:00","dateModified":"2023-05-11T22:39:29+00:00","mainEntityOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/"},"wordCount":834,"commentCount":0,"publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp","articleSection":["Databases"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/","name":"Serverless real-time notifications in Azure using Azure #CosmosDB | Microsoft Azure Blog","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp","datePublished":"2018-05-23T00:00:00+00:00","dateModified":"2023-05-11T22:39:29+00:00","description":"There were lots of announcements at the Microsoft Build 2018 conference, but one that caught my eye was the preview release of Azure SignalR, a Platform-as-a-Service (PaaS) offering that lets you\u2026","breadcrumb":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#primaryimage","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/05\/b51cee18-6093-4130-930f-acd811f7b5e0.webp"},{"@type":"BreadcrumbList","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/serverless-real-time-notifications-in-azure-using-azure-cosmosdb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog home","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Serverless real-time notifications in Azure using Azure #CosmosDB"}]},{"@type":"WebSite","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","name":"Microsoft Azure Blog","description":"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.","publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization","name":"Microsoft Azure Blog","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","width":512,"height":512,"caption":"Microsoft Azure Blog"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/microsoftazure","https:\/\/x.com\/azure","https:\/\/www.instagram.com\/microsoftdeveloper\/","https:\/\/www.linkedin.com\/company\/16188386","https:\/\/www.youtube.com\/user\/windowsazure"]},{"@type":"Person","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117","name":"shakir","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4","url":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","caption":"shakir"},"sameAs":["https:\/\/azure.microsoft.com"],"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/"}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Azure Blog","distributor_original_site_url":"https:\/\/azure.microsoft.com\/en-us\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/2694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/comments?post=2694"}],"version-history":[{"count":0,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/2694\/revisions"}],"wp:attachment":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/media?parent=2694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/categories?post=2694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tags?post=2694"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/audience?post=2694"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/content-type?post=2694"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/product?post=2694"},{"taxonomy":"tech-community","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tech-community?post=2694"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/topic?post=2694"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/coauthors?post=2694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}