Chapter 2. Getting Started with the Azure Environment
This chapter will cover the full setup and configuration of the Azure serverless computing environment (Azure Functions) and deploying our first “Hello World” application into it.
The first part of this chapter will cover the basics of getting access to the Microsoft Azure Cloud. If you are already familiar with Microsoft Azure and have access to an Azure account and a subscription, you may choose to skip to Azure serverless computing section.
During the course of this chapter, we will cover the following topics:
- Learning how to set up a new Azure account and subscription and accessing the Management Portal
- Understanding the Azure serverless computing environment
- Deploying an HTTP-triggered Azure Function using the Functions Portal
- Understanding environment settings and the definition of a function
- Learning how to clean up Azure resources
As discussed in the previous chapter, serverless computing offers are vendor-specific. While the architectural...
Azure is a public cloud computing platform powered by Microsoft. Microsoft Azure was first made available to the public in February 2010. Azure data centers are currently available in 40 regions across many countries and are expanding at a rapid rate. Azure offers a variety of IaaS, PaaS, and SaaS products. In addition to native Azure products and services, thousands of third-party products can be hosted on the Azure platform.
In this book, we will focus on a native Azure service called the Azure Functions, which is Microsoft' s primary offer for serverless computing.
The Azure Functions is a Functions as a Service (FaaS) offering. As discussed earlier, in a typical Platform as a Service (PaaS) offering, you are responsible for managing your application and data layers, while the vendor manages the hardware, middleware, OS, servers, and networking. In a FaaS environment, the vendor also manages the application context, and you can focus solely on implementing a particular...
Azure serverless computing
The Azure serverless computing offering is called Azure Functions.
Azure offers a number of other "compute-on-demand" services in which you aren't required to manage servers, such as Azure WebJobs and Azure Batch. These services are not Functions as a Service, and are best suited for background or batch processing. These services will be covered in the Appendix A, Azure Compute On-Demand Options.
There are two options for hosting plans for the Azure Functions: the Consumption Plan
and the App Service Plan
.
With an App Service plan, you host the application on Azure App Service.
In general, App Service is a Platform as a Service offering for hosting web or mobile applications on Azure. If you have a web development background, you can think of App Service as an IIS as a service. When deploying a .Net Web Application (as we will see in Chapter 3, Setting Up the Development Environment, when deploying a results dashboard), you will only need to take care of...
In this section, we will walk through the step-by-step deployment of our first serverless Azure Function using the Azure Management Portal.
Creating an Azure serverless environment
To create your first Azure Function, navigate to Azure Management Portal at https://portal.azure.com. In the left-hand side pane, navigate to New
| Compute
| Function App
. The parameters in the following screenshot will be explained next:
Let's take a moment to elaborate on the Function App deployment parameters.
The App name parameter is the DNS prefix that your application will be assigned. Once deployed, your application will be publicly routable via [YourAppName].azurewebsites.net
. The name (DNS prefix) needs to be unique within the azurewebsites.net
domain.
Note that a custom domain name can be assigned to your application. We will cover the custom domain name configuration in Chapter 10, Securing Your Application.
In Azure serverless computing, HTTP-triggered functions...
If you have been experimenting with deploying different resources, you may want to delete some of them to keep things organized and to avoid being charged for resources you don' t use. This section will describe the procedure of resource deletion at various levels. Be careful--the delete procedure is irreversible.
One way to delete a specific function inside the Function App, is to delete it from the function's app Functions
list as shown in the following screenshot:
Alternatively, you can also delete by navigating to Functions State
| Manage
| Delete function
:
Deleting the Function App
To delete the entire Function App, go to the application's Overview
page and click on the Delete
button on the right-hand side, as shown in the following screenshot:
Deleting the resource group
To browse to the entire resource group, navigate to the main portal Dashboard
| Resource Groups
| [YourResourceGroupName]
.
You can right-click on the resource group name and select...
This chapter provided us with a solid introduction to the Azure serverless computing environment and walked us through the deployment of our first Azure Functions application.
In this chapter, we covered the basics of Microsoft Azure cloud and created our first serverless computing environment and a "Hello World" function. We also walked through application settings and environment configuration.
In the next chapter, we will walk through creating an Azure Functions project in Visual Studio and deploying it to our existing Azure environment. We will also set up two other application components: the database and the Web UI to demonstrate a real-world example of serverless computing utilization.