Azure Batch Account

This page shows how to write Terraform and Azure Resource Manager for Batch Account and write them securely.

azurerm_batch_account (Terraform)

The Account in Batch can be configured in Terraform with the resource name azurerm_batch_account. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

craete_batchaccount.tf#L26
resource "azurerm_batch_account" "example" {
  name                 = "jhbatchtest"
  resource_group_name  = azurerm_resource_group.rg.name
  location             = azurerm_resource_group.rg.location
  pool_allocation_mode = "BatchService"
  storage_account_id   = azurerm_storage_account.strg.id
main.tf#L7
resource "azurerm_batch_account" "this" {
  location             = var.location
  name                 = var.name
  pool_allocation_mode = var.pool_allocation_mode
  resource_group_name  = var.resource_group_name
  storage_account_id   = var.storage_account_id
main.tf#L7
resource "azurerm_batch_account" "this" {
  location             = var.location
  name                 = var.name
  pool_allocation_mode = var.pool_allocation_mode
  resource_group_name  = var.resource_group_name
  storage_account_id   = var.storage_account_id
mainDF.tf#L44
resource "azurerm_batch_account" "MDSBatchACCT" {
  name                 = "mdsbatchaccount"
  resource_group_name  = azurerm_resource_group.MDSDATAFAC.name
  location             = azurerm_resource_group.MDSDATAFAC.location
  pool_allocation_mode = "BatchService"
  storage_account_id   = azurerm_storage_account.MDSBatch.id

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an Azure Batch account.

Microsoft.Batch/batchAccounts (Azure Resource Manager)

The batchAccounts in Microsoft.Batch can be configured in Azure Resource Manager with the resource name Microsoft.Batch/batchAccounts. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

Microsoft.Batch.tests.json#L64
        "type": "Microsoft.Batch/batchAccounts",
        "apiVersion": "2015-12-07",
        "properties": {}
      }
    },
    {
Microsoft.Batch.tests.json#L76
        "type": "Microsoft.Batch/batchAccounts",
        "apiVersion": "2015-12-07",
        "name": "name",
        "location": "westus",
        "properties": {}
      }
template.json#L36
            "type": "Microsoft.Batch/batchAccounts",
            "apiVersion": "2021-01-01",
            "name": "[parameters('batchAccounts_batches_name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "None"
Page_Azure_Batch.json#L194
        "propertyValue" : "Microsoft.Batch/batchAccounts",
        "query" : "resource_type:\"Microsoft.Batch/batchAccounts\"",
        "type" : "property",
        "value" : "Microsoft.Batch/batchAccounts"
      }, {
        "NOT" : false,
EthTemplateupdatebaseT.json#L17
            "type": "Microsoft.Batch/batchAccounts",
            "apiVersion": "2021-06-01",
            "name": "[parameters('batchAccounts_abc0682d9_name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "None"
EthTemplateupdate3.json#L17
            "type": "Microsoft.Batch/batchAccounts",
            "apiVersion": "2021-06-01",
            "name": "[parameters('batchAccounts_abc0682d9_name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "None"
EthTemplateupdate2.json#L17
            "type": "Microsoft.Batch/batchAccounts",
            "apiVersion": "2021-06-01",
            "name": "[parameters('batchAccounts_abc0682d9_name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "None"
batch.json#L32
            "type": "Microsoft.Batch/batchAccounts",
            "name": "[parameters('batchAccountName')]",
            "apiVersion": "2017-09-01",
            "dependsOn": [
                "[variables('batchStorageId')]"
            ],
EthTemplateupdatebaseT1.json#L17
            "type": "Microsoft.Batch/batchAccounts",
            "apiVersion": "2021-06-01",
            "name": "[parameters('batchAccounts_abc0682d9_name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "None"
VanEthTemplateupdate.json#L17
            "type": "Microsoft.Batch/batchAccounts",
            "apiVersion": "2021-06-01",
            "name": "[parameters('batchAccounts_abc0682d9_name')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "None"

Parameters

  • apiVersion required - string
  • identity optional
      • type required - string

        The type of identity used for the Batch account.

      • userAssignedIdentities optional - undefined

        The list of user identities associated with the Batch account.

  • location required - string

    The region in which to create the account.

  • name required - string

    A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/.

  • properties required
      • allowedAuthenticationModes optional - array

        List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane.

      • autoStorage optional
          • authenticationMode optional - string

            The authentication mode which the Batch service will use to manage the auto-storage account.

          • nodeIdentityReference optional
              • resourceId optional - string

                The ARM resource id of the user assigned identity.

          • storageAccountId required - string

            The resource ID of the storage account to be used for auto-storage account.

      • encryption optional
          • keySource optional - string

            Type of the key source.

          • keyVaultProperties optional
      • keyVaultReference optional
          • id required - string

            The resource ID of the Azure key vault associated with the Batch account.

          • url required - string

            The URL of the Azure key vault associated with the Batch account.

      • poolAllocationMode optional - string

        The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Azure Active Directory. If the mode is UserSubscription, clients must use Azure Active Directory. The default is BatchService.

      • publicNetworkAccess optional - string

        If not specified, the default value is 'enabled'.

  • tags optional - string

    The user-specified tags associated with the account.

  • type required - string

Frequently asked questions

What is Azure Batch Account?

Azure Batch Account is a resource for Batch of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Batch Account?

For Terraform, the learncloud/Azure, kevinhead/azurerm and niveklabs/azurerm source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the chironconsulting/ARM-Schema-Templates, Azure/autorest.azureresourceschema and PrandoXMR/cryptocloud source code examples are useful. See the Azure Resource Manager Example section for further details.