Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Mastering Azure Serverless Computing
Mastering Azure Serverless Computing

Mastering Azure Serverless Computing: A practical guide to building and deploying enterprise-grade serverless applications using Azure Functions

Arrow left icon
Profile Icon Barbieri Profile Icon Bonanni
Arrow right icon
Mex$504.99 Mex$721.99
eBook Nov 2019 362 pages 1st Edition
eBook
Mex$504.99 Mex$721.99
Paperback
Mex$902.99
Subscription
Free Trial
Arrow left icon
Profile Icon Barbieri Profile Icon Bonanni
Arrow right icon
Mex$504.99 Mex$721.99
eBook Nov 2019 362 pages 1st Edition
eBook
Mex$504.99 Mex$721.99
Paperback
Mex$902.99
Subscription
Free Trial
eBook
Mex$504.99 Mex$721.99
Paperback
Mex$902.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Mastering Azure Serverless Computing

Developing and Running Azure Functions

Azure Functions is one of the serverless technologies offered by Azure. It allows you to run code on-demand in response to a variety of events.

In this chapter, we will provide a brief explanation of what Azure Functions is and how it works. We will also introduce all the tools you can use to create, develop, and test a solution based on Azure Functions. The first tool we will look at is Azure Functions Core Tools, which is the most important tool you can use when you start to develop your Azure Functions solution because with it you can create, test, and deploy your Azure Functions. In this chapter, you will also learn how Visual Studio and Visual Studio Code can help you to improve your developer experience and how you can use other tools to support the documentation and testing phases.

This chapter will cover the following topics:

  • Introduction...

Technical requirements

If you want to start to develop solutions with Azure Functions, you have to know one of the languages Azure Functions supports (at this moment in time, C#, JavaScript, Java, and Python). If you do, you'll easily be able to follow this book.

The Microsoft entry point for the Azure Functions documentation is located at https://azure.microsoft.com/en-us/services/functions/. Starting from there, you can find technical documentation, whitepapers, and samples, and you can navigate to the GitHub repositories for the different tools you'll encounter in this book.

Finally, you can find the source code for this book at https://github.com/PacktPublishing/Mastering-Azure-Serverless-Computing/tree/master/Chapter01.

Introduction to Azure Functions

The Azure Functions platform allows you to run a piece of code (basically a simple function) in response to a wide variety of events; for example, you can run code when a client makes an HTTP request or when someone puts a message into a queue.

There are two fundamental concepts to understand when approaching the world of Azure Functions—triggers and bindings:

  • Triggers are what cause a function to run; they define what kind of event the function responds to. A trigger tells you how a function is called, and a function must have exactly one trigger. Triggers have associated data, which is often provided as the payload of the function, and you can use the data contained in the payload to better understand the nature of the event that wakes up your function.
  • Bindings are the way functions can exchange data with other cloud services such as...

Azure Functions Core Tools

The Azure Functions runtime (runtime for short) is part of Azure Functions Core Tools, a set of Command-Line Interface (CLI) tools that allow you to run, test, and deploy your functions and that you can install on your PC or server.

There are two versions of Azure Function Core Tools:

  • Version 1.x: This version can run only on Windows and supports version 1.x of the Azure Functions runtime. It supports .NET Framework 4.7.1 only.
  • Version 2.x: This version can run on Windows, macOS, and Linux and supports the 2.x version of the Azure Functions runtime.

The 2.x version of the tool contains the 2.x version of the Azure Functions runtime. It is based on .NET Core and can run on all platforms that support .NET Core 2.x and 3.x (Windows, macOS, and Linux).

Azure Functions Core Tools (both v1.x and v2.x) is open source under the MIT License, and you can find...

Developing Azure Functions with Visual Studio

Since 2002, Visual Studio has been the most important IDE for developing solutions with .NET Framework and it is an important tool to use to implement and test your Azure Functions.

In this book, we will always refer to Visual Studio 2019 but most of the operations we will perform on that version can be done on Visual Studio 2017 (Visual Studio 2017 is the oldest version of Visual Studio that supports Azure Functions development).

Visual Studio 2019 allows you to create an Azure Functions project:

  1. Simply choose the File | New | Project menu:
  1. This menu option opens the Visual Studio project type window where you can choose the Azure Functions project type:

If you don't have the Azure Functions template in the project types list, you probably didn't install the Azure development workload. In this case, you can use the...

The OpenAPI Specification in Azure Functions

If you have worked with SOAP services in your career, surely you have had to deal with the concept of a Web Services Description Language (WSDL) manifest. WSDL is the identity card of a SOAP service and fully describes the service itself in terms of the endpoints, ports, and payloads used by the service. Using WSDL, you can understand how a third-party service works and you can create its client automatically.

The OpenAPI Specification is the counterpart of WSDL for REST API services: they are a set of specifications created by the most important players in the computer science world, such as Google, Microsoft, and IBM which join together in open governance structure under the Linux Foundation. The purpose of the OpenAPI specification is to standardize how REST APIs are described using a programming language-agnostic approach based...

Exposing your Azure Functions on the internet with ngrok

As you have read in the previous paragraphs, you can use the Azure Functions runtime to host your functions, but the host process exposes your function on the localhost, so you cannot reach them from another PC than the one hosting them.

If you want to expose your functions on the internet and, therefore, solve the problem, you can use ngrok. ngrok is software (running on Windows, macOS, and Linux) that allows you to expose a local server to the internet using a secure tunnel, and it also works if your local server is behind a NAT or a firewall.

  1. To use ngrok, you need to register yourself on the ngrok website and create an account.

ngrok has a free plan that allows you to use the software for free with the limitation of only one process at a time with a maximum of four tunnels and a random port, but it is enough to test...

Debugging an Azure Function

Implementing a software solution is only the first step; once you've written your code (or if something goes wrong in your test environment), you need to be able to debug it.

Visual Studio and Visual Studio Code give you all the tools to debug an Azure Function both locally and remotely.

In this section, we will use the features of Visual Studio, but these features are also available in Visual Studio Code.

Debugging your function locally

Using the Visual Studio debugger (or the Visual Studio Code debugger), you can debug your function locally as you do for any other program written in .NET: you can insert breakpoints, run the software step by step, or use the debug console.

The issue, when...

Summary

In this chapter, you learned how to create, build, and debug an Azure Function using Azure Functions Core Tools, Visual Studio, and Visual Studio Code. Also, you discovered how to implement the OpenAPI Specification in our HTTP triggered function and how to expose your local functions on the internet using ngrok.

Azure Functions Core Tools is the main tool you can use to create, host, and manage your Azure Functions. Using this tool, you can write Azure Functions in C#, JavaScript, Java, and Python and build and host them in your local development environment. Along with this tool, you can use a whole series of tools that allow you to enhance your development and debugging experience. Of course, a better development experience is provided by using a modern IDE such as Visual Studio or Visual Studio Code but you can write your functions with your favorite IDE and operating...

Questions

  1. Which of these languages is supported by the Azure Functions runtime?
    • C#
    • Golang
    • JavaScript
    • Java
    • Cobol
  1. Which of the following tools can you use to create a project containing an Azure Function?
    • Visual Studio
    • Azure Functions Core Tools
    • Storage Emulator
    • Management Studio
  1. Can you create Azure Functions written in different programming languages within a function app?
    • Yes, both in V.1.x and in V2.x
    • Yes, only in V1.x
    • Yes, only in V2.x
    • No, never
  1. How can you debug your Azure Functions remotely?
    • By installing Visual Studio in the same VM that hosts the Azure Function.
    • Using the Cloud Explorer extension on Visual Studio and the remote debugger.
    • You can't debug an Azure Function remotely.

Further reading

You can find more information about developing and debugging Azure Functions at these URLs:

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Develop scalable, robust multi-tier apps without worrying about infrastructure needs
  • Deploy and manage cost-effective and highly available serverless apps using Azure Functions
  • Accelerate enterprise-level application development by seamlessly integrating different cloud services with Azure Functions

Description

Application development has evolved from traditional monolithic app development to using serverless options and microservices. This book is designed to guide you through using Microsoft's Azure Functions to process data, integrate systems, and build simple APIs and microservices. You will discover how to apply serverless computing to speed up deployment and reduce downtime. You'll also explore Azure Functions, including its core functionalities and essential tools, along with understanding how to debug and even customize Azure Functions. In addition to this, the book will take you through how you can effectively implement DevOps and automation in your working environment. Toward the concluding chapters, you'll cover some quick tips, troubleshooting techniques, and real-world serverless use cases that will help you make the most of serverless computing. By the end of this book, you will have gained the skills you need to develop and deliver cost-effective Azure serverless solutions.

Who is this book for?

This book is designed for cloud administrators, architects, and developers interested in building scalable systems and deploying serverless applications with Azure Functions. Prior knowledge of core Microsoft Azure services and Azure Functions is necessary to understand the topics covered in this book.

What you will learn

  • Create and deploy advanced Azure Functions
  • Learn to extend the runtime of Azure Functions
  • Orchestrate your logic through code or a visual workflow
  • Add caching, security, routing, and filtering to your APIs
  • Use serverless technologies in real-world scenarios
  • Understand how to apply DevOps and automation to your working environment

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 22, 2019
Length: 362 pages
Edition : 1st
Language : English
ISBN-13 : 9781789952056
Vendor :
Microsoft
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Nov 22, 2019
Length: 362 pages
Edition : 1st
Language : English
ISBN-13 : 9781789952056
Vendor :
Microsoft
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Mex$ 3,610.97
Migrating Applications to the Cloud with Azure
Mex$902.99
C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development
Mex$1804.99
Mastering Azure Serverless Computing
Mex$902.99
Total Mex$ 3,610.97 Stars icon

Table of Contents

18 Chapters
Section 1: Azure Functions 2.0 Fundamentals Chevron down icon Chevron up icon
Developing and Running Azure Functions Chevron down icon Chevron up icon
Customizing Your Azure Functions Chevron down icon Chevron up icon
Programming Languages Supported in Azure Functions Chevron down icon Chevron up icon
Section 2: Azure Functions 2.0 Deployment and Automation Chevron down icon Chevron up icon
Deploying and Configuring Your Azure Functions Chevron down icon Chevron up icon
Leverage the Power of DevOps with Azure Functions Chevron down icon Chevron up icon
Testing and Monitoring Chevron down icon Chevron up icon
Serverless and Containers Chevron down icon Chevron up icon
Section 3: Serverless Orchestration, API Management, and Event Processing Chevron down icon Chevron up icon
Orchestration as Code - Durable Functions Chevron down icon Chevron up icon
Orchestration as Design - Logic Apps Chevron down icon Chevron up icon
Empowering Your Serverless API with API Management Chevron down icon Chevron up icon
High-Scale Serverless Event Processing with Event Grid Chevron down icon Chevron up icon
Section 4: Real-World Serverless Use Cases Chevron down icon Chevron up icon
Best Practices and Use Cases for Azure Serverless Computing Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Another Book You May Enjoy Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.