Rami Vemula
Integrating Serverless Architecture Using Azure Functions, Cosmos DB, and SignalR Service
Rami Vemula
Visakhapatnam, Andhra Pradesh, India
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/978-1-4842-4488-3 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-4488-3 e-ISBN 978-1-4842-4489-0
https://doi.org/10.1007/978-1-4842-4489-0
Rami Vemula 2019
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Dedicated to my maternal grandmother Kanaka Maha Lakshmi and in (loving) memory of my grandparents: Rowgi (maternal grandfather), Venkaiah (paternal grandfather), and Raghavamma (paternal grandmother).
Introduction
The current decade of modern technology is not just encouraging businesses to undergo a technology shift, but is also providing innovative architectural solutions to serve their customers in a better way. The strategies like cloud first, mobile first from software giants like Microsoft are very promising. They provide new cloud architectures with greatest computational power at affordable prices. Gone are the days when developers needed to write thousands of lines of code to automate business workflows; the new cloud services provide numerous easy options to create and maintain business orchestrations. This opened doors for a whole new era of customer focused innovation and automation.
In the recent past, serverless computing gained significant momentum because of its built-in capabilities to abstract infrastructure and provide highly scalable solutions. Microsoft started its journey of serverless computing through Azure Functions. The streamlined development experience, event-driven approach, and ability to integrate with other solutions made the Azure Functions a favorite for projects where the Rapid Application Development model is followed. The overall ease of maintaining Azure Functions made them unique in serverless architectures.
Integrating Serverless Architecture Using Azure Functions, Cosmos DB, and SignalR Service provides a holistic approach to design and development of a Twitter Bot application by leveraging Azure Functions. The different types of Azure Functions narrated in this book will empower you to make the right decisions while adopting Azure Functions to specific business requirements. Azures Cosmos DB is used as the backend for the Twitter Bot application. This book illustrates the basic concepts of Cosmos DB along with its change feed mechanism through multiple examples. ASP.Net Core is the latest open source web framework from Microsoft and is used in this book to build the Twitter Bot web application.
Overall, this book will provide deeper insights into the serverless architectures, which will empower you to build scalable cloud solutions. Additionally, this book dive deep into the following topics:
Integrate Azure Functions with Azure SignalR Service to broadcast real-time messages.
Store and retrieve secrets of Azure Functions from Azure Key Vault.
Secure Azure Functions by enabling Twitter identity authentication using built-in app service authentication.
Build Continuous Integration and Continuous Delivery pipelines for Azure Functions using Azure DevOps.
Chapter , we create a timer trigger-based Azure Function and integrate it with the custom dependency injection implementation. We also learn how to debug and publish an Azure Function from Visual Studio to the Azure environment.
In Chapter , we create a Cosmos DB trigger-based Azure Function and integrate the repository pattern with existing functions.
In Chapter to secure all the application secrets. In that same chapter, we learn how to implement logging and exception handling in Azure Functions.
Chapter details the security aspects of Azure Functions, where we integrate security flow from the Twitter Bot web app to Azure Functions using an authentication token.
Concepts related to Continuous Integration and Continuous Delivery (CI/CD) are discussed in Chapter . We create build and release definitions at Azure DevOps for the Twitter Bot application source code and automate the entire DevOps lifecycle.
As a last note, I encourage you to further explore Azure Function concepts like durable functions, function proxies, etc. As the digital world is transforming itself into microservices to serve a global audience, there is a need for technologies to collaborate and deliver high-performance, scalable solutions. Understanding and implementing the right technologies to enrich a business solution and building eminence around current-day technologies are the most common problems faced by software professionals and organizations in our fast-paced modern-day ecosystem. This book demonstrates an end-to-end application design through one of the latest serverless architecture paradigms and, in the process, attempts to build eminence around some of the latest technologies.
Lets get started
Acknowledgments
I would first like to thank my parentsRamanaiah and RajaKumarimy wife Sneha, my three year old daughter Akshaya, and the rest of my familymy in-laws, aunts, uncles, cousins, and kidsfor their valuable support. Without that support, I could not have achieved all the wonderful milestones and accomplishments in my life. Their consistent encouragement, patience, and guidance gave me the strength to overcome all the hurdles and kept me moving forward.