Create a Batch account with the Azure portal
This topic shows how to create an Azure Batch account in the Azure portal, choosing the account properties that fit your compute scenario. You'll also learn where to find important account properties like access keys and account URLs.
For background about Batch accounts and scenarios, see Batch service workflow and resources.
Create a Batch account
When creating a Batch account, you can choose between two pool allocation modes: user subscription and Batch service. For most cases, you should use the default Batch service mode, in which pools are allocated behind the scenes in Azure-managed subscriptions. In the alternative user subscription mode, Batch VMs and other resources are created directly in your subscription when a pool is created. User subscription mode is required if you want to create Batch pools using Azure Reserved VM Instances. 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.
Select Create a resource, then select Compute and Batch Service.
Enter New Batch account settings. See the following details.
a. Subscription: The subscription in which to create the Batch account. If you have only one subscription, it is selected by default.
b. Resource group: Select an existing resource group for your new Batch account, or optionally create a new one.
c. Account name: The name you choose must be unique within the Azure region where the account is created (see Location below). The account name can contain only lowercase characters or numbers, and must be 3-24 characters in length.
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: An optional Azure Storage account that you associate with your Batch account. A general-purpose v2 storage account is recommended for the best performance. For all storage account options in Batch, see the Batch feature overview. In the portal, select an existing storage account, or create a new one.
f. Pool allocation mode: In the Advanced settings tab you can specify pool allocation mode as Batch service or User subscription. For most scenarios, accept the default Batch service.
Select Create to create the account.
View Batch account properties
Once the account has been created, select the account to access its settings and properties. You can access all account settings and properties by using the left menu.
The name of the Batch account is its ID and can't be changed. If you need to change the name of a Batch account, you'll need to delete the account and create a new one with the intended name.
Batch account name, URL, and keys: When you develop an application with the Batch APIs, you need an account URL and key to access your Batch resources. (Batch also supports Azure Active Directory authentication.)
To view the Batch account access information, select Keys.
To view the name and keys of the storage account associated with your Batch account, select Storage account.
To view the resource quotas that apply to the Batch account, select Quotas. For details, see Batch service quotas and limits.
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 already did this, skip to the next section.)
Sign in to the Azure portal.
Select All services > Subscriptions, and select the subscription you want to use for the Batch account.
In the Subscription page, select Resource providers, and search for Microsoft.Batch. Check that the Microsoft.Batch resource provider is registered in the subscription. If it isn't registered, select the Register link.
In the Subscription page, select Access control (IAM) > Role assignments > Add role assignment.
On the Add role assignment page, select the Contributor or Owner role, then 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 select Save.
Create a Key Vault
In user subscription mode, an Azure Key Vault is required. The Key Vault must be in the same subscription and region as the Batch account to be created.
In the Azure portal, select New > Security > 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 select Create.
When creating the Batch account in user subscription mode, specify User subscription as the pool allocation mode, select the Key Vault, and check the box to grant Azure Batch access to the Key Vault.
If you prefer to grant access to the Key Vault manually, go to the Access policies section of the Key Vault, select Add Access Policy and search for Microsoft Azure Batch. Once selected, you will need to configure the Secret permissions using the drop-down menu. Azure Batch must be given a minimum of Get, List, Set, and Delete permissions.
Ensure that the Azure Virtual Machines for deployment and Azure Resource Manager for template deployment check boxes are selected under Access policies for the linked Key Vault resource.
Configure subscription quotas
For user subscription Batch accounts, core quotas must be set manually. Standard Batch core quotas do not apply to accounts in user subscription mode.
- In the Azure portal, select your user subscription mode Batch account to display its settings and properties.
- From the left menu, select Quotas to view and configure the core quotas associated with your Batch account.
For more information about user subscription mode core quotas, see Batch service quotas and limits.
Other Batch account management options
In addition to using the Azure portal, you can create and manage Batch accounts with tools including the following:
- Learn about the Batch service workflow and primary resources such as pools, nodes, jobs, and tasks.
- Learn the basics of developing a Batch-enabled application using the Batch .NET client library or Python. These quickstarts guide you through a sample 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.