IronWorker CaaS Worker: Azure Function Setup
In this article, we will tell you the steps you need to set up Azure Function for IronWorker.
Setup Outline:
In Azure Function, we need first to create a Function app which is the logical management and execution container for your actual function code
Select a resource group, Enter Function App Name, select Code as Publish type, and select the Runtime Stack & Version.
An Edge of Azure Function is providing .Net Core, Java, and PowerShell runtimes.
It does make sense of course to support their stacks.
Select a storage account and the OS. you can change the plan type on this screen as well.
Review and click “Create”. You can also download the function template.
When the deployment is complete click on “Go to resource”
2. Create the Function
Now we have created the Function App, we can add functions to it.
On the Function-app dashboard select functions from the left menu and click “Add” on the top menu
Select “HTTP Trigger”, Enter function name, and select “anonymous” for Authorization level to allow accessing from HTTP. Click “Add” to create the functions.
It provides different triggers like the “Timer trigger” for scheduling the function run and can be triggered by other Azure services.
3. Function Code
After creating the function, you can add the code inside the web editor, or upload a Zip Package.
From the Test/Run screen, you can test the function output.
Unfortunately, our testing app was bigger than the allowed zip file size to be uploaded, which is 5MB! I guess it’s a too-small number.
Compressing the app files results resulted in 7.3MB best size.
4. Limits
Some of the most important to know limits on Azure Functions based on the usage plan.
Max instances:
Consumption plan=200, Premium plan=20, App Service plan=10-20
Max Timeout :
Consumption plan:(Default=5, Max=10) ,Premium plan:(Default=30, Max=Unlimited), App Service plan: (Default=900, Max=Unlimited)
Max request size (MB): 100
More on Azure Function Limits:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale
5. Costs
Azure will charge you for Azure Functions According to your selected Consumption Plan per-second resource consumption and executions.
Consumption Plans come with a free tier 1 million requests and 400,000 GB-s of resource consumption.
More on Azure Function Pricing here:
https://azure.microsoft.com/en-us/pricing/details/functions/
6. Notes
At first glance, you see a small abstraction but when start deploying you may get confused it would be better if was just the function directly holding its own config. Providing runtimes .Net, Java, PowerShell definitely is a unique value you can’t find on many other FaaS services
7. Security
For more about Azure Security and compliance
8. Pros & Cons
As a serverless function service, it’s a good solution with a good predefined runtime set including (.Net, Java, and Powershell).
Azure function allows you to select the underlying infrastructure OS (Linux or Windows).
Some of the cons I have experienced are the 5MB limited zip-package size when uploading the function zipped-code. And the abstractions level when creating the function.
In comparison with IronWroker, it doesn’t provide a task scheduler and hard to setup.