BeginningAzure Functions Building Scalable and Serverless Apps Rahul Sawhney Beginning AzureFunctionsBuilding Scalable andServerless AppsRahul SawhneyBeginning Azure Functions: Building Scalable and Serverless Apps Rahul Sawhney Hyderabad, India ISBN-13 (pbk): 978-1-4842-4443-2 ISBN-13 (electronic): 978-1-4842-4444-9 https://doi.org/10.1007/978-1-4842-4444-9 Copyright 2019 by Rahul Sawhney 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. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Smriti Srivastava Development Editor: Matthew Moodie Coordinating Editor: Shrikant Vishwakarma Cover designed by eStudioCalamar Cover image designed by Freepik (www.freepik.com) 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. For information on translations, please e-mail rights@apress.com, or visit www.apress.com/ rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at www.apress.com/bulk-sales. 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-4443-2. For more detailed information, please visit www.apress.com/source-code. Printed on acid-free paper This book is dedicated to my parents, Ashwani KumarSawhney and Neha Sawhney.
Without their sacrifices,I wouldnt have achieved what I have in life.Also, I would like to dedicate this book to my wife,Kulpreet, for always standing by my side andsupporting me during hard times.Table of Contents v Table of Con T T able of Con enT en s vi Table of Con T T able of Con enTs vii Table of Con T T able of Con enT en s viii About the AuthorRahul Sawhney works as a software developer with Microsoft, India, and has more than five years of experience delivering cloud solutions using technologies such as .NET Core, Azure Functions, microservices, AngularJS, Web API, Azure AD, Azure Storage, ARM templates, App Service, Traffic Manager, and more. He is a Microsoft Certified Azure Developer and Architect. He loves learning new technologies and is passionate about Microsoft technologies. In his free time, he loves playing table tennis, watching movies, and reading books. You can reach Rahul at rahulsawhney2206@gmail.com or www.linkedin.com/in/rahul- sawhney- 2206. ix About the Technical ReviewerVidya Vrat Agarwal is a software architect, author, blogger, Microsoft MVP, C# Corner MVP, speaker, and mentor.
He is a TOGAF Certified Architect and a Certified Scrum Master (CSM). Currently working as a principal architect at T-Mobile in the United States, he started working on Microsoft .NET with its first beta release. He is passionate about people, process, and technology, and he loves to contribute to the .NET community. He lives in Redmond, Washington, with his wife Rupali; two daughters, Pearly and Arshika; and a puppy girl, Angel. He blogs at www.MyPassionFor.Net and can be reached by e-mail (vidya_mct@yahoo.com) or on Twitter (@dotnetauthor). xi Acknowledgments I must start by thanking my girlfriend and now wife, Kulpreet, for always being there and supporting me during my struggling days and for always believing in me.
I could not have written this book without her support and motivation. My heartfelt thanks to Manas Mayank and Kidar Garg who introduced me to Microsoft Azure. They constantly mentored and guided me during my early days of learning cloud technologies. They helped me a lot by giving me complex work, and they always trusted in me. They not only changed my thought process but instilled a growth mind-set in me by encouraging me to try new technologies during this journey. I am highly indebted to my younger brother, Sanjay, and my childhood friends, Saurabh Trivedi and Gajendra Raikwar, because they always trusted in my abilities and pushed me to work hard.
I would also like to thank my managers at Microsoft (Subhavya Sharma, Anil Emmadi, Manish Sanga, and Jaydeep Baliram Sawant) for always encouraging me to try new things and supporting and guiding me. They helped me shape my career as well as guided me on the right path. I would also like to thank my colleagues at Microsoft, (Rishabh Verma, Mohit Garg, Subhendu De, Prashant Jain, Mehul Gardi, Binay Prasad, Sanyam Seth, Archit Shukla, Harshit Agarwal, Abhishek Somani, Sidharth Mittal, and Dinesh Kumar Reddy) for their zeal to learn new technologies. Each one of you has taught me something about new technologies, and the culture you create of learning and sharing is what makes work effortless. Thanks to the team at Apress (Smriti Srivastava, Shrikant Vishwakarma, and Matthew Moodie) for giving me this wonderful opportunity and making this a memorable journey. Thanks to Vidya Vrat xiii aCknowledgmen aC Ts T and Matthew Moodie for providing their valuable technical reviews, which has helped me to improve the book.
Lastly, I would like to thank all the readers of this book. Please feel free to share your valuable feedback about this book, which will help me to deliver better content in the future. I look forward to all your feedback and suggestions. xiv Introduction Get ready to create highly scalable apps and monitor functions in production using Azure Functions 2.0! The book starts by taking you through the basics of serverless technology and Azure Functions and then covers the different pricing plans of Azure Functions. After that, you will dive into how to use Azure Functions as a serverless API. Then, you will learn about the Durable Functions model and about disaster recovery and georeplication.
Next page