Azure Functions
Azure Functions is Microsoft’s FaaS offering within the Azure cloud platform. It provides a serverless environment for developers to build and deploy event-driven applications. Azure Functions supports various programming languages, including C#, JavaScript, Python, PowerShell, and TypeScript. It integrates well with other Azure services and can be triggered by events from sources such as HTTP requests, timers, message queues, and data changes. Azure Functions offers flexibility and scalability to handle workloads of varying sizes and complexity.
Here’s an example of creating an Azure Function using the Azure web portal:
- Sign in to the Azure portal:
Go to the Azure web portal (https://portal.azure.com/) and sign in with your Azure account. - Create a function app:
A function app is a container for your functions. It provides the runtime environment for your functions to run. Complete the following steps:
I. Click on Create a resource in the Azure portal.
II. Search for Function App and click on Function App from the search results.
III. Click Create to start the function app creation process.
IV. Fill in the required details:
• App name: Choose a unique name for your function app (e.g., MyFunctionApp).
• Subscription: Select the desired Azure subscription.
• Resource group: Create a new one or use an existing resource group to organize your resources.
• OS: Choose Windows or Linux, depending on your requirements.
• Hosting plan: Choose the appropriate hosting plan (consumption plan for serverless execution or app service plan for dedicated resources).
• Region: Select the region where you want to deploy your function app.
V. Click Review + create, then Create to create the function app. - Create a function:
After the function app is deployed, you can create a new function inside it:
I. Go to your function app in the Azure portal.
II. Click on Functions in the left menu.
III. Click on + Add to create a new function.
IV. Choose a development environment:
• Select In-portal for a browser-based code editor or VS Code if you prefer to develop locally.
V. Choose a template:
• For this example, select a template based on the language you prefer (e.g., JavaScript, C#, or Python).
VI. Configure the function:
VII. Give your function a name.
VIII. Choose the Authorization level (anonymous, function, or admin) to define how your function can be accessed.
IX. Click Create to create the function. - Write and test your function:
Now, you can write the code for your function. The code will be specific to the chosen template and language. For example, if you selected the JavaScript template, you’ll be writing Node.js code. Complete the following steps:
I. Edit the function code according to your requirements.
II. Click Save when you’re done.
To test your function, you can use the Test tab in the function editor. You can provide sample input and see the output of your function. - Trigger and deploy your function:
Azure Functions can be triggered by various events, such as HTTP requests, timers, or messages from Azure services. You can configure the trigger type for your function under the Integrate tab. Once your function is working as expected, click Deploy to deploy the latest changes to the live environment.
That’s it! You have successfully set up an Azure Function and deployed it to the Azure cloud. Your function is now ready to execute whenever its trigger conditions are met.
Figure 3.4 depicts how Azure Blob Storage is deployed in an Azure cloud infrastructure. Please note how the storage is being accessed from the Azure Front Door service:

Figure 3.3 – Azure Blob Storage bucket in Azure Cloud