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
Free Trial
Paperback Nov 2019 362 pages 1st Edition
eBook
₱1256.99 ₱1796.99
Paperback
₱2245.99
Subscription
Free Trial
Arrow left icon
Profile Icon Barbieri Profile Icon Bonanni
Arrow right icon
Free Trial
Paperback Nov 2019 362 pages 1st Edition
eBook
₱1256.99 ₱1796.99
Paperback
₱2245.99
Subscription
Free Trial
eBook
₱1256.99 ₱1796.99
Paperback
₱2245.99
Subscription
Free Trial

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781789951226
Vendor :
Microsoft
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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
$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 ₱260 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 ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 8,982.97
Migrating Applications to the Cloud with Azure
₱2245.99
C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development
₱4490.99
Mastering Azure Serverless Computing
₱2245.99
Total 8,982.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 included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.