Configure your Microsoft Azure subscription with an Azure Batch account and other resources needed to submit batch jobs.

Sign up for an Azure subscription

If you do not already have an Azure account and subscription, you can create a free trial account on this page.

Create a Batch account and node pool

Click this link to open an Azure Resource Manager (ARM) template in the Azure portal. Fill in the template parameters according to the descriptions in the deployment creation form:

  • The selected node VM size must be among the sizes supported by Azure Batch. See Microsoft's documentation for a list.
  • Azure Batch enforces quotas on the number of running vCPUs allowed within a Batch account. If your accounts quota is insufficient to run nodes of the selected VM size, your node pool will fail to scale up. See Microsoft's documentation for more information about quotas and requesting a quota increase.
  • If you wish to examine or modify the ARM template source, you can download it directly at this link.
  • To create an additional node pool in an existing Batch account, use this link. (To examine or modify the template source, download it at this link.)
  • To create a new Batch account without creating a node pool, use this link. (To examine or modify the template source, download it at this link.)

Copy the submission environment expression

Once the deployment has completed, navigate to the Outputs tab and copy the submission environment output to a notebook:

If you have not previously saved credentials for Azure Batch, evaluating RemoteBatchSubmissionEnvironment["AzureBatch", ] will produce an authentication dialog box:

In the next step, you will obtain Azure Batch credentials to enter in this dialog box.

  • If you have already saved credentials for a different Azure Batch account, you can force RemoteBatchSubmissionEnvironment to prompt for new credentials for the new account by specifying the environment setting "ServiceObject""New" , like: RemoteBatchSubmissionEnvironment["AzureBatch",<|"PoolID""","ServiceObject""New"|>]

Obtain credentials for the Batch account

Return to the Overview tab and locate the Keys page for the new Batch account:

Enter the Batch account and storage account credentials into the authentication dialog from step 3 and click Done, returning a RemoteBatchSubmissionEnvironment[] expression:

Scale up the Azure Batch pool

By default, the node pool in your new Batch account will be configured for manual scaling with no running nodes. Before submitting a job, the pool must be scaled up so that at least one node is running:

  • Azure Batch will keep the specified number of nodes active until the pool is manually scaled down, regardless of whether any jobs are being run.
  • In the event that your Batch accounts vCPU quota for the VM series selected during pool creation is insufficient to run the requested number of nodes, an AccountVMSeriesCoreQuotaReached error message will be displayed on the Pools page. See Microsoft's documentation for more information about quotas and requesting a quota increase.

The submission environment from steps 3 and 4 can now be used to submit batch jobs:

Query the jobs status:

Download the jobs output:

Scale down the pool

When you are done running batch jobs, scale the pool down to zero nodes using the same procedure as was followed to scale up the pool in step 5.