Create A Batch Job And Run Your First Batch Job Uisng Azure Batch

Hi everyone, in this article I will explain about Azure Batch services. What is Azure batch service? The Azure batch service is a platform which is used to build SaaS applications and it is very much helpful in running large scale applications with high performance in Azure. Using Azure Batch, we can create and manage virtual machines, so that we can install applications which we want to run and schedule our jobs to be run on VM. So, by using Azure batch services users & developers can run their client apps very easily which requires a large-scale execution environment.

Prerequisites
  • Azure portal login subscription.
Step 1
  • Login to your Azure portal by using the following link.
  • The first step is to create a Batch service so that we can create pools and jobs using it. For that, select->create a resource-> compute-> Batch Service.
Create A Batch And Run Your First Batch Job
  • Following on creation of Batch services we need to provide the basic requirements so for that we are going to provide the name for the service & create a new resource group or you can use the existing the resource group and select the location then select->Next-advanced.
Create A Batch And Run Your First Batch Job
  • Switching to advance tab and select the pool allocation mode to-> Batch service and select->create so that a batch service will be created.
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
 
Step 2
 
We have implemented creating a batch service successfully, so we can move on to the next step. The next step is to create a pool so that we can use the pool for testing purposes on windows compute nodes, for that,
  • From the Batch account navigate to pools and select-> Add.
  • Then provide the name of the pool ID, proceeding to the next step is to select the operating system.
  • Select->image type as->Marketplace (Linux/windows).
  • Select->publisher as->Microsoft windows server.
  • Select->offer-> windows server & sku as->2012-R2- Datacenter-smalldisk.
  • Proceeding to the final step in creating pool we need to enter the node size and settings for that
Select->Node pricing tier to->Standard_A1 & Target dedicated nodes to->2.
  • The remaining settings can be left as default, and select->ok for creating the pool.
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
 
Step 3
 
We can see in next step that the pool size allocation is resizing, and after that, we can assign the job to it, so after the pool is being steady, the time has come to assign a job to it.
 
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
  • From the Batch account switch to jobs and select-> Add.
  • Provide a name for the TaskID and give a display name if needed, so coming to next point is we need to enter the command in command line cmd /c "set AZ_BATCH & timeout /t 90 > NUL" and click-> submit.
The task has been now assigned -- the batch will make it in the queue it to run on the pool, when a VM is available to execute it.
 
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
 
Step 4
 
The task will be executed and completed in a few minutes. We can also view the output of the completed task, for that switch to Files on the node and then select->file stdout.txt for the output.
 
Create A Batch And Run Your First Batch Job
 
Create A Batch And Run Your First Batch Job
 
I hope you have learned about Azure Batch services and the usage of it, thanks for reading.


Similar Articles