Chapter 2: Microservices and Serverless Scaling Patterns
Activity 2: Implementing Asynchronous Microblog Submission and Caching
Create a new C# Azure Functions project inside a folder called MicroBlogPostFunctions and create a model called MicroBlogPost that accepts a post with a username (email address), title, and content:
Create a HTTP-triggered function named PostMicroBlogPost that submits these posts to an Azure Storage Queue named MicroBlogPosts:
Create a function named DequeMicroBlogPosts that takes the posts from the queue and inserts them into a Cosmos DB named MicroBlogSite:
Create a function called GetMicroBlogPosts that retrieves posts from the Cosmos DB in a list and uses the expires header to instruct end users to cache the response: