280 likes | 452 Views
Azure Serverless Functions are helpful for developers, who are focused on reducing the TTM factor and building easy-to-use flexible solutions. Some of their advantageous features are:<br>- Flexibility of services;<br>- Greater scalability;<br>- Faster deployment times;<br>- Accelerated workloads in the cloud;<br>- Reduced costs on infrastructure management and maintenance;<br>- Automated workflows, and so on.<br><br>If you need an application with a small number of functions to perform short-running tasks, serverless computing will be an excellent money-saving investment.<br><br>For additional information click on the link: https://www.byteant.com/blog/how-to-harness-the-power-of-serverless-with-azure-in-2020/
E N D
Intro to Serverless with Azure Functions Andriy Zelinskyy
From IaaS to FaaS Azure Functions is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure.
Serverless. When? • Is the app a small, usable building block, or can it be broken into small blocks? • Do all the building blocks have well-defined inputs and outputs? • Can I use existing development and build tools? • Does the serverless platform support: • Receiving connections from my client? • Interacting with the target datastore? • A language I know?
Azure Functions Triggers & Bindings Triggers are what cause a function to run. A trigger defines how a function is invoked and a function must have exactly one trigger. Triggers have associated data, which is often provided as the payload of the function. Binding to a function is a way of declaratively connecting another resource to the function; bindings may be connected as input bindings, output bindings, or both. Data from bindings is provided to the function as parameters.
Azure Functions Hosting Plans • Consumption Plan • Premium Plan • App Service Plan The hosting plan you choose dictates the following behaviors: • How your function app is scaled. • The resources available to each function app instance. • Support for advanced features, such as VNET connectivity.
Consumption Plan Instances of the Azure Functions host are dynamically added and removed based on the number of incoming events. On a Consumption plan, a function execution times out after a configurable period of time. Billing is based on number of executions, execution time, and memory used. The Consumption plan is the default hosting plan and offers the following benefits: • Pay only when your functions are running • Scale out automatically, even during periods of high load
Premium Plan(Preview) Instances of the Azure Functions host are added and removed based on the number of incoming events just like the Consumption plan. Premium plan supports the following features: • Perpetually warm instances to avoid any cold start • VNet connectivity • Unlimited execution duration • Premium instance sizes (one core, two core, and four core instances) • More predictable pricing • High-density app allocation for plans with multiple function apps Billing for the Premium plan is based on the number of core seconds, execution time, and memory used across needed and reserved instances. At least one instance must be warm at all times. Consider the Azure Functions premium plan in the following situations: • Your function apps run continuously, or nearly continuously. • You need more CPU or memory options than what is provided by the Consumption plan. • Your code needs to run longer than the maximum execution time allowed on the Consumption plan. • You require features that are only available on a Premium plan, such as VNET/VPN connectivity.
Dedicated (App Service) plan Function apps can also run on the same dedicated VMs as other App Service apps. Consider an App Service plan in the following situations: • You have existing, underutilized VMs that are already running other App Service instances. • You want to provide a custom image on which to run your functions. With an App Service plan, you can manually scale out by adding more VM instances. You can also enable autoscale
Azure Functions 1.x vs 2.x Cross-platform development(runs on .NET Core 2) Built-In DI Framework
Durable Functions Durable Functions are an extension of Azure Functions that lets you write stateful functions in a serverless environment. The extension manages state, checkpoints, and restarts for you. Provide stateful workflows using an orchestrator function, which can provide the following benefits: • You can define your workflows in code • Other functions can be called both synchronously and asynchronously. Output from called functions can be saved to local variables. • Progress is automatically checkpointed when the function awaits. Local state is never lost when the process recycles or the VM reboots.
Further Reading How to Harness the Power of Serverless with Azure in 2020