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

Use the portal to create a Batch account in one of the two pool allocation modes: Batch service mode or the newer user subscription mode, which requires more configuration. For information about these two modes, see the feature overview. For features of the user subscription mode, see also the blog post.

Batch service mode

  1. Sign in to the Azure portal.
  2. Click New > Compute > Batch Service.

    Batch in the Marketplace

  3. The New Batch Account blade is displayed. See the descriptions below of each blade element.

    Create a Batch account

    a. Account name: The Batch account 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: Select 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 more details.

  4. Click Create to create the account.

    The portal indicates deployment is in progress. Upon completion, a Deployments succeeded notification appears in Notifications.

User subscription mode

Allow Azure Batch to access the subscription (one-time operation)

When creating your first Batch account in user subscription mode, perform the following steps to register your subscription with Batch. (If you previously did this, skip to the next section.)

  1. Sign in to the Azure portal.

  2. Click More Services > Subscriptions, and click the subscription you want to use for the Batch account.

  3. In the Subscription blade, click Access control (IAM) > Add.

    Subscription access control

  4. On the Add permissions blade, select the Contributor role, search for the Batch API. Search for each of these strings until you find the API:

    1. MicrosoftAzureBatch.
    2. Microsoft Azure Batch. Newer Azure AD tenants may use this name.
    3. ddbf3205-c6bd-46ae-8127-60eb93363864 is the ID for the Batch API.
  5. Once you find the Batch API, select it and click Save.

    Add Batch permissions

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.

  1. In the Azure portal, click New > Security + Identity > Key Vault.

  2. In the Create Key Vault blade, 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.

Create a Batch account

  1. In the Azure portal, click New > Compute > Batch Service.

    Batch in the Marketplace

  2. The New Batch Account blade is displayed. See the descriptions below of each blade element.

    Create a Batch account

    a. Account name: The Batch account 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: If you have more than one subscription, select the subscription that you registered with the Batch service.

    c. Pool allocation mode: Select User subscription.

    d. Key vault: Select the key vault you created for your Batch account in the previous section. Optionally, create a new key vault. After selecting the vault, select the checkbox to grant Azure Batch access to the key vault.

    c. Resource group: Select the resource group in which you created the key vault.

    d. Location: The Azure region in which you created the key vault for the Batch account.

    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 below for more details.

  3. Click Create to create the account.

    The portal indicates deployment is in progress. Upon completion, a Deployments succeeded notification appears in Notifications.

View Batch account properties

Once the account has been created, you can open the Batch account blade to access its settings and properties. You can access all account settings and properties by using the left menu of the Batch account blade.

Batch account blade in Azure portal

  • Batch account URL: When you develop an application with the Batch APIs, you'll need an account URL to access your Batch resources. A Batch account URL has the following format:

    https://<account_name>.<region>.batch.azure.com

Batch account URL in portal

  • Access keys (Batch service mode): To authenticate access to your Batch account from your application, you'll need an account access key. (This setting is not available in user subscription mode, where you use Azure Active Directory authentication.)

    To view or regenerate your Batch account's access keys, enter keys in the left menu Search box on the Batch account blade, then select Keys.

    Batch account keys in Azure portal

Pricing

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.

Low-priority VMs can significantly reduce the cost of Batch workloads. For information about pricing for low-priority VMs, see Batch Pricing.

Linked Azure Storage account

You can optionally link a general-purpose Azure Storage account to your Batch account. 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.

Creating a general-purpose storage account

Note

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.

Warning

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 blade. 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.

Regenerating storage account keys

Batch service quotas and limits

Please be aware that 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 the portal in the account Properties.

Batch account quotas in Azure portal

Additionally, many of these quotas can be increased simply 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 also create and manage Batch accounts with the following:

Next steps

  • 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 that enable large-scale compute workload execution.
  • 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.