Scroll to top
© 2024, Global Digital Services LLC.

Serverless Cloud Computing with Azure Functions


Fernando Noguera - October 12, 2022 - 0 comments

Azure Functions is a cloud service available on-demand that provides all the  required infrastructure and resources needed to run your applications. You only need to write the fragments of code that you need to execute, and Azure Functions handles the rest. Functions provides serverless compute for Azure. You can use it to build web APIs, respond to database changes, process IoT streams, manage message queues, and more.

An overview of Azure Functions

Azure Functions is an event-based, serverless computing platform that accelerates app development, offering a more streamlined way to deploy code and logic in the cloud. These are the main components of an Azure function:

1. Events (Triggers)

An event is required to trigger a function to execute; Azure simply refers to these as triggers. There are many types, with the most common triggers being HTTP and webhooks, where functions are invoked with HTTP requests and respond to webhooks. There are also blob storage triggers, which trigger when a file is added to a storage container, and timer triggers, which can be configured to trigger in specified timeframes.

2. Data (Bindings)

Then, we have data, which is pulled in prior to and pushed out after executing a function. In Azure, these are called bindings and there can be multiple bindings per function. Bindings help reduce boilerplate code and make development more efficient by avoiding data connectors.

3. Code & Configuration 

Finally the code and configuration of the functions. Azure supports C#, Node.js, Python, F#, Java, and PowerShell. You can also bring your own custom runtime for more complex and nuanced cases.

Azure Functions pricing

  • Consumption plan: Azure provides all of the necessary computational resources. You don’t have to worry about resource management, and only pay for the time that your code runs.
  • Premium plan: You specify a number of pre-warmed instances that are always online and ready to immediately respond. When your function runs, Azure provides any additional computational resources that are needed. You pay for the pre-warmed instances running continuously and any additional instances you use as Azure scales your app in and out.
  • App Service plan: Run your functions just like your web apps. If you use App Service for your other applications, your functions can run on the same plan at no additional cost.

For more information about hosting plans, see Azure Functions hosting plan comparison. Full pricing details are available on the Functions Pricing page.

Create your first function in the Azure Portal in 3 steps

Lets create a simple example and learn how to use Azure Functions, here we are going to create a “hello world” HTTP trigger function in the Azure portal.

Prerequisites:

  • Azure Account, If you don’t have an Azure subscription, create a free account before you begin.

Step 1 – On the menu create a resource select Function App, use Node.js template, once the function app settings as specified,

Create a function app, wait until is ready,

Step 2 – In the menu Functions select Create function option.

We are going to use HttpExample template to deploy a new Function for our demo, select Anonymous from the Authorization level drop-down list, and then select Create.

Azure create the HTTP trigger function. Now, you can run the new function by sending an HTTP request.

Step 3 – Select Code + Test from the left menu, and then select Get function URL from the top menu.

Select Test/Run, click on Run and done, it should be working,

Lets try another trigger, for example HTTP method: GET, add one parameter in the query, for example a parameter named test and add any value to it, finally click run the trigger.

Contact us for more information or visit our blog.

Related posts