Serverless Integration Design Patterns with Azure - Kumar Abhishek - E-Book

Serverless Integration Design Patterns with Azure E-Book

Kumar Abhishek

0,0
40,81 €

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

Mehr erfahren.
Beschreibung

A practical guide that helps you progress to using modern integration methods and leverage new cloud capability models




Key Features



  • Design critical hybrid integration solutions for your organization


  • Gain in-depth knowledge of how to build cloud-native integration solutions


  • Leverage cognitive services to build smart cloud solutions





Book Description



With more enterprises adapting cloud-based and API-based solutions, application integration has become more relevant and significant than ever before. Parallelly, Serverless Integration has gained popularity, as it helps agile organizations to build integration solutions quickly without having to worry about infrastructure costs. With Microsoft Azure's serverless offerings, such as Logic Apps, Azure Functions, API Management, Azure Event Grid and Service Bus, organizations can build powerful, secure, and scalable integration solutions with ease.






The primary objective of this book is to help you to understand various serverless offerings included within Azure Integration Services, taking you through the basics and industry practices and patterns. This book starts by explaining the concepts of services such as Azure Functions, Logic Apps, and Service Bus with hands-on examples and use cases. After getting to grips with the basics, you will be introduced to API Management and building B2B solutions using Logic Apps Enterprise Integration Pack.






This book will help readers to understand building hybrid integration solutions and touches upon Microsoft Cognitive Services and leveraging them in modern integration solutions. Industry practices and patterns are brought to light at appropriate opportunities while explaining various concepts.





What you will learn



  • Learn about the design principles of Microsoft Azure Serverless Integration


  • Get insights into Azure Functions, Logic Apps, Azure Event Grid and Service Bus


  • Secure and manage your integration endpoints using Azure API Management


  • Build advanced B2B solutions using Logic Apps, Enterprise Integration Pack


  • Monitor integration solutions using tools available on the market


  • Discover design patterns for hybrid integration





Who this book is for



Serverless Integration Design Patterns with Azure is for you if you are a solution architect or integration professional aiming to build complex cloud solutions for your organization. Developers looking to build next-level hybrid or cloud solutions will also find this book useful. Prior programming knowledge is necessary.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 374

Veröffentlichungsjahr: 2019

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.



Serverless Integration Design Patterns with Azure

 

 

 

 

 

 

 

Build powerful cloud solutions that sustain next-generation products

 

 

 

 

 

 

 

 

 

 

Abhishek Kumar
Srinivasa Mahendrakar

 

 

 

 

 

 

 

 

 

BIRMINGHAM - MUMBAI

Serverless Integration Design Patterns with Azure

Copyright © 2019 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 authors, 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.

 

Commissioning Editor: Vijin BorichaAcquisition Editor: Prachi BishtContent Development Editor: Roshan KumarTechnical Editor: Snehal DalmetCopy Editor: Safis EditingLanguage Support Editor: Mary McGowan, Storm MannProject Coordinator: Namrata SwettaProofreader: Safis EditingIndexer: Priyanka DhadkeGraphics: Jisha ChirayilProduction Coordinator: Saili Kale

First published: February 2019

Production reference: 1120219

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

ISBN 978-1-78839-923-4

www.packtpub.com

 
mapt.io

Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.

Why subscribe?

Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Mapt is fully searchable

Copy and paste, print, and bookmark content

Packt.com

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. 

Contributors

About the authors

Abhishek Kumar works with New Zealand Trade and Enterprise as an integration and data specialist. He is a Microsoft Azure MVP with deep expertise in software development and design. He is a co-author of Robust Cloud Integration and a seasoned contributor to Microsoft blogs, forums, and events. As a technological evangelist, he is specialized in cloud-based technologies such as Azure Functions, Microsoft Graph, Logic Apps, Web API, and Cosmos DB, along with various Software-as-a-Service (SaaS) such as Salesforce, Office 365, and ServiceNow. As a technology advocate, he promotes loosely coupled solution design along with event-based programming.

 

 

 

Srinivasa Mahendrakar has more than 13 years' experience in the IT industry in building applications and data integration solutions using Microsoft technologies including BizTalk, SSIS, Azure Integration Services, and Azure Functions. His career roles included developer, technical lead, solution architect, and product owner, and he has been involved in building highly regarded solutions in industries such as finance, healthcare, retail, energy, and utilities. For the past three years, he has been working at BizTalk360, to build tools for modern integration solutions. Currently, he is a product director, heading up the Atomic Scope product team. He has also hosted Integration Monday and Global Integration Boot camp sessions.

 

About the reviewers

Lex Hegt lives with his wife Odette and two kids, Denise and Casper, near The Hague in the Netherlands. His first steps in IT date back to the mid-1980s; in 2004, he started with Microsoft Integration. Lex has worked at consultancy companies such as Ordina and Axon Olympus (now Codit NL), and all his assignments shaped him into an experienced BizTalk administrator, developer, and trainer. In 2016, Lex joined BizTalk360 as a Technical Lead for the BizTalk360 and Atomic Scope products. He also runs the Integration Monday community initiative and some community-oriented newsletters. In his spare time, Lex enjoys spending time with his family, listening to music, playing piano, goal-keeping at field hockey, and dining with good company.

 

 

 

Wagner Silveira is the Principal Integration Architect at Theta. Originally from Brazil, he started his IT career as a class-led instructor of Microsoft products, coming to New Zealand in 2002, where he has been working on Microsoft Integration Technologies ever since, using the Microsoft stack and technologies such as BizTalk Server, Azure Integration Services, and Azure Function to create award-winning solutions. Wagner is one of the organizers of the Auckland Connected Systems User Group (ACSUG) and Integration Downunder webcast, and member of the Global Integration Bootcamp board, helping to organize the event across the globe and in New Zealand.

 

 

 

Mayank Sharma is Senior Program Manager for Azure Commerce and Ecosystems at Microsoft, Redmond, with more than 15 years of industry experience. He has been with Microsoft for 5 years, worked as Project Manager for Azure Integration Services, PaaS offering integration landscape, partnering with Azure Logic Apps group. Earlier, he worked on Microsoft’s platform modernization programs, focused around cloud adoption, Hybrid integration patterns, and migration tools. Being a passionate presenter, he has also shares Microsoft’s integration case study at various conferences and events around the world. He also worked with other industry leaders including Accenture, HCL Technologies, and Fidelity, on various business transformation programs.

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.

Table of Contents

Title Page

Copyright and Credits

Serverless Integration Design Patterns with Azure

About Packt

Why subscribe?

Packt.com

Contributors

About the authors

About the reviewers

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Serverless Integration with Microsoft Azure

Introduction to serverless in the cloud

Benefits and disadvantages of serverless architecture

Azure Integration Services

Azure Logic Apps – cloud workflow engine

Azure Service Bus – cloud messaging service

Azure API Management – API gateway

Azure Functions 

Azure Event Grid – event-handling platform

Summary

Azure Functions and Enterprise Integration

Azure Functions hosting architecture

Sample Azure Function

Prerequisites for using Visual Studio

Creating dependent Azure services

Step 1 – Creating a Service Bus queue

Step 2 – Creating a Cosmos DB account and a collection

Step 3 – Creating a storage account

Creating a function app project

Creating a function

Running and debugging functions locally

Publishing Azure Functions

Understanding the components of an Azure Function

Application host file (host.json)

Application settings (local.settings.json)

Function triggers

Function bindings

Sample scenario continued

Installing the NuGet package for the Cosmos DB WebJobs extension

Adding input bindings to Inventory DB

Adding output bindings for the orders collection

Running the end-to-end sample scenario

Azure Function use cases

Important considerations when building Azure Functions

Securing application settings with Azure Key Vault

Service plan versus consumption plan

Using deployment slots

Leveraging Application Insights for monitoring

Function proxies

Durable Functions

Function chaining

Fan-out or fan-in

Async HTTP APIs

Monitoring

Human interaction

Creating a sample durable function

Installing a durable task package

Summary

Introduction to Azure Event Grid

Eventing or messaging for enterprise solutions

Characteristics of events and eventing

Event sources and event handlers

Event sources

Foreground events

Background events

Event handlers

Azure Event Grid topics

Azure Event Grid security and authentication

Webhook event delivery

Event delivery security

Event subscriptions

Publishing events through custom topics

Key authentication with code

Azure Event Grid management access control

Azure Event Grid message delivery retry and event filtering

Dead-letter events with Azure Event Grid

Event delivery status codes

Event filtering through Azure Event Grid subscription

Event type filtering

Subject filtering

Advanced filtering

Example 1 – storage events and Logic Apps single event listener

Example 2 – custom Azure Event Grid topic and event broadcast

Azure Event Grid domain for enterprise integration

Summary

Azure API Management

The API Management platform

The Azure APIM platform

API gateway

The publisher portal

The developer portal

API products

Authorization groups

Policies

Policy scopes

Logistical company ShipAnyWhere – case study

The product service

The order fulfillment service

The purchase order service

ShipAnyWhere digital transformation

Creating an APIM service

Creating REST endpoints for the ShipAnyWhere product service

Existing ShipAnyWhere service

Importing WSDL

Testing the GetProducts service method

The developer portal

APIM policies

Inbound policies

The rewrite-uri policy

The set-header policy

The set-body policy

Backend policies

Outbound policies

The control flow policy

The XML-to-JSON policy

The cross-original resource sharing (CORS) policy

Creating a SOAP pass through an API 

Creating purchase order APIs with Logic Apps and Azure Functions

Handling large messages in hybrid integration scenarios

Versioning and production testing Logic Apps

Summary

Azure Service Bus with Integration Services

Azure Service Bus use cases

Creating a Service Bus namespace

Creating a Service Bus namespace in the Azure portal

Service Bus tiers

Azure Service Bus technology offerings

Azure Service Bus architecture

Messaging with Service Bus

Message size

Message headers and properties

Service Bus queues and descriptions

Queue naming convention

Retrieving messages from a queue

Dead-lettering of Service Bus messages

Deferred message processing in Azure Service Bus

Security with an Azure Service Bus namespace

SAS authentication

Azure Service Bus topics

Subscription rules

Example 1 – Working with priority queues in Azure Service Bus

Example 2 – Working with API Management and Service Bus

Example 3 – Content-based routing based on message properties

Summary

Introduction to Logic Apps

The components of Azure Logic Apps

An overview of triggers

Recurrence triggers

HTTP triggers

Request triggers

Webhook triggers

Actions in Logic Apps

Parameters in the Logic Apps workflow template

Outputs in the Logic Apps workflow template

Example 1 – Debatching in Logic Apps with the splitOn property and Azure Functions change feed with Cosmos DB

Example 2 – Concurrency control and singleton patterns in Logic Apps with schema validation

Summary

Control Flow Actions and Custom Connectors

Logic Apps control flow actions

Conditional actions

Parallel actions

Switch control flow

Foreach action

Scope action

Do…until action

Terminate action

The workflow expression language and content types

Workflow and action tracking

Custom connectors and Cosmos graph databases

Summary

Patterns with Azure Integration Services

Azure Functions and Logic Apps

Example 1 – The batching or aggregator pattern in Logic Apps

Example 2 – Asynchronous patterns for long-running APIs

The polling pattern

The webhook pattern

Example 3 – Messages with API Management, Event Grid, Logic App, and Azure Functions

Example 4 – Session Management with Logic Apps and Service Bus

Summary

B2B/EDI Solutions for Enterprise Integration with Azure Logic Apps

Enterprise integration pack

B2B scenario

Creating integration accounts

Uploading certificates to Azure Key Vault

Creating certificates

Creating a key vault service in each resource group

Uploading the private key certificates to the key vaults

Adding certificates to an integration account

Uploading schemas and maps

Creating partners in an integration account

Creating AS2 agreements

Creating AS2 agreements in Contoso

Creating an AS2 agreement for ShipAnyWhere

Creating an X12 agreement

Creating the ContosoSendOrder Logic App

The Logic Apps B2B solution

Creating a workspace and adding the B2B solution

Associating the Log Analytics workspace with an integration account

Handling EDI batches

The ShipAnyWhereBatchReceiver Logic App

The SendX12TransactionToBatcher Logic App

Testing the scenario

B2B disaster recovery

X12/EDIFACT control ID replication Logic Apps

AS2 Message Integrity Check (MIC) replication Logic App

Summary

Hybrid Integration, BizTalk Server 2016 and an On-Premises Data Gateway

Introduction to hybrid integration

Why hybrid integration?

Introduction to the on-premises data gateway

 On-premises Data Gateway Architecture

Enabling Hybrid Integration with Microsoft BizTalk Server 2016

Azure Service Bus Relay

The Service Bus (SB) – Messaging adapter

The Logic Apps adapter

Comparison matrix

Installing and configuring Logic Apps adapters in BizTalk Server 2016

Connecting BizTalk Server 2016 with Azure Logic Apps

Step 1 – Creating Logic Apps for Cognitive Services

Step 2 – Typed polling with the WCF adapter

Connecting to a SQL database

Creating a two-way send port for Logic Apps

Connecting Azure Logic Apps with BizTalk Server 2016

IIS configuration for Logic App adapters

Consuming the WCF service in BizTalk 2016

Summary

Intelligence in Integration Using Azure Cognitive Services

AI

Machine learning

Neural network

Machine learning and digital transformation

Microsoft and the democratization of AI

The Microsoft AI platform

Azure AI

Cognitive Services APIs

Conversational services

Data Science Virtual Machine (DSVM)

Comprehensive platform and tools

Intelligence in serverless integration

Computer Vision APIs

The Analyze Image API

Optical character recognition (OCR) to JSON

Face API

Text Analytics APIs

Language understanding APIs

Natural language model

Case study – ShipAnywhere feedback analysis

Provisioning the Text Analytics API service instance

Noting down the connection name and key

Creating logic apps

Summary

DevOps for Azure Integration

Benefits of DevOps

DevOps for integration

Naming convention of integration artifacts

ARM templates

Creating an ARM template using Visual Studio

Azure Event Grid and DevOps

Azure API Management and DevOps with Git version control

Azure Functions with DevOps

Azure Function continuous integration and deployment

Logic Apps continuous integration and deployment with DevOps

Summary

Monitoring for Azure Integration

Types of monitoring

Manual monitoring

Automated monitoring

Different types of monitoring

Availability monitoring

Health monitoring

Performance monitoring

Threshold monitoring

Sending notifications of issues or events

Benefits of monitoring

Improving availability

Business insights

Usage trends for upscaling and downscaling

Identifying performance bottlenecks

Azure integration service monitoring

Azure Logic Apps monitoring with the Azure portal and Azure log analytics

Logic App runs and trigger history

Logic Apps notifications and alerts

Azure Log Analytics and Logic Apps

Azure Functions monitoring with Application Insights

Application Insights configuration for a new function app

Manually connecting an Application Insights resource to your function app

Monitoring functions with Application Insights

Azure API Management monitoring with Application Insights

Azure Service Bus monitoring with Serverless360

Serverless360 monitoring features

Threshold violation alarms

Health check alarms

Data monitoring

Managing composite serverless applications in Serverless360

Associating an Azure subscription

Creating a composite serverless application

Adding Azure serverless components to the application

Setting up monitoring in Serverless360

Creating an alarm

Mapping artifacts to the alarm

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

Preface

With the surge in cloud adoption, serverless integration has gained popularity, as have Microsoft Azure's offerings, such as Azure Logic Apps, Functions, API Management, Event Grid, and Service Bus. These serverless platforms allow enterprises to build powerful, secure, and scalable integration solutions in the cloud. The primary goal of Serverless Integration Design Patterns with Azure is to teach you how to work with enterprise design patterns, and how to connect services and platforms hosted in the cloud or on premises.

This book builds your understanding of Azure Integration Services by providing you with hands-on labs to test and improve your skills and knowledge of cloud integration and the different connecting platforms in Azure. As well as Azure, you'll also learn about the Microsoft Cloud Platform Integration Framework, along with various other architecture design principles that can be applied when connecting systems.

Who this book is for

Serverless Integration Design Patterns with Azure is intended for solution architects and integration professionals aiming to build complex cloud solutions and next-generation integration patterns using the Microsoft Azure platform. This books covers cloud and hybrid integration patterns using serverless platforms such as Logic Apps, Azure Functions, API Management, Event Grid, and Service Bus.

What this book covers

Chapter 1, Serverless Integration with Microsoft Azure, provides an overview of Azure Integration Services and what this means for organizations in terms of their digital transformation roadmap. This chapter introduces serverless platforms and outlines the key advantages and benefits for organization moving their enterprise IT workload's into the cloud. We have also given brief introduction to Integration  services, such as Logic Apps, API Management, Service Bus, Event Grid, and Azure Functions.

Chapter 2, Azure Functions and Enterprise Integration, looks at Azure Functions. They are the linchpin in Azure's serverless offerings. With a range of triggers and bindings available, developers will see how quick and easy it is to spin up Azure Functions for given problems or APIs. Microsoft has made it possible for users to either use the Azure portal, Visual Studio, or Visual Studio Code for development.

Chapter 3, Introduction to Azure Event Grid, closely examines the capabilities of Azure Event Grid and considers how we can utilize Event Grid features in a modern integration framework. We cover multiple routing options with Event Grid and experiment with a few sample exercises for Event Grid topics and domains.

Chapter 4, Azure API Management, looks at how Azure API Management fits into the overall enterprise application landscape and can help to secure APIs and Logic Apps.

Chapter 5, Azure Service Bus with Integration Services, introduces Azure Service Bus and explains how we can use code, along with Logic Apps and Azure Functions bindings, to create an integration layer in Microsoft Azure. We also cover some design patterns, focusing on parameters and priority queues.

Chapter 6, Introduction to Logic Apps, introduces Logic Apps and demonstrates applications of the different types of triggers and actions that are available through the designer and code views. You'll learn how to implement some complex design patterns with Logic Apps and associated software and services. This chapter has also highlights aspects of the Cosmos graph database.

Chapter 7, Control Flow Actions and Custom Connectors, discusses the different  control flow actions available  in Logic Apps to create robust workflows to connect disparate systems. You'll learn how to write with the Logic Apps expression language, using Logic Apps designer and with  code editor. Finally, we discuss how you can leverage your existing API as a custom connector in Logic Apps, and how to build your own custom connector for Logic Apps.

Chapter 8, Patterns with Azure Integration Services, covers how you can perform exception handling in Logic Apps, along with multiple design patterns such as sequential message flow, webhooks for event-based architecture patterns, and simple batching with Logic Apps.

Chapter 9, B2B/EDI Solutions for Enterprise Integration with Azure Logic Apps, explains how creating B2B flows is easy when using Logic Apps and an integration account. In the world of Microsoft integration, customers are slowly but steadily moving from BizTalk-based on-premises integrations to Logic Apps-based integrations. EDI/AS2-based integrations are moving fastest to the cloud out of all integrations out there.

Chapter 10, Hybrid Integration Using BizTalk Server 2016 and an On-Premises Data Gateway, explores the capabilities of Logic Apps and how they can be applied to typical hybrid integration scenarios using Logic Apps adapters. Logic Apps provide connectivity to on-premises applications. We have shown how we can connect on-premises BizTalk and a wide variety of services, such as SQL and WCF services, hosted within corporate networks with no access to the cloud.

Chapter 11, Intelligence in Integration Using Azure Cognitive Services, explains terminology related to artificial intelligence, machine learning, and neural networks. We look at Microsoft and the democratization of AI, the Microsoft AI platform, and applications of AI in serverless integration. We also examine a case study on sentiment analysis.

Chapter 12, DevOps for Azure Integration, considers DevOps practices in Azure Integration. We list why DevOps processes are necessary for modern integration, along with how you can automate Azure Integration Services using a DevOps pipeline.

Chapter 13, Monitoring for Azure Integration, discusses enabling monitoring for Azure Integration Services. We walk through the process of enabling monitoring for Logic Apps, API Management, Azure Functions, and Service Bus. In this chapter, we also cover how you can use a third-party product, Serverless360, to effectively monitor the messaging layer for your entire enterprise.

To get the most out of this book

To get the most out of this book, we assume that you have the prerequisite knowledge of Visual Studio and Visual Studio Code, along with prior programming experience with C# and JSON.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

Log in or register at

www.packt.com

.

Select the

SUPPORT

tab.

Click on

Code Downloads & Errata

.

Enter the name of the book in the

Search

box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR/7-Zip for Windows

Zipeg/iZip/UnRarX for Mac

7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Serverless-Integration-Design-patterns-with-Azure. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781788399234_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

[CosmosDB(databaseName:"Sales", collectionName:"Orders", ConnectionStringSetting ="dbConnectionString")] IAsyncCollector<PurchaseOrder> writeResultsToCosmos

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

[CosmosDB(databaseName:"Sales", collectionName:"Orders", ConnectionStringSetting ="dbConnectionString")]

IAsyncCollector<PurchaseOrder> writeResultsToCosmos

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

Serverless Integration with Microsoft Azure

In the current era of cloud adoption, enterprises are heavily investing in new platforms, services, and frameworks. They are also moving closer to a customer-focused approach with new offerings to new customers in a geographically extended customer base. Gone are the days of queuing outside of shops in order to get a new device or standing in line to perform a single bank transaction. With new business models and technological innovation, everything is now available at our fingertips. We have witnessed this with the rise of endless online platforms such as LinkedIn, Netflix, Google, Facebook, and Twitter.

This book will explain how integration has changed across different industries, with more cloud adoption and innovation occurring in the software sector. Throughout this book, we will use step-by-step processes to explain key integration concepts, and each chapter will dive into the details of the individual service components of the Microsoft Azure Integration stack. Whether you are new to integration or are experienced in the integration field, each chapter will provide you with valuable technical information that can be implemented within your enterprise solutions.

As the title suggests, this chapter will give a basic overview of Microsoft Azure Integration Services and how it has evolved from being an on-premises integration stack to a cloud-first integration framework. So, fasten your seatbelt and join us on this great journey of integration!

In this chapter, we will cover the following topics:

Introduction to serverless platforms

Advantages and disadvantages of serverless architecture

Introduction to Azure Integration Services 

Components of Azure Integration Services 

Introduction to serverless in the cloud

You might have heard the buzzword serverless previously, perhaps through your colleagues or cloud advocate. You must have wondered what this means for your enterprise or for you as developer, architect, or DevOps associate. However, do not get confused by the word serverless; it does not refer to the process of running your code without servers.

For an enterprise, serverless actually means managing the enterprise's IT workload in cloud without having to make vast investments in setting up an infrastructure to run products and services. For new and existing organizations, a serverless platform means that an enterprise need only be billed for consumed resources.

For developers, serverless means writing efficient code that makes the most of the resources available. Cloud computing has evolved over time, and we need to appreciate this when making applications for the cloud. The following diagram describes the journey of cloud computing:

Throughout this journey, Microsoft has invested heavily in making its infrastructure more suited to customer requirements in a much more efficient manner. With Azure, Microsoft's own cloud service, there are numerous platforms and services that let you get started without having to consider the internal infrastructure and any starting costs. These platforms include Azure Functions, Logic Apps, Cosmos DB, Data Factory, API Management, and many more. In this book, we will concentrate on Microsoft's serverless integration stack and how you can take advantage of these serverless platforms in the real world.

Benefits and disadvantages of serverless architecture

In this section, we will discuss the advantages and disadvantages of having a serverless environment in your organization. As the name suggests, a serverless environment provides you with abstraction from operating systems, servers, and infrastructure. This comes with its own set of advantages and disadvantages. For example, if you are using Function as Service (FaaS) or an integration workflow, you only need to concern yourself with development implementation rather than with procurement of hardware and the building of infrastructure to run functions or integration workflows. This allows an organization to concentrate more on business requirements and innovation in the sector, rather than external factors such as infrastructure setup, firewalls, hardware procurement, and networking.

The following diagram is a representation of a serverless FaaS environment in the cloud, where auto scaling is catered for through multiple execution runtime environments:

As there are multiple layers to this discussion, let's discuss how you and your organization benefit from a serverless application architecture:

Event-driven architecture

: As we move closer to a serverless architecture, we also move closer to reactive asynchronous design patterns. For example, think of your application reacting to an event of your choice instead of polling for all events and then filtering for the required data. This has huge benefits for your organization in terms of the optimization of available resources and minimizing the overall application running cost in the cloud. 

Language of your choice

: Organizations often struggle to find the right set of development resources that work for their business requirements. You might be a .NET developer or Node.js expert; these serverless platforms provide us with a platform in which language and framework are not constraints and you can write your own code with the language of your choice. This is one of the amazing benefits of utilizing serverless environments for your organization.

Microbilling

: A business cares about expenditure and innovation. When you think about a business owner's prospective costs, optimization is one of the biggest challenges in today's world. Most cloud vendors have worked through this challenge to provide better experiences to businesses by introducing a consumption-based pricing model. As more and more organizations are moving to the cloud, there has been a huge reduction in consumption across all cloud vendors. This helps 

cloud vendors

to maximize their resource utilization.

Scale on demand

: Serverless environments are highly flexible in terms of scaling. As each serverless platform runs on a separate container, it is easy for cloud vendors to scale services as per demand. With auto scaling enabled, we need only worry about the best implementation of our applications and software, rather than about making applications to suit infrastructural requirements.

Geolocation

: Most serverless platforms can run across multiple regions. This is another key advantage when moving to the cloud. With geolocation features, businesses can meet customer requirements across different regions the world over without experiencing any latency or user experience problems.

Better monitoring and priorities

: With great monitoring capabilities in serverless environments, the DevOps team can now concentrate more on best practices for application development, deployment, and innovation, rather than spending endless nights supporting the infrastructure. This has benefited organizations in remaining competitive against market changes and innovation in their respective sectors.

We just covered some of the benefits of serverless environments – those were just a few of the many that there are. Now, let's discuss some disadvantages of serverless platforms:

Vendor-specific resources

: Most serverless platforms are managed and controlled by specified cloud vendors. This has potential drawbacks if you think of moving your resources to different hosting platforms or different cloud vendors. When using serverless platforms, you are locked into a specific implementation design that may not allow for your organization's flexibility requirements, and there may also be compatibility issues regarding business regions and changing pricing models.

Governance

: Most serverless platforms provide you with frameworks with easy startup, but there is a potential drawback to this. If you do not follow the right practices from the start, then you can put your business at risk. An example of this would be storing your database connection in your configuration file rather than using secure configuration storage or not implementing security for your outbound APIs. Though these are considered best practices, sometimes teams tend to move toward unsecured architecture patterns to meet business requirements.

Monitoring across different cloud platforms

: If your organization uses multiple cloud platforms, then each vendor will likely have a different set of monitoring implementations. This drawback means it can be harder for enterprises to maintain cross-cloud platform resources.

Infrastructure insights

: With serverless solution patterns, you can lose insights into the overall infrastructure setup. To

gain 

maximum resource utilization, most cloud vendors share resources across multiple application implementations. This has the potential drawback of you not being aware of neighboring systems or encountering application noise, which might hinder the performance of your application.

So, we have given you a glimpse of the pros and cons of serverless environments. These are what you need to consider when you port your new services to serverless environments. In the following sections, we will concentrate on Microsoft's serverless offerings, discussing their concepts before moving on to their implementation logic.

Azure Integration Services

In the current era of digital transformation and cloud-first strategy, organizations host their applications both in the cloud and in on-premises environments in a hybrid model. These organizations often struggle to find the right platform to connect these disparate systems.

To address this problem, Microsoft has heavily invested in building an integration framework to run in Azure; it is called Azure Integration Services. Azure Integration Services comprises a set of different services and platforms in Azure, such as Azure Logic Apps, Service Bus, Azure Event Grid, and API Management. Taking the capabilities and power of multiple serverless platforms, Azure Integration Services now serves a variety of customer sectors, ranging from healthcare and the automobile industry to governmental organizations and insurance companies.

Before we dive into a detailed explanation, let's understand what Azure Integration Services is and why you should bother with it. As we've already explained, Azure Integration Services is an umbrella for a number of Azure serverless integration platforms, and you will be surprised at how well these offerings work in harmony; for instance, by how well Azure Functions integrates with Azure Logic Apps to improve an organization's workflow. In the coming chapters, we'll get into more detail about all this, but for now, we'll just concentrate on familiarizing ourselves with the basics of these individual offerings, including what they are and a bit about how they work together to form a cloud-first integration solution.

Granular integration design and microservice patterns have changed the face of modern integration. Now, modern integration is not about learning a specific platform or mastering a product, but is more about getting the best out of connecting platforms. For example, if you want to automate your business workflow, then you can use Azure Logic Apps to build workflows in the cloud by utilizing a reactive programming model along with Azure Event Grid capabilities. Another example might be securing your external-facing endpoint. In that case, API Management is for you. If this confuses you, do not worry; we will learn all of these techniques and best practices throughout this book.

The following diagram describes what you are going to master in this book. We also urge you to go through the Microsoft Azure Integration Services whitepaper at https://azure.microsoft.com/en-au/resources/azure-integration-services/en-us/:

Since we have now looked at an overview of Azure Integration Services, let's discuss the individual offerings separately. We will start with AzureLogic Appsand then move on to other services such as API Management,Service Bus,Azure Functions, andAzureEvent Grid.

If you are already familiar with integration frameworks in the cloud, then we urge you to read these about services' individual capabilities in this chapter. This will help you to get a broader overview of the different platforms and services available within the Azure Integration Services umbrella for connecting enterprise-wide applications with better design patterns.

Azure Logic Apps – cloud workflow engine

Azure Logic Apps is part of the Azure Integration Services family and is an integration workflow engine in the cloud. With Azure Logic Apps, you can get started in no time and automate your workflows as required. With Azure Logic Apps, you can build highly scalable workflows in the cloud by taking advantage of more than 200 connectors (more than 200 were available at the time of writing):

Logic Apps works natively in a serverless fashion. What this means is that, like other serverless platforms, Logic Apps is also highly extensible in terms of micro-billing, scaling on demand, no infrastructure cost, a high level of monitoring, and the ability to bring your own APIs into Logic Apps and use it as a standard connector for building your integration solution. 

Organizations are also reaping the benefits of flexible pricing models for Logic Apps. With Logic Apps, you are only charged for your usage (consumption-based pricing model); alternatively, you can opt for the Integration Service Environment (ISE) and pay a fixed price for your enterprise integration environment. ISE is a great step toward running an enterprise integration environment within a client's own virtual network, while still enjoying all the benefits of the cloud. We will learn more about ISE capabilities in later chapters.

Azure Service Bus – cloud messaging service

Azure Service Bus is a multi-tenant, cloud-based service that sends and receives information between application and services. It is the oldest and most widely used member of Azure Integration Services.

As Azure Service Bus promotes asynchronous programming and works in a publish-subscribe model, various enterprises use its capability for message routing to provide decoupling for their existing solution. Azure Service Bus has grown over the years, experiencing success stories and supporting multiple languages for developers. With Azure Service Bus, you can either use queues for First-In-First-Out (FIFO) messaging or use topics to work with a publish-subscribe model.

Some of the languages that are supported for sending and receiving messages from a Service Bus queue are listed here:

.NET 

Java

Node.js

Python

Ruby

The Azure portal

The Azure CLI

Azure PowerShell

The following list notes the languages supported for communication with Service Bus topics/subscriptions:

.NET 

Java

Node.js

PHP

Python

Ruby

The Azure portal

The Azure CLI

Azure PowerShell

Azure API Management – API gateway

Azure API Management is a Platform-as-a-Service (PaaS) framework for publishing an organization's internal and external APIs. With Azure API Management, you can secure your internal or external APIs, or compose your own API that talks to your backend system to cater to the needs of client applications.

Like other serverless platforms, API Management also comes with a variety of pricing models. For example, you can run an instance of API Management with a consumption plan, or you can pay a fixed price to utilize services in both the standard and premium plans. You can integrate API Management as part of your ISE:

People are often confused by the role of API Management. API Management is not only the façade layer preceding your APIs, but also a security door to your enterprise data. A better solution design should also cater to the security aspect of talking to internal or external services.

We have seen stories where organizations continue creating a plethora of APIs to connect their internal or external business partners, without paying much attention to security, content-type handling, caching, and so on. Often, these service behaviors are managed on an individual basis, which is not suited to a highly scalable infrastructure.

In Chapter 4, Azure API Management, we will discuss these aspects in more detail, along with industry best practices, so that you can get the most out of your investment and make your organization more agile and secure.

Azure Functions 

Azure Functions embraces a code-first approach to developing enterprise-grade solutions in Azure. Like other serverless platforms, Azure Functions is a powerful framework available in Microsoft Azure, where you can run your code on demand and pay only for your resource consumption.

The Azure Functions runtime supports multiple languages. When developing custom code for integration, developers can use the language of their choice, such as .NET, Node.js, Java, PowerShell, and more. When it comes to hosting, you can host your Azure Functions in any environment, such as Kubernetes, Windows, or a Linux environment. With various available application bindings, Azure Functions also follow a reactive programming model and can be used in a plethora of use cases. On the development front, you can either use the Azure portal to develop your Azure Function, or you can embrace development environments such as Microsoft Visual Studio or Visual Studio Code:

You can combine the workflow capabilities of Logic Apps and the code-first execution of Azure Functions to develop enterprise-grade integration solutions without worrying about the infrastructure implementation. Alternatively, you can develop your lightweight API though Azure Functions and leverage the capabilities of API Management to expose your API to the outside world.

When you have a huge workload running on an Azure Functions runtime, you can concern yourself with latency rather than changing your design patterns. There are also various pricing models for Azure Functions, such as fixed-price application plans or the premium runtime environment. All of these considerations are essential architecture decisions, and this book will help you to get the most out of Azure Functions through a chapter dedicated entirely to it.

We also suggest that as you go through this book, you keep yourself informed by reading the Azure Functions documentation: https://docs.microsoft.com/en-au/azure/azure-functions/.

The Azure Functions runtime is a great platform for processing data, offering capabilities to integrate systems through input and output bindings, while also suiting big data ingestion use cases such as the Internet of Things (IoT) and Azure Data Factory.

Azure Event Grid – event-handling platform

Azure Event Grid is a fully managed, intelligent event-routing service. With Azure Event Grid, enterprise applications can leverage an event-driven programming model to build reactive interfaces that can be used to connect external or internal applications. Using Azure Event Grid as a middleware messaging layer for application and interface integration helps organizations to optimize the performance of their software resources with a notification push design pattern, rather than a data pull operation model. Azure Event Grid works with a publish-subscribe mechanism, where you can have one or more event publishers and with each event, there can be one or more subscribers consuming the events.

In the following example, Logic Apps acts as a subscriber to the event published to Azure Event Grid. Events are routed to a Logic Apps endpoint in real time, and once an event is posted to the Logic App endpoint, a Logic Apps workflow sends an auto-triggered email using a Logic Apps-managed API connector for Office 365:

Azure Event Grid is the perfect match for Logic Apps and Azure Functions, and you can leverage events emitted from your environment or external resources to react in real time, instead of consuming resources through a polling-based mechanism. Various blogs and articles have been written on how to use the capabilities of Azure Event Grid, along with other connecting Azure resources such as Data Factory, blob storage, Service Bus, and external services.

This book