In this article, we will tell you the steps you need to set up Azure Container for IronWorker.
1. Crate Container Insurance
From the top search input search for “Container instances”, and click on “Create” on the container instances page.
In this screen select the Resource group, Enter Container name, select Image source and type, and define the OS.
One of the good features that they allow to specify a Docker Hub hosted image.
In this screen enter the container DNS name and enable ports you need in your application
Here where we will define any environmental variables needed in the application.
In the last input, it allows overriding the Docker Image CMD command per running instance.
Review all configurations and click “Crate”
Once the deployment is complete click on “Go to resource”.
From the left menu select “containers” to list all running instances details.
2. Trigger The App
Open Postman and request the container DNS, to see the request logs click on the “Logs” tab on the container dashboard.
Some of the most important to know limits on Azure Container. usage plan.
Number of containers per container group: 60
Number of volumes per container group: 20
Standard sku container groups per region per subscription: 100 Dedicated sku container groups per region per subscription: 0 Container creates per hour: 300
Container creates per 5 minutes: 10
More on Azure Function Limits:
4. Container Instances Costs
Azure pricing for container instance is calculated based on multiple factors: 1- The OS
You create a Linux container group with a 1 vCPU, 1 GB configuration once daily during a month (30 days). The duration of each container group is 5 minutes (300 seconds).
Number of container groups * memory duration (seconds) * GB * price per GB-s * number of days
1 container group * 300 seconds * 1 GB * $0.0000015 per GB-s * 30 days = $0.014
Number of container groups * vCPU duration (seconds) * vCPU(s) * price per vCPU-s * number of days
1 container groups * 300 seconds * 1 vCPU * $0.0000135 per vCPU-s * 30 days = $0.122
Memory duration (seconds) + vCPU duration (seconds) = total cost $0.014 + $0.122 = $0.135 Per Month
Azure Container Instance is easy to set up, allows using Docker hub images, and provides a good debugging web console but task scheduling built-in.
7. Pros & Cons
Azure Container pros ease of setup, Giving the option to chose the underlaying docker host machine OS from Linux or Windows is a unique feature here, also allowing to override the docker CMD command per running instance can be helpful in many cases.
Each instance will have its public endpoint for HTTP access.
It doesn’t provide tasks Scheduler as in IronWorker, a workaround is to trigger from an Azure function.