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.

container_1
container_2

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.

container_3

In this screen enter the container DNS name and enable ports you need in your application

container_4

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.

container_5

Review all configurations and click “Crate”

container_6

Once the deployment is complete click on “Go to resource”.
From the left menu select “containers” to list all running instances details.

container_7
container_8

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.

container_9

3. Limits

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:

https://github.com/MicrosoftDocs/azure-docs/blob/master/includes/container-instances-limits.md

4. Container Instances Costs

Azure pricing for container instance is calculated based on multiple factors: 1- The OS
2- Memory
3- vCPU

Pricing Example:

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).

Memory duration:

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

vCPU duration:

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

Total billing:

Memory duration (seconds) + vCPU duration (seconds) = total cost $0.014 + $0.122 = $0.135 Per Month

5. Notes

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.

6. Security

For more about Azure Security and compliance

https://docs.microsoft.com/en-us/azure/compliance/

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.

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.