Create a Batch account with the Azure portal
Learn how to create an Azure Batch account in the Azure portal, and choose the account properties that fit your compute scenario. Learn where to find important account properties like access keys and account URLs.
For background about Batch accounts and scenarios, see the feature overview.
Create a Batch account
When creating a Batch account, you should generally choose the default Batch service mode, in which pools are allocated behind the scenes in Azure-managed subscriptions. In the alternative user subscription mode, which is no longer recommended for most scenarios, Batch VMs and other resources are created directly in your subscription when a pool is created. To create a Batch account in user subscription mode, you must also register your subscription with Azure Batch, and associate the account with an Azure Key Vault.
- Sign in to the Azure portal.
Click Create a resource, and search the Marketplace for Batch Service.
Select Batch Service, click Create, and enter New Batch account settings. See the following details.
a. Account name: The name you choose must be unique within the Azure region where the account is created (see Location below). The account name may contain only lowercase characters or numbers, and must be 3-24 characters in length.
b. Subscription: The subscription in which to create the Batch account. If you have only one subscription, it is selected by default.
c. Pool allocation mode: If this setting appears, accept the default Batch service.
c. Resource group: Select an existing resource group for your new Batch account, or optionally create a new one.
d. Location: The Azure region in which to create the Batch account. Only the regions supported by your subscription and resource group are displayed as options.
e. Storage account (optional): A general-purpose Azure Storage account that you associate with your Batch account. This is recommended for most Batch accounts. See Linked Azure Storage account later in this article for details.
Click Create to create the account.
View Batch account properties
Once the account has been created, click the account to access its settings and properties. You can access all account settings and properties by using the left menu.
Batch account URL: When you develop an application with the Batch APIs, you need an account URL to access your Batch resources. A Batch account URL has the following format:
Access keys: To authenticate access to your Batch account from your application, you can use an account access key. (Batch also supports Azure Active Directory authentication.)
To view or regenerate the access keys, select Keys.
Azure Batch is a free service; you aren't charged for the Batch account itself. You are charged for the underlying Azure compute resources that your Batch solutions consume, and for the resources consumed by other services when your workloads run. For example, you are charged for the compute nodes (VMs) in your pools and for the data you store in Azure Storage as input or output for your tasks. Similarly, if you use the application packages feature of Batch, you are charged for the Azure Storage resources used for storing your application packages. See Batch pricing for more information.
Linked Azure Storage account
You can link a general-purpose Azure Storage account to your Batch account, which is helpful for many scenarios. The application packages feature of Batch uses Azure Blob storage, as does the Batch File Conventions .NET library. These optional features assist you in deploying the applications that your Batch tasks run, and persisting the data they produce.
We recommend that you create a new Storage account exclusively for use by your Batch account. Azure Batch currently supports only the general-purpose Storage account type. This account type is described in step 5, Create a storage account, in About Azure storage accounts.
Be careful when regenerating the access keys of a linked Storage account. Regenerate only one Storage account key and click Sync Keys on the linked Storage account page. Wait five minutes to allow the keys to propagate to the compute nodes in your pools, then regenerate and synchronize the other key if necessary. If you regenerate both keys at the same time, your compute nodes will not be able to synchronize either key, and they will lose access to the Storage account.
Additional configuration for user subscription mode
If you choose to create a Batch account in user subscription mode, perform the following additional steps before creating the account.
Allow Azure Batch to access the subscription (one-time operation)
When creating your first Batch account in user subscription mode, you need to register your subscription with Batch. (If you previously did this, skip to the next section.)
Sign in to the Azure portal.
Click More Services > Subscriptions, and click the subscription you want to use for the Batch account.
In the Subscription page, click Access control (IAM) > Add.
On the Add permissions page, select the Contributor role, search for the Batch API. Search for each of these strings until you find the API:
- Microsoft Azure Batch. Newer Azure AD tenants may use this name.
- ddbf3205-c6bd-46ae-8127-60eb93363864 is the ID for the Batch API.
Once you find the Batch API, select it and click Save.
Create a key vault
In user subscription mode, an Azure key vault is required that belongs to the same resource group as the Batch account to be created. Make sure the resource group is in a region where Batch is available and which your subscription supports.
In the Azure portal, click New > Security + Identity > Key Vault.
In the Create Key Vault page, enter a name for the key vault, and create a resource group in the region you want for your Batch account. Leave the remaining settings at default values, then click Create.
Batch service quotas and limits
As with your Azure subscription and other Azure services, certain quotas and limits apply to Batch accounts. Current quotas for a Batch account appear in Quotas.
Additionally, many of these quotas can be increased with a free product support request submitted in the Azure portal. See Quotas and limits for the Azure Batch service for details on requesting quota increases.
Other Batch account management options
In addition to using the Azure portal, you can create and manage Batch accounts with the following:
- See the Batch feature overview to learn more about Batch service concepts and features. The article discusses the primary Batch resources such as pools, compute nodes, jobs, and tasks, and provides an overview of the service's features for large-scale compute workloads.
- Learn the basics of developing a Batch-enabled application using the Batch .NET client library or Python. These introductory articles guide you through a working application that uses the Batch service to execute a workload on multiple compute nodes, and includes using Azure Storage for workload file staging and retrieval.