BACKGROUND IMAGE: iSTOCK/GETTY IMAGES
Azure Functions is the serverless computing service hosted on the Microsoft Azure public cloud. Azure Functions, and serverless computing, in general, is designed to accelerate and simplify application development.
Traditional application development demands a consideration of the underlying IT infrastructure. For cloud computing, an IT team must create, monitor and pay for cloud computing instances -- regardless of how much work that instance actually does for the business.
The idea behind serverless computing, also known as function as a service, is to eliminate those infrastructure considerations for the user. With serverless, a user can simply create and upload code, and then define the triggers or events that will execute the code. Triggers can come from a wide range of sources, including another user's application or other cloud services, such as databases and event and notification hubs.
Once a trigger or event occurs, it is the cloud provider's responsibility to load the code into a suitable execution environment, run the code and then release the compute resources. There are still servers involved, but the user no longer needs to provision or manage compute instances. In addition, rather than pay for those compute instances and other associated resources each month, users pay for serverless computing based on the amount of time a function runs in a given billing cycle.
Azure Functions uses
Serverless computing functions are typically not complete, full-featured applications. Instead, functions handle specific, short-lived tasks. Most functions involve some form of data processing, such as image or order processing, as well as file maintenance or data collection from internet of things (IoT) devices.
Some examples of how an IT team uses Azure Functions include:
- The Azure Event Hub can deliver different events that trigger functions related to conditions in the cloud environment or a user account.
- A generic web hook can process HTTP requests, which allows triggers to come from websites or GitHub repositories.
- Message traffic can trigger functions. For example, messages that arrive in an Azure Storage queue can trigger functions.
- Timers can also trigger Functions, which allows users to execute regular tasks, such as file cleanups, on a regular schedule.
Users can also chain functions together, or associate one with another, to create more comprehensive application program interfaces (APIs) and microservices applications.
Azure Functions integrates with Azure software as a service (SaaS) offerings, including Azure Cosmos DB, Azure Mobile Apps and Azure Service Bus.
Developing code for Azure Functions
Azure Functions alleviates the need to provision, manage and pay for long-term compute resources in the cloud, which enables organizations to focus more on code development. This makes many of the features in Azure Functions beneficial to software developers.
Developers can code Azure Functions directly within the Azure portal, but can also manage continuous integration (CI) and deploy code through GitHub, Microsoft Visual Studio Team Services and other development tools, such as Xcode, Eclipse and IntelliJ IDEA.
Security is required to ensure that only valid requests from authorized users or triggers will drive functions. Azure Functions secures outside HTTP triggers with OAuth systems, such as Azure Active Directory, Microsoft Account credentials and more.
Azure Functions pricing, limits and requirements
Businesses can currently select between two pricing plans for Azure Functions: consumption and Azure App Service. In the consumption pricing plan, users pay for the time that each function actually runs. The other plan is for users that already employ Azure App Service to run web, mobile and API-based apps. These users can run Azure Functions at no added cost.
Azure Functions has no limits on payload size, deployment package size and code or dependency size. However, each Azure Functions host instance is limited to 1.5 GB of memory, and the default execution time limit is 5 minutes -- although, users can increase this to 10 minutes.
Azure Functions does require an Azure Storage account that must support Azure Blob, Queue and Table storage services. Azure Functions uses Azure Storage to manage triggers and log function execution. The storage demands for Azure Functions may present an added cost to users.
Azure Functions competes with other serverless computing offerings, including Amazon Web Services Lambda and Google Cloud Functions.