Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
€32.99
Paperback Nov 2019 362 pages 1st Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Barbieri Profile Icon Bonanni
Arrow right icon
€32.99
Paperback Nov 2019 362 pages 1st Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
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
Estimated delivery fee Deliver to Greece

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

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 : 9781789951226
Vendor :
Microsoft
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Greece

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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 €5 each
Feature tick icon Exclusive print discounts
€264.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 €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 131.97
Migrating Applications to the Cloud with Azure
€32.99
C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development
€65.99
Mastering Azure Serverless Computing
€32.99
Total 131.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

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon