Executing a Batch job from code

Azure Batch jobs can be executed via code by using the Azure CLI (PowerShell scripts) or by using the Azure Batch .NET API.

In the following example, we'll learn how to use the Azure Batch .NET API to run an Azure Batch job that executes a custom application (.NET console application) in several cores simultaneously. We are assuming that you have previously done (as described in this book) the following:

  • Created a Batch service account
  • Created a storage account
  • Copied a custom console application called MyApp (via the .exe and .config files) in to your Azure storage container (step 4 of the Creating an Azure Batch Service section)

To execute a Batch job, follow these steps:

  1. Open Visual Studio and create ...

Get Migrating Applications to the Cloud with Azure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.