A Developer's Guide to Building Resilient Cloud Applications with Azure - Hamida Rebai Trabelsi - E-Book

A Developer's Guide to Building Resilient Cloud Applications with Azure E-Book

Hamida Rebai Trabelsi

0,0
32,67 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

Successfully modernize your apps on Azure using APIs, event-driven systems, functions, and Service Fabric and connect them to different relational and non-relational databases



Purchase of the print or Kindle book includes a free PDF eBook

Key Features



  • Understand Function-as-a-Service and Azure Service Fabric for distributed applications
  • Develop event-based and message-based solutions using Event Grid and Azure Event Hubs
  • Explore continuous deployment for Docker with Azure DevOps and integrate Docker Hub with CI/CD pipelines

Book Description



To deliver software at a faster rate and reduced costs, companies with stable legacy systems and growing data volumes are trying to modernize their applications and accelerate innovation, but this is no easy matter. A Developer's Guide to Building Resilient Cloud Applications with Azure helps you overcome these application modernization challenges to build secure and reliable cloud-based applications on Azure and connect them to databases with the help of easy-to-follow examples.



The book begins with a basic definition of serverless and event-driven architecture and Database-as-a-Service, before moving on to an exploration of the different services in Azure, namely Azure API



Management using the gateway pattern, event-driven architecture, Event Grid, Azure Event Hubs, Azure message queues, FaaS using Azure Functions, and the database-oriented cloud. Throughout the chapters, you'll learn about creating, importing, and managing APIs and Service Fabric in Azure, and discover how to ensure continuous integration and deployment in Azure to fully automate the software delivery process, that is, the build and release process.



By the end of this book, you'll be able to build and deploy cloud-oriented applications using APIs, serverless, Service Fabric, Azure Functions, and Event Grid technologies.

What you will learn



  • Understand the architecture of Azure Functions and Azure Service Fabric
  • Explore Platform-as-a-Service options for deploying SQL Server in Azure
  • Create and manage Azure Storage and Azure Cosmos DB resources
  • Leverage big data storage in Azure services
  • Select Azure services to deploy according to a specific scenario
  • Set up CI/CD pipelines to deploy container applications on Azure DevOps
  • Get to grips with API gateway patterns and Azure API Management

Who this book is for



This book is for cloud developers, software architects, system administrators, database administrators, data engineers, developers, and computer science students who want to understand the role of the software architect or developer in the cloud world. Professionals looking to enhance their cloud and cloud-native programming concepts on Azure will also find this book useful. A solid background in C#, ASP.NET Core, and any recent version of Visual Studio and basic knowledge of cloud computing, Microsoft Azure, and databases will be helpful when using this book.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 258

Veröffentlichungsjahr: 2023

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



A Developer’s Guide to Building Resilient Cloud Applications with Azure

Deploy applications on serverless and event-driven architecture using a cloud database

Hamida Rebai Trabelsi

BIRMINGHAM—MUMBAI

A Developer’s Guide to Building Resilient Cloud Applications with Azure

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Rahul Nair

Publishing Product Manager: Surbhi Suman

Senior Editor: Divya Vijayan/Romy Dias

Technical Editor: Arjun Varma

Copy Editor: Safis Editing

Project Coordinator: Ashwin Kharwa

Proofreader: Safis Editing

Indexer: Hemangini Bari

Production Designer: Aparna Bhagat

Marketing Coordinator: Nimisha Dua

First published: January 2023

Production reference: 1250123

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80461-171-5

https://www.packtpub.com

To my mother, Rafika Boukari, and to the memory of my father, Mongi Rebai, for their sacrifices, their blessings, and the constant support that they have given to me. To my husband, Mohamed Trabelsi, for supporting me during my writing journey. To my son, Rayen Trabelsi, and my baby daughter, Eya Trabelsi, for their smiles every day, which always keep me motivated.

Foreword

On March 11, 2020, the World Health Organization officially declared a pandemic amid a global COVID-19 outbreak. As the world went into lockdown, it was imperative that businesses pivot and leverage innovative ways to continue their operations. We witnessed organizations employing creative techniques across a variety of industries. Many retail businesses provided online ordering and curbside pick-up when they were required to close their doors or limit the number of customers in-store.

When grocery store shelves were barren and struggling to restock, restaurants also leveraged their direct suppliers to offer grocery kits including produce, dairy, and raw meats to their customers. Fitness studios offered online virtual classes to keep their members active and engaged. Doctors provided online virtual appointments for their patients. Offices that traditionally required employees to be on-site transitioned to enable remote work using collaboration tools such as Microsoft Teams. What did they all have in common? They leveraged cloud services.

In his first earnings call during the pandemic, Satya Nadella, CEO of Microsoft, stated, “We’ve seen two years of digital transformation in two months.” Enabling remote work, accelerating the digital transformation to the cloud, and building innovative solutions allowed organizations to not only survive but also thrive.

Three years later, the world has slowly gone back to a new normal – a hybrid world partaking in experiences online as well as in person. Yet, organizations are not slowing down. They are accelerating their digital transformation and application modernization initiatives. Gartner predicts that cloud spending will continue to increase through to 2025, with enterprise organizations continuing to invest in their shift to the cloud. I see this firsthand in my day-to-day work in leading a team of cloud solution architects that helps organizations to modernize and innovate in Azure.

What does this mean for you, whether you’re an architect, developer, student, or aspiring technologist? As the demand for cloud-native skills continues to grow, now is the time to learn these crucial development skills, or risk getting left behind. A simple search for “cloud native” jobs on LinkedIn yields thousands of results. This is an in-demand skill that serves as a career accelerator. You have taken the first step by buying Hamida’s book, which is a wise investment on your part.

Hamida draws on years of experience in developing cloud-native solutions in Azure and has distilled her expertise for you here. This is a comprehensive resource that goes beyond the question “what is cloud-native application development?” This is not another book on containers and orchestration services. Hamida provides you with the “how-to.” She delivers the roadmap to build an end-to-end cloud-native application, from development to deployment.

You will walk away ready to put into practice everything that you learn within these pages. You will gain a deeper understanding of which cloud service to use, why, and how it all comes together to create and deploy a scalable, reliable, highly available application.

Good luck on your journey!

Lori Lalonde

Senior cloud solution architect manager, Microsoft

Contributors

About the author

Hamida Rebai Trabelsi has been working in the computing domain for over 12 years. She started her professional career in Tunisia working for multinational corporations (MNCs) as a software developer, then served as a .NET consultant at CGI, Canada. She is currently a senior advisor and information and solution integration architect at Revenu Québec, Canada. She has been awarded as Most Valuable Professional in Developer Technologies and Microsoft DevHeros by Microsoft and holds several Azure certifications. Besides being a Microsoft Certified Trainer and a member of the .NET Foundation, Hamida is a blogger, an international speaker, and one of the finalists in the Women in IT Award in Canada in 2019.

I have been overwhelmed by the support that I have received from all of the team. They encouraged me during this period, and I feel proud that I was able to finish this book and share my experience as a developer to start with Azure. To the memory of my father, Mongi Rebai, I offer this book to you and I hope that you were with me, sharing in this new adventure that is added to my professional career. Thank you to my mum, Rafika Boukari, for your sacrifices and your support. Thank you to my husband, Mohamed Trabelsi, for believing in me. Every day, I wake up and see my son, Rayen Trabelsi, and my baby girl, Eya Trabelsi, and I feel more motivated, so thank you for this energy.

About the reviewers

Ryan Mangan is a cloud and an end user computing technologist focusing on application migration and modernization. He's an international speaker on a wide range of topics, an author, and has helped customers and technical communities over the past decade. Ryan is a chartered fellow of the British Computer Society, a Microsoft Most Valuable Professional (MVP), as well as a VMware vExpert, and Very Important Parallels Professional (VIPP).

Stefano Demiliani is a Microsoft MVP in business applications, a Microsoft Certified Solution Developer (MCSD), an Azure Certified Architect, and an expert in other Microsoft-related technologies. His main activity is architecting and developing enterprise solutions based on the entire stack of Microsoft technologies (mainly focused on ERP and the cloud). He has worked with Packt Publishing on many IT books related to Azure cloud applications and Dynamics 365 Business Central and is a speaker at conferences around Europe. You can reach him on Twitter (@demiliani) or LinkedIn.

Table of Contents

Preface

Part 1: Building Cloud-Oriented Apps Using Patterns and Technologies

1

Introduction to Serverless Architecture, Event-Driven Architecture, and Cloud Databases

Understanding serverless architecture

API definition

The API life cycle

An APIs role

API types

Understanding event-driven architecture

Exploring cloud databases

Summary

Further reading

Questions

2

API Management – Import, Manage, and Publish Your First API

Technical requirements

The API Gateway pattern

Definition

Use case

Exploring the API Management service

API Management components

Products

Securing the API

Subscriptions and keys

The process of calling an API with the subscription key

Securing APIs by using certificates

Accepting client certificates in the consumption tier

Certificate authorization policies

Exercise 1 – creating a backend API and deploying APIs

Creating an API Management instance

Importing an API

Configuring the backend settings

Testing the API

Exercise 2 – using Azure API Management to proxy a public API

Importing an OpenAPI schema for proxying

Summary

3

Developing Event-Based and Message-Based Solutions

Introduction

Exploring Event Grid and Azure Event Hubs

Event Grid

Event Hubs

Exercise 1 – publishing and subscribing from a .NET app to Event Grid events

Creating an Event Grid topic

Creating a web app to deploy the Azure Event Grid viewer

Creating an Event Grid subscription

Create a .NET Console project

Making some modifications to the Program class to be able to connect to Event Grid

Publishing new events

Exploring Azure message queues

Exercise 2 – creating an Azure Service Bus namespace and a queue

Using the Azure portal

Using the Azure CLI

Exercise 3 – publishing messages to a Service Bus queue using a .NET Core application

Exercise 4 – reading messages from a Service Bus queue using a .NET Core application

Exercise 5 – sending and receiving messages to and from a topic

Creating a topic using the Azure portal

Creating a subscription to the topic

Sending messages to the topic

Summary

Question

Part 2: Connecting Your Application with Azure Databases

4

Creating and Deploying a Function App in Azure

Exploring Azure Functions

Triggers

Bindings

Order processing scenario using Azure Functions

Developing Azure functions

Azure Functions’ development

Creating an Azure Functions instance by using Visual Studio 2022

Creating an Azure Functions instance by using Visual Studio Code

Creating an Azure Functions app in the Azure portal

Developing durable functions

Introduction to durable functions

Implementing an orchestrator function

Function chaining

Fan-out, fan-in

Asynchronous HTTP APIs

Monitor pattern

Human interaction

Summary

Questions

5

Develop an Azure Service Fabric Distributed Application

Exploring Azure Service Fabric

Definition

Clusters and nodes

The differences between Service Fabric and Kubernetes

The Azure Service Fabric development environment

Exercise 1 – creating a Service Fabric cluster using the Azure portal

Exercise 2 – creating a Service Fabric cluster using the Azure CLI

Exercise 3 – scaling an Azure Service Fabric cluster

Manual scaling

Custom autoscaling

Coding your scaling

Exercise 4 – creating a .NET Service Fabric application

Creating a Service Fabric application

Deploying the application in a local cluster using Visual Studio

Exercise 5 – deploying an app to a Service Fabric managed cluster and containers

Deploying an ASP.NET Core application to Azure Service Fabric

Building and executing a Docker container in Service Fabric

Summary

Questions

6

Introduction to Application Data

An overview of data classification and data concepts

Exploring relational data concepts in Azure

Exploring non-relational data concepts in Azure

Exploring modern data warehouse analytics

Exploring data warehousing concepts

Azure data services for modern data warehouses

Getting started building with Power BI

Power BI Desktop

Summary

7

Working with Azure SQL Database

Exploring PaaS options for deploying SQL Server in Azure

Azure SQL Database

Azure SQL Managed Instance

Creating an Azure SQL Database instance

Exercise 1 – deploying a single SQL database

Exercise 2 – deploying Azure SQL Database elastic pools

Exercise 3 – deploying SQL Managed Instance

Exercise 4 – connecting Azure SQL Database to an ASP.NET app

Creating and configuring the database connection

Summary

Further reading

Questions

8

Working with Azure Storage

Azure Storage account

Exploring Azure Table Storage

Creating a table in Azure Table Storage in the Azure portal

Exploring Azure Blob Storage

Azure Blob Storage client library for .NET

Exploring Azure Disk Storage

Exploring Azure Files

The common uses of file storage

Adding Azure Files in the Azure portal

When to use Azure files versus blobs

Summary

Further reading

Questions

9

Working with Azure Cosmos DB to Manage Database Services

NoSQL databases

Exercise 1 – creating an Azure Cosmos DB account using the Azure portal

Exploring the Cosmos DB SQL API

Exercise 2 – creating an Azure Cosmos DB SQL API account

Adding a new database and a new container

Adding data to a database

Querying data

Exercise 3 – connecting to the Azure Cosmos DB SQL API with the SDK

Exercise 3 – connecting Azure App Service with Azure Cosmos DB

Summary

Questions

10

Big Data Storage Overview

Exploring Azure Data Lake Storage

Creating an Azure Data Lake instance using the Azure portal

Creating an Azure Data Lake instance using the Azure CLI

Exploring Azure Data Factory

ADF components

Creating an ADF using the Azure portal

Exploring Azure Databricks

Azure Synapse Analytics

Azure Databricks features

Azure Databricks components

Creating an Azure Databricks workspace

Exploring Azure Synapse Analytics

Exploring Azure Analysis Services

Summary

Further reading

Questions

Part 3: Ensuring Continuous Integration and Continuous Container Deployment on Azure

11

Containers and Continuous Deployment on Azure

Setting up continuous deployment for Docker with Azure DevOps and Azure Container Registry

Creating the pipeline

Continuous deployment for Windows containers with Azure DevOps

Deploying to Azure Container Registry

Deploying to Azure App Service

Integrating Docker Hub with the CI/CD pipeline

Summary

Assessments

Index

Other Books You May Enjoy

Part 1: Building Cloud-Oriented Apps Using Patterns and Technologies

In this part of the book, we will introduce the serverless architecture, APIs, event-driven architecture, and the database-oriented cloud.

This part comprises the following chapters:

Chapter 1, Introduction to Serverless Architecture, Event-Driven Architecture, and Cloud DatabasesChapter 2, API Management – Import, Manage, and Publish Your First APIChapter 3, Developing Event-Based and Message-Based Solutions

1

Introduction to Serverless Architecture, Event-Driven Architecture, and Cloud Databases

This first chapter introduces the book’s content, which includes the modernization of apps using application programming interfaces (APIs), event-driven architecture, functions, and Service Fabric, and connecting them with a database.

Modernization is not just reserved for companies that have been operating stable systems for years and whose data volume has evolved. Organizations want to remain profitable and not be left behind by not modernizing technology and taking advantage of changes in the market due to world-changing factors, such as Covid-19.

Modernization is about accelerating innovation and reducing costs. Modernization is not just about the app but also the data.

In this chapter, we’re going to cover the following main topics:

Understanding serverless architectureUnderstanding the role of APIs inside an application and their ecosystemUnderstanding event-driven architectureExploring cloud databases

Understanding serverless architecture

Serverless architecture is a software design pattern where applications are hosted by a third-party service, allowing developers to build and run services without having to manage the underlying infrastructure.

Applications are divided into separate functions that can be called and scaled individually.

Developers implement and deploy application-only code and can run applications, databases, and storage systems hosted in servers provisioned by cloud providers.

We will understand the role of APIs inside an application and the ecosystem. To start modernizing legacy applications without any modification, we can use APIs to interact with existing code. These APIs will run in the cloud, but if we need to add more features to the application to modernize it, we will encapsulate the data and the functions in services via an API. This encapsulation phase is a technique that consists of reusing legacy software components. The goal is to keep the code in its environment and connect it to the new presentations via encapsulation to access the different layers through an API. APIs permit you to define common protocols (rules) to expose data from an application with the possibility of decoupling the presentation layer.

Technically, the encapsulation works with wrapper technology, providing a new interface for a legacy component. This component will be easily accessible from the rest of the software components.

These minimal modifications reduce the risk of destabilizing the application. Even if encapsulation is a fast, effective, and less expensive solution, it will not solve the present problems related to the difficulties of maintenance or upgrading.

Because we are talking about the role of APIs in digital transformation and their life cycle, we need to define them.

API definition

APIs form a bridge between different applications to ensure communication and the exchange of information between them. They can even define the behavior of these applications.

APIs are considered connectors because they provide the ability for disparate applications to exchange information.

The information exchanged is generally data; for example, if we make a request in a mobile application, the data will be sent to a server that performs the reading and then sends back a response in a format readable in JSON.

Sometimes, microservices are compared with APIs. We often talk about the relationship between APIs and microservices, but there is also a difference between them. Microservices are a style of architecture that divides an application into a set of services; each service presents a very particular domain, for example, an authentication service or another service for the management of the products. On the other hand, an API is a framework (a structure that you can build software on) used by developers to provide interaction with a web application. Alternatively, microservices can use an API to provide communication between services. But how does an API work?

Applications that send requests are called clients, and applications that send responses are called servers. Using bees as an example, the hive is the client, the flower is the server, and the bee is the communication path (REST API requests).

The API life cycle

The API manager – usually the enterprise architect or API product manager – manages the API life cycle.

The API life cycle consists of the following three main phases:

The creation phase: This consists of creating and documenting the API. There are some key aspects of API creation to consider; the API will use or reuse backend resources (service or business capability implementation). These resources are typically available as RESTful services, Simple Object Access Protocol (SOAP)-based web services, or even Advanced Message Queuing Protocol (AMQP)-compliant message brokers.The control phase: This consists of applying the security policies necessary to ensure that the exchanges are secure.The consumption phase: This consists of publishing the API so that we can consume and monetize it.

After understanding the API life cycle and the different phases, we will next look at the important role of an API in terms of communication between applications.

An APIs role

A set of rules ensures the communication of APIs by defining how applications or machines can communicate, so the API is an intermediate bridge between two applications wanting to communicate with each other.

API types

A web API is an API that can be accessed via the HTTP protocol. There are many API protocols/specifications, as follows:

Open APIsPartner APIsInternal APIsComposite APIsRepresentational State Transfer (REST)SOAPExtensible Markup Language Remote Procedure Call (XML-RPC)JavaScript Object Notation Remote Procedure Call (JSON-RPC)

The most popular type of API is RESTful because it has several advantages in terms of flexibility when creating an API that meets the client’s needs and dependencies because the data is not bound to methods or resources. A RESTful API supports different data formats, such as application/json, application/xml, application/x-wbe+xml, multipart/form-data, and application/x-www-form-urlencoded.

RESTful APIs take advantage of existing protocols – for example, web APIs take advantage of the HTTP protocol.

So far, in this chapter, we have talked about encapsulation to access the different layers through an API as a technique used for legacy system modernization. We have presented the API life cycle and API roles, which encompasses several roles to ensure communication, and we have identified the API types, such as RESTful APIs, which are the most popular. In the next section, we will present the event-driven architecture used to improve agility in complex applications.

Understanding event-driven architecture

Event-driven architecture is a software architecture that uses events in order to be able to communicate between decoupled services. It is a pattern for designing applications that are loosely coupled and is used in modern applications built with microservices. When consumers are listening to an event, which could be a status change or an update, event producers are not able to know which event consumers are listening to and do not even know the consequences of its occurrence.

In an event-driven architecture, we have the following three key components:

Event producers: These generate a stream of eventsEvent routers: These manage event delivery between producers and consumersEvent consumers: These listen to the events

The following diagram illustrates these components:

Figure 1.1 – Event-driven architecture

The source of an event is triggered by internal or external inputs. They can be generated by either a user (by clicking or using keyboard input, for example), an external source (such as a sensor output), or through a system (such as loading a program).

In an event-driven architecture, we can use event streaming or a publisher/subscriber model. But what is the difference between event streaming and a publisher/subscriber model?

Publisher/subscriber model: This provides a framework that enables message exchanges between publishers and subscribers. This pattern involves the publisher and the subscriber and depends on a message broker that reroutes messages from the publisher to the subscriber.Event streaming: When a stream of events is published to a broker, the clients are able to subscribe to the stream and join at any time; they have access to them and can consume multiple preferred streams, and they are able to read from any part and advance their position. The events are always written in a log file.

Event-driven architectures are recommended to improve agility and move quickly. They are used in modern applications, mainly microservices, or in any application that includes several decoupled components. When adopting an event-driven architecture, you may need to rethink how you view your application design.



Tausende von E-Books und Hörbücher

Ihre Zahl wächst ständig und Sie haben eine Fixpreisgarantie.