About the Authors |
|
xiii | |
About the Technical Reviewer |
|
xv | |
Acknowledgments |
|
xvii | |
Introduction |
|
xix | |
Chapter 1 Introduction to Azure Functions |
|
1 | (10) |
|
|
1 | (1) |
|
|
2 | (1) |
|
Introduction to Azure Functions |
|
|
2 | (1) |
|
Introduction to Serverless |
|
|
3 | (1) |
|
Azure WebJobs vs. Azure Functions |
|
|
4 | (1) |
|
Advantages and Disadvantages of Azure Functions |
|
|
5 | (1) |
|
Hosting Plans for Azure Functions |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
Use Cases for Azure Functions |
|
|
8 | (1) |
|
|
9 | (2) |
Chapter 2 Build Your First Azure Function |
|
11 | (30) |
|
|
11 | (1) |
|
|
12 | (1) |
|
Create Functions Using the Azure Portal |
|
|
12 | (11) |
|
Create Functions Locally Using the Command Line |
|
|
23 | (5) |
|
Create Functions Using Visual Studio Code |
|
|
28 | (6) |
|
Create Functions Using Visual Studio |
|
|
34 | (6) |
|
|
40 | (1) |
Chapter 3 What Are Triggers and Bindings? |
|
41 | (22) |
|
|
41 | (1) |
|
|
42 | (1) |
|
Introduction to Triggers and Bindings |
|
|
42 | (2) |
|
Supported Triggers and Bindings |
|
|
44 | (6) |
|
Trigger and Binding Use Cases |
|
|
46 | (1) |
|
Use Case: An Azure function gets triggered when a message arrives in a queue, and the processed message is put into another queue |
|
|
47 | (1) |
|
Use Case: A scheduled job picks up images for Blob Storage at a particular time interval and then processes and stores them back in the Blob Storage |
|
|
48 | (1) |
|
Use Case: An HTTP call invokes an Azure function to execute some business logic |
|
|
48 | (1) |
|
Use Case: An event grid can invoke an Azure function to send an email with event data |
|
|
49 | (1) |
|
Use Case: RabbitMQ triggers an Azure function that processes the message sent by RabbitMQ and puts the processed message in Azure Cosmos DB |
|
|
50 | (1) |
|
Implement Triggers and Bindings for Azure Functions |
|
|
50 | (11) |
|
|
61 | (2) |
Chapter 4 OTP Mailer with Queue Storage Trigger and SendGrid Binding |
|
63 | (28) |
|
|
63 | (1) |
|
|
64 | (1) |
|
Getting Started with a Queue Storage Trigger and Use Cases |
|
|
64 | (1) |
|
Build a Sample Application Using a Queue Storage Trigger |
|
|
65 | (12) |
|
Getting Started with a SendGrid Output Binding and Use Cases |
|
|
77 | (1) |
|
Build a Sample Application Using the SendGrid Output Binding |
|
|
78 | (10) |
|
Create an OTP Mailer Using a Queue Storage Trigger and SendGrid Output Binding |
|
|
88 | (2) |
|
|
90 | (1) |
Chapter 5 Build a Report Generator with a Timer Trigger and Blob Storage Bindings |
|
91 | (34) |
|
|
92 | (1) |
|
|
92 | (1) |
|
Getting Started with Timer Triggers and Use Cases |
|
|
92 | (2) |
|
Build a Sample Application Using a Timer Trigger |
|
|
94 | (12) |
|
Getting Started with Blob Storage Bindings and Use Cases |
|
|
106 | (1) |
|
Build a Sample Function Using a Blob Storage Binding |
|
|
107 | (5) |
|
Create a Report Generator Using a Blob Storage Binding and Timer Trigger |
|
|
112 | (11) |
|
|
123 | (2) |
Chapter 6 To-Do API with an HTTP Trigger and a Table Storage Binding |
|
125 | (22) |
|
|
125 | (1) |
|
|
126 | (1) |
|
Getting Started with HTTP Triggers and Use Cases |
|
|
126 | (1) |
|
Build a Sample Application Using an HTTP Trigger |
|
|
127 | (5) |
|
Routing in HTTP-Triggered Azure Functions |
|
|
132 | (3) |
|
Getting Started with Table Storage Bindings and Use Cases |
|
|
135 | (1) |
|
Build a Sample Application Using a Table Storage Binding |
|
|
136 | (5) |
|
Create a To-Do API with an HTTP Trigger and a Table Storage Binding |
|
|
141 | (5) |
|
|
146 | (1) |
Chapter 7 Creating Custom Bindings for Azure Functions |
|
147 | (18) |
|
|
147 | (1) |
|
|
148 | (1) |
|
Introduction to Custom Bindings |
|
|
148 | (1) |
|
Use Cases for Custom Bindings |
|
|
148 | (1) |
|
Build a Custom Binding for Azure Functions |
|
|
149 | (15) |
|
|
151 | (2) |
|
Implement the Binding Attribute Class |
|
|
153 | (4) |
|
Implement the Binding Logic Class |
|
|
157 | (2) |
|
Implement the Binding Extension Class |
|
|
159 | (1) |
|
Implement the Binding Startup Class |
|
|
160 | (1) |
|
Incorporate the Binding in the Azure Function |
|
|
161 | (3) |
|
|
164 | (1) |
Chapter 8 Building Serverless APIs Using Azure Functions and Azure SQL |
|
165 | (38) |
|
|
166 | (1) |
|
|
166 | (1) |
|
|
166 | (2) |
|
Creating an Azure SQL Database Instance in the Azure Portal |
|
|
168 | (5) |
|
Building Serverless APIs for the Proof of Concept |
|
|
173 | (21) |
|
Testing the Serverless APIs for the Proof of Concept |
|
|
194 | (7) |
|
|
201 | (2) |
Chapter 9 Serverless API Using Azure Functions and Azure Cosmos DB |
|
203 | (30) |
|
|
203 | (1) |
|
|
204 | (1) |
|
Introduction to Azure Cosmos DB and Its Use Cases |
|
|
204 | (2) |
|
Getting Started with Azure Function Cosmos DB Triggers by Building a Simple Application |
|
|
206 | (16) |
|
Build an HTTP-Triggered Azure Function to Perform CRUD Operations on Azure Cosmos DB Using Bindings |
|
|
222 | (4) |
|
Leverage the Azure Cosmos DB SDK to Interact with Cosmos DB from Azure Functions |
|
|
226 | (5) |
|
|
231 | (2) |
Chapter 10 Enabling Application Insights and Azure Monitor |
|
233 | (30) |
|
|
233 | (1) |
|
|
234 | (1) |
|
Enable Logging Using Application Insights |
|
|
234 | (10) |
|
Perform Diagnostics for Azure Functions |
|
|
244 | (5) |
|
Monitor Azure Functions and Create Alerts |
|
|
249 | (10) |
|
Restrict the Number of Scaling Instances for the Azure Function App |
|
|
259 | (1) |
|
|
260 | (3) |
Chapter 11 Storing Function Secrets in Azure Key Vault |
|
263 | (26) |
|
|
264 | (1) |
|
|
264 | (1) |
|
Getting Started with Azure Key Vault |
|
|
264 | (1) |
|
Create an Azure Key Vault in the Azure Portal |
|
|
265 | (6) |
|
Store Secrets in Key Vault |
|
|
271 | (3) |
|
Create an Azure Function in the Azure Portal |
|
|
274 | (10) |
|
Add an Access Policy for Azure Key Vault |
|
|
284 | (3) |
|
|
287 | (2) |
Chapter 12 Authentication and Authorization Using Azure Active Directory |
|
289 | (26) |
|
|
289 | (1) |
|
|
290 | (1) |
|
What Is Azure Active Directory? |
|
|
290 | (1) |
|
What Are Authentication and Authorization? |
|
|
291 | (1) |
|
Implement Authentication and Authentication for Azure Functions Using Azure Active Directory |
|
|
292 | (20) |
|
|
312 | (3) |
Chapter 13 Securing Azure Functions with API Management |
|
315 | (24) |
|
|
315 | (1) |
|
|
316 | (1) |
|
What Is the API Management Service? |
|
|
316 | (1) |
|
Advantages of Using the API Management Service |
|
|
316 | (1) |
|
Integrate API Management with Azure Functions |
|
|
317 | (20) |
|
|
337 | (2) |
Chapter 14 Deploying Your Azure Functions Using IDEs |
|
339 | (34) |
|
|
339 | (1) |
|
|
340 | (1) |
|
Deploy an Azure Function to Azure Using Visual Studio 2019 |
|
|
340 | (12) |
|
What Are Deployment Slots? |
|
|
352 | (1) |
|
Deploy an Azure Function to Deployment Slots |
|
|
352 | (10) |
|
Deploy an Azure Function to Azure Using VS Code |
|
|
362 | (9) |
|
|
371 | (2) |
Chapter 15 Deploying Your Azure Functions Using a Cl/CD Pipeline with Azure DevOps |
|
373 | (28) |
|
|
374 | (1) |
|
|
374 | (1) |
|
|
374 | (3) |
|
Create a Project in Azure DevOps |
|
|
377 | (1) |
|
Create a Build Pipeline in Azure DevOps and Enable Continuous Integration |
|
|
378 | (10) |
|
Create a Release Pipeline in Azure DevOps and Enable Continuous Delivery |
|
|
388 | (11) |
|
|
399 | (2) |
Chapter 16 Running Azure Functions in Containers |
|
401 | (20) |
|
|
401 | (1) |
|
|
402 | (1) |
|
Getting Started with Containers and AKS |
|
|
402 | (2) |
|
What Is Serverless Kubernetes and KEDA in Azure? |
|
|
404 | (1) |
|
Containerize Azure Functions and Push Them to the Azure Container Registry |
|
|
405 | (7) |
|
Deploy the Containerized Azure Functions in AKS Using KEDA |
|
|
412 | (7) |
|
|
419 | (2) |
Chapter 17 Adding Cognitive Capabilities to Your Azure Functions |
|
421 | (28) |
|
|
421 | (1) |
|
|
422 | (1) |
|
Getting Started with Azure Cognitive Services |
|
|
422 | (1) |
|
Getting Started with Azure Text Analytics |
|
|
423 | (1) |
|
Create an Azure Text Analytics Resource in the Azure Portal |
|
|
424 | (4) |
|
Build a Serverless API to Analyze Feedback Using Sentiment Analysis |
|
|
428 | (7) |
|
Test the FeedbackAnalyzer Function Using Postman |
|
|
435 | (2) |
|
Build a Language-Based Document Classifier Serverless Solution |
|
|
437 | (8) |
|
Test the Language-Based Document Classifier Function |
|
|
445 | (3) |
|
|
448 | (1) |
Chapter 18 Introduction to Azure Durable Functions |
|
449 | (20) |
|
|
449 | (1) |
|
|
450 | (1) |
|
Getting Started with Azure Durable Functions |
|
|
450 | (2) |
|
Benefits of Azure Durable Functions |
|
|
452 | (1) |
|
|
453 | (3) |
|
|
453 | (1) |
|
|
454 | (1) |
|
|
455 | (1) |
|
|
455 | (1) |
|
|
456 | (1) |
|
|
456 | (1) |
|
Implement an Azure Durable Function |
|
|
456 | (11) |
|
|
467 | (2) |
Chapter 19 Integrating Azure Functions in a Logic Apps Workflow |
|
469 | (32) |
|
|
470 | (1) |
|
|
470 | (1) |
|
Getting Started with Azure Logic Apps |
|
|
470 | (1) |
|
Create an Azure Logic Apps Solution in the Azure Portal |
|
|
471 | (9) |
|
Add Azure Functions in Logic Apps Workflows |
|
|
480 | (19) |
|
|
499 | (2) |
Chapter 20 Best Practices and Pitfalls to Avoid |
|
501 | (16) |
|
|
501 | (1) |
|
|
501 | (1) |
|
Design Guidelines and Best Practices |
|
|
502 | (10) |
|
Decide to Use Functions or Not for Your Scenario |
|
|
503 | (1) |
|
Choose the Correct Programing Language |
|
|
504 | (1) |
|
|
505 | (1) |
|
Pick a Stateful or Stateless Solution |
|
|
506 | (1) |
|
|
507 | (1) |
|
Get the Correct Bill to Fit Your Budget |
|
|
508 | (1) |
|
|
508 | (1) |
|
Facilitate Integration and Communication Among Other Azure and External Services |
|
|
509 | (1) |
|
Identify and Manage the Bottlenecks |
|
|
509 | (1) |
|
Make Your Solution Fault Tolerant |
|
|
510 | (1) |
|
Secure the APIs Developed Using Azure Functions |
|
|
511 | (1) |
|
Facilitate Efficient Monitoring and Debug Failures |
|
|
511 | (1) |
|
Incorporate DevOps Practices and Bring in an IaC Approach |
|
|
511 | (1) |
|
Bring in a Defensive Programming Approach |
|
|
512 | (1) |
|
|
512 | (2) |
|
Sharing Functions in a Single Function App Service |
|
|
513 | (1) |
|
Processing the Input Data One Piece at a Time |
|
|
513 | (1) |
|
Hosting the Production and Development Functions in the Same Function App Service |
|
|
513 | (1) |
|
Sharing Storage Accounts Across Function App Services |
|
|
514 | (1) |
|
|
514 | (3) |
Index |
|
517 | |