Microsoft。批次帳目 2025-06-01

Bicep 資源定義

batchAccounts 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱變更記錄檔。

使用範例

Bicep 範例

部署 Azure Batch 帳戶的基本範例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource batchAccount 'Microsoft.Batch/batchAccounts@2022-10-01' = {
  name: resourceName
  location: location
  properties: {
    encryption: {
      keySource: 'Microsoft.Batch'
    }
    poolAllocationMode: 'BatchService'
    publicNetworkAccess: 'Enabled'
  }
}

Azure 已驗證的模組

下列 Azure 驗證模組 可用來部署此資源類型。

模組 Description
Batch 帳戶 Batch 帳戶的AVM資源模組

Azure 快速入門範例

下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。

Bicep 檔案 Description
沒有公用IP位址的 Azure Batch 集區 此範本會建立 Azure Batch 簡化的節點通訊集區,而不需要公用 IP 位址。
使用範本建立 Batch 帳戶 此範本會建立 Batch 帳戶和記憶體帳戶。

資源格式

若要建立 Microsoft.Batch/batchAccounts 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Batch/batchAccounts@2025-06-01' = {
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  location: 'string'
  name: 'string'
  properties: {
    allowedAuthenticationModes: [
      'string'
    ]
    autoStorage: {
      authenticationMode: 'string'
      nodeIdentityReference: {
        resourceId: 'string'
      }
      storageAccountId: 'string'
    }
    encryption: {
      keySource: 'string'
      keyVaultProperties: {
        keyIdentifier: 'string'
      }
    }
    keyVaultReference: {
      id: 'string'
      url: 'string'
    }
    networkProfile: {
      accountAccess: {
        defaultAction: 'string'
        ipRules: [
          {
            action: 'Allow'
            value: 'string'
          }
        ]
      }
      nodeManagementAccess: {
        defaultAction: 'string'
        ipRules: [
          {
            action: 'Allow'
            value: 'string'
          }
        ]
      }
    }
    poolAllocationMode: 'string'
    publicNetworkAccess: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

Microsoft.Batch/batchAccounts

名稱 Description 價值觀
身分識別 Batch 帳戶的身分識別。 BatchAccountIdentity (批量帳戶身份)
位置 要在其中建立帳戶的區域。 字串 (必要)
名稱 資源名稱 string

約束:
最小長度 = 3
最大長度 = 24
模式 = ^[a-zA-Z0-9]+$ (必要)
properties Batch 帳戶的屬性。 BatchAccountCreatePropertiesOrBatchAccountProperties
tags 資源標籤 標記名稱和值的字典。 請參閱範本中的標籤

AutoStorageBasePropertiesOrAutoStorageProperties

名稱 Description 價值觀
authenticationMode Batch 服務將用來管理自動記憶體帳戶的驗證模式。 “BatchAccountManagedIdentity”
“StorageKeys”
nodeIdentity引用 此處參考的身分識別必須指派給具有需要存取自動記憶體之計算節點的集區。 ComputeNodeIdentity引用
storageAccountId 要用於自動記憶體帳戶之記憶體帳戶的記憶體帳戶的資源識別碼。 字串 (必要)

BatchAccountCreateParameters標籤

名稱 Description 價值觀

BatchAccountCreatePropertiesOrBatchAccountProperties

名稱 Description 價值觀
allowedAuthenticationModes Batch 帳戶允許的驗證模式清單,可用來向數據平面進行驗證。 這不會影響控制平面的驗證。 包含任何的字串數組:
“AAD”
“共用金鑰”
'TaskAuthenticationToken'
autoStorage 與自動記憶體帳戶相關的屬性。 AutoStorageBasePropertiesOrAutoStorageProperties
加密 設定客戶數據在 Batch 帳戶內加密的方式。 根據預設,帳戶會使用Microsoft受控密鑰來加密。 如需其他控制,可以改用客戶管理的密鑰。 EncryptionProperties
keyVault引用 與 Batch 帳戶相關聯的 Azure 金鑰保存庫參考。 KeyVaultReference
網路簡介 只有在啟用 publicNetworkAccess 時,網路配置檔才會生效。 NetworkProfile
poolAllocationMode (池分配模式) 集區配置模式也會影響用戶端如何向 Batch 服務 API 進行驗證。 如果模式為 BatchService,用戶端可以使用存取金鑰或Microsoft Entra 識別碼進行驗證。 如果模式為 UserSubscription,客戶端必須使用Microsoft Entra ID。 預設值為 BatchService。 “BatchService”
'UserSubscription'
公共網路存取 在 Batch 帳戶中的資源上操作的網路存取類型。 “已禁用”
“已啟用”
“SecuredByPerimeter”

BatchAccountIdentity (批量帳戶身份)

名稱 Description 價值觀
型別 用於 Batch 帳戶的身分識別類型。 'None'
'SystemAssigned'
'UserAssigned' (必要)
userAssignedIdentities 與 Batch 帳戶相關聯的使用者身分識別清單。 BatchAccountIdentityUserAssignedIdentities

BatchAccountIdentityUserAssignedIdentities

名稱 Description 價值觀

ComputeNodeIdentity引用

名稱 Description 價值觀
resourceId 使用者指派身分識別的 ARM 資源識別碼。 字串

加密屬性

名稱 Description 價值觀
keySource (金鑰源) 金鑰來源的類型。 “Microsoft.Batch”
“Microsoft.KeyVault”
keyVaultProperties 使用 Microsoft.KeyVault 時的其他詳細數據 KeyVaultProperties

EndpointAccessProfile

名稱 Description 價值觀
defaultAction 端點存取的預設動作。 只有在啟用 publicNetworkAccess 時才適用。 'Allow'
'拒絕' (必要)
ipRules 篩選用戶端 IP 位址的 IP 範圍數位。 IPRule[]

IPRule

名稱 Description 價值觀
動作 比對用戶端IP位址時的動作。 '允許' (必要)
value IPv4 位址或 CIDR 格式的 IPv4 位址範圍。 字串 (必要)

KeyVaultProperties

名稱 Description 價值觀
keyIdentifier 具有或不含版本之秘密的完整路徑。 範例 https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053。 或 https://mykeyvault.vault.azure.net/keys/testkey。 若要可供使用,必須符合下列必要條件:

Batch 帳戶具有系統指派的身分識別
帳戶身分識別已獲得金鑰/取得、金鑰/解除包裝和密鑰/包裝許可權
KeyVault 已啟用虛刪除和清除保護
字串

KeyVaultReference

名稱 Description 價值觀
識別碼 與 Batch 帳戶相關聯的 Azure 金鑰保存庫資源識別碼。 字串 (必要)
url 與 Batch 帳戶相關聯的 Azure 金鑰保存庫 URL。 字串 (必要)

NetworkProfile

名稱 Description 價值觀
accountAccess 賬戶訪問 batchAccount 端點的網路存取配置檔(Batch 帳戶數據平面 API)。 EndpointAccessProfile
節點管理訪問 nodeManagement 端點的網路存取配置檔(Batch 服務管理 Batch 集區的計算節點)。 EndpointAccessProfile

UserAssignedIdentities

名稱 Description 價值觀

ARM 範本資源定義

batchAccounts 資源類型可以使用目標作業來部署:

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

Template Description
沒有公用IP位址的 Azure Batch 集區

部署至 Azure
此範本會建立 Azure Batch 簡化的節點通訊集區,而不需要公用 IP 位址。
使用範本建立 Batch 帳戶

部署至 Azure
此範本會建立 Batch 帳戶和記憶體帳戶。

資源格式

若要建立 Microsoft.Batch/batchAccounts 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Batch/batchAccounts",
  "apiVersion": "2025-06-01",
  "name": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
      }
    }
  },
  "location": "string",
  "properties": {
    "allowedAuthenticationModes": [ "string" ],
    "autoStorage": {
      "authenticationMode": "string",
      "nodeIdentityReference": {
        "resourceId": "string"
      },
      "storageAccountId": "string"
    },
    "encryption": {
      "keySource": "string",
      "keyVaultProperties": {
        "keyIdentifier": "string"
      }
    },
    "keyVaultReference": {
      "id": "string",
      "url": "string"
    },
    "networkProfile": {
      "accountAccess": {
        "defaultAction": "string",
        "ipRules": [
          {
            "action": "Allow",
            "value": "string"
          }
        ]
      },
      "nodeManagementAccess": {
        "defaultAction": "string",
        "ipRules": [
          {
            "action": "Allow",
            "value": "string"
          }
        ]
      }
    },
    "poolAllocationMode": "string",
    "publicNetworkAccess": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

Microsoft.Batch/batchAccounts

名稱 Description 價值觀
apiVersion API 版本 '2025-06-01'
身分識別 Batch 帳戶的身分識別。 BatchAccountIdentity (批量帳戶身份)
位置 要在其中建立帳戶的區域。 字串 (必要)
名稱 資源名稱 string

約束:
最小長度 = 3
最大長度 = 24
模式 = ^[a-zA-Z0-9]+$ (必要)
properties Batch 帳戶的屬性。 BatchAccountCreatePropertiesOrBatchAccountProperties
tags 資源標籤 標記名稱和值的字典。 請參閱範本中的標籤
型別 資源類型 “Microsoft.Batch/batchAccounts”

AutoStorageBasePropertiesOrAutoStorageProperties

名稱 Description 價值觀
authenticationMode Batch 服務將用來管理自動記憶體帳戶的驗證模式。 “BatchAccountManagedIdentity”
“StorageKeys”
nodeIdentity引用 此處參考的身分識別必須指派給具有需要存取自動記憶體之計算節點的集區。 ComputeNodeIdentity引用
storageAccountId 要用於自動記憶體帳戶之記憶體帳戶的記憶體帳戶的資源識別碼。 字串 (必要)

BatchAccountCreateParameters標籤

名稱 Description 價值觀

BatchAccountCreatePropertiesOrBatchAccountProperties

名稱 Description 價值觀
allowedAuthenticationModes Batch 帳戶允許的驗證模式清單,可用來向數據平面進行驗證。 這不會影響控制平面的驗證。 包含任何的字串數組:
“AAD”
“共用金鑰”
'TaskAuthenticationToken'
autoStorage 與自動記憶體帳戶相關的屬性。 AutoStorageBasePropertiesOrAutoStorageProperties
加密 設定客戶數據在 Batch 帳戶內加密的方式。 根據預設,帳戶會使用Microsoft受控密鑰來加密。 如需其他控制,可以改用客戶管理的密鑰。 EncryptionProperties
keyVault引用 與 Batch 帳戶相關聯的 Azure 金鑰保存庫參考。 KeyVaultReference
網路簡介 只有在啟用 publicNetworkAccess 時,網路配置檔才會生效。 NetworkProfile
poolAllocationMode (池分配模式) 集區配置模式也會影響用戶端如何向 Batch 服務 API 進行驗證。 如果模式為 BatchService,用戶端可以使用存取金鑰或Microsoft Entra 識別碼進行驗證。 如果模式為 UserSubscription,客戶端必須使用Microsoft Entra ID。 預設值為 BatchService。 “BatchService”
'UserSubscription'
公共網路存取 在 Batch 帳戶中的資源上操作的網路存取類型。 “已禁用”
“已啟用”
“SecuredByPerimeter”

BatchAccountIdentity (批量帳戶身份)

名稱 Description 價值觀
型別 用於 Batch 帳戶的身分識別類型。 'None'
'SystemAssigned'
'UserAssigned' (必要)
userAssignedIdentities 與 Batch 帳戶相關聯的使用者身分識別清單。 BatchAccountIdentityUserAssignedIdentities

BatchAccountIdentityUserAssignedIdentities

名稱 Description 價值觀

ComputeNodeIdentity引用

名稱 Description 價值觀
resourceId 使用者指派身分識別的 ARM 資源識別碼。 字串

加密屬性

名稱 Description 價值觀
keySource (金鑰源) 金鑰來源的類型。 “Microsoft.Batch”
“Microsoft.KeyVault”
keyVaultProperties 使用 Microsoft.KeyVault 時的其他詳細數據 KeyVaultProperties

EndpointAccessProfile

名稱 Description 價值觀
defaultAction 端點存取的預設動作。 只有在啟用 publicNetworkAccess 時才適用。 'Allow'
'拒絕' (必要)
ipRules 篩選用戶端 IP 位址的 IP 範圍數位。 IPRule[]

IPRule

名稱 Description 價值觀
動作 比對用戶端IP位址時的動作。 '允許' (必要)
value IPv4 位址或 CIDR 格式的 IPv4 位址範圍。 字串 (必要)

KeyVaultProperties

名稱 Description 價值觀
keyIdentifier 具有或不含版本之秘密的完整路徑。 範例 https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053。 或 https://mykeyvault.vault.azure.net/keys/testkey。 若要可供使用,必須符合下列必要條件:

Batch 帳戶具有系統指派的身分識別
帳戶身分識別已獲得金鑰/取得、金鑰/解除包裝和密鑰/包裝許可權
KeyVault 已啟用虛刪除和清除保護
字串

KeyVaultReference

名稱 Description 價值觀
識別碼 與 Batch 帳戶相關聯的 Azure 金鑰保存庫資源識別碼。 字串 (必要)
url 與 Batch 帳戶相關聯的 Azure 金鑰保存庫 URL。 字串 (必要)

NetworkProfile

名稱 Description 價值觀
accountAccess 賬戶訪問 batchAccount 端點的網路存取配置檔(Batch 帳戶數據平面 API)。 EndpointAccessProfile
節點管理訪問 nodeManagement 端點的網路存取配置檔(Batch 服務管理 Batch 集區的計算節點)。 EndpointAccessProfile

UserAssignedIdentities

名稱 Description 價值觀

Terraform (AzAPI 提供者) 資源定義

batchAccounts 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

部署 Azure Batch 帳戶的基本範例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "batchAccount" {
  type      = "Microsoft.Batch/batchAccounts@2022-10-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      encryption = {
        keySource = "Microsoft.Batch"
      }
      poolAllocationMode  = "BatchService"
      publicNetworkAccess = "Enabled"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

Azure 已驗證的模組

下列 Azure 驗證模組 可用來部署此資源類型。

模組 Description
Batch 帳戶 Batch 帳戶的AVM資源模組

資源格式

若要建立 Microsoft.Batch/batchAccounts 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Batch/batchAccounts@2025-06-01"
  name = "string"
  parent_id = "string"
  identity {
    type = "string"
    identity_ids = [
      "string"
    ]
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      allowedAuthenticationModes = [
        "string"
      ]
      autoStorage = {
        authenticationMode = "string"
        nodeIdentityReference = {
          resourceId = "string"
        }
        storageAccountId = "string"
      }
      encryption = {
        keySource = "string"
        keyVaultProperties = {
          keyIdentifier = "string"
        }
      }
      keyVaultReference = {
        id = "string"
        url = "string"
      }
      networkProfile = {
        accountAccess = {
          defaultAction = "string"
          ipRules = [
            {
              action = "Allow"
              value = "string"
            }
          ]
        }
        nodeManagementAccess = {
          defaultAction = "string"
          ipRules = [
            {
              action = "Allow"
              value = "string"
            }
          ]
        }
      }
      poolAllocationMode = "string"
      publicNetworkAccess = "string"
    }
  }
}

屬性值

Microsoft.Batch/batchAccounts

名稱 Description 價值觀
身分識別 Batch 帳戶的身分識別。 BatchAccountIdentity (批量帳戶身份)
位置 要在其中建立帳戶的區域。 字串 (必要)
名稱 資源名稱 string

約束:
最小長度 = 3
最大長度 = 24
模式 = ^[a-zA-Z0-9]+$ (必要)
properties Batch 帳戶的屬性。 BatchAccountCreatePropertiesOrBatchAccountProperties
tags 資源標籤 標記名稱和值的字典。
型別 資源類型 「Microsoft.Batch/batchAccounts@2025-06-01」

AutoStorageBasePropertiesOrAutoStorageProperties

名稱 Description 價值觀
authenticationMode Batch 服務將用來管理自動記憶體帳戶的驗證模式。 “BatchAccountManagedIdentity”
“StorageKeys”
nodeIdentity引用 此處參考的身分識別必須指派給具有需要存取自動記憶體之計算節點的集區。 ComputeNodeIdentity引用
storageAccountId 要用於自動記憶體帳戶之記憶體帳戶的記憶體帳戶的資源識別碼。 字串 (必要)

BatchAccountCreateParameters標籤

名稱 Description 價值觀

BatchAccountCreatePropertiesOrBatchAccountProperties

名稱 Description 價值觀
allowedAuthenticationModes Batch 帳戶允許的驗證模式清單,可用來向數據平面進行驗證。 這不會影響控制平面的驗證。 包含任何的字串數組:
“AAD”
“共用金鑰”
'TaskAuthenticationToken'
autoStorage 與自動記憶體帳戶相關的屬性。 AutoStorageBasePropertiesOrAutoStorageProperties
加密 設定客戶數據在 Batch 帳戶內加密的方式。 根據預設,帳戶會使用Microsoft受控密鑰來加密。 如需其他控制,可以改用客戶管理的密鑰。 EncryptionProperties
keyVault引用 與 Batch 帳戶相關聯的 Azure 金鑰保存庫參考。 KeyVaultReference
網路簡介 只有在啟用 publicNetworkAccess 時,網路配置檔才會生效。 NetworkProfile
poolAllocationMode (池分配模式) 集區配置模式也會影響用戶端如何向 Batch 服務 API 進行驗證。 如果模式為 BatchService,用戶端可以使用存取金鑰或Microsoft Entra 識別碼進行驗證。 如果模式為 UserSubscription,客戶端必須使用Microsoft Entra ID。 預設值為 BatchService。 “BatchService”
'UserSubscription'
公共網路存取 在 Batch 帳戶中的資源上操作的網路存取類型。 “已禁用”
“已啟用”
“SecuredByPerimeter”

BatchAccountIdentity (批量帳戶身份)

名稱 Description 價值觀
型別 用於 Batch 帳戶的身分識別類型。 'None'
'SystemAssigned'
'UserAssigned' (必要)
userAssignedIdentities 與 Batch 帳戶相關聯的使用者身分識別清單。 BatchAccountIdentityUserAssignedIdentities

BatchAccountIdentityUserAssignedIdentities

名稱 Description 價值觀

ComputeNodeIdentity引用

名稱 Description 價值觀
resourceId 使用者指派身分識別的 ARM 資源識別碼。 字串

加密屬性

名稱 Description 價值觀
keySource (金鑰源) 金鑰來源的類型。 “Microsoft.Batch”
“Microsoft.KeyVault”
keyVaultProperties 使用 Microsoft.KeyVault 時的其他詳細數據 KeyVaultProperties

EndpointAccessProfile

名稱 Description 價值觀
defaultAction 端點存取的預設動作。 只有在啟用 publicNetworkAccess 時才適用。 'Allow'
'拒絕' (必要)
ipRules 篩選用戶端 IP 位址的 IP 範圍數位。 IPRule[]

IPRule

名稱 Description 價值觀
動作 比對用戶端IP位址時的動作。 '允許' (必要)
value IPv4 位址或 CIDR 格式的 IPv4 位址範圍。 字串 (必要)

KeyVaultProperties

名稱 Description 價值觀
keyIdentifier 具有或不含版本之秘密的完整路徑。 範例 https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053。 或 https://mykeyvault.vault.azure.net/keys/testkey。 若要可供使用,必須符合下列必要條件:

Batch 帳戶具有系統指派的身分識別
帳戶身分識別已獲得金鑰/取得、金鑰/解除包裝和密鑰/包裝許可權
KeyVault 已啟用虛刪除和清除保護
字串

KeyVaultReference

名稱 Description 價值觀
識別碼 與 Batch 帳戶相關聯的 Azure 金鑰保存庫資源識別碼。 字串 (必要)
url 與 Batch 帳戶相關聯的 Azure 金鑰保存庫 URL。 字串 (必要)

NetworkProfile

名稱 Description 價值觀
accountAccess 賬戶訪問 batchAccount 端點的網路存取配置檔(Batch 帳戶數據平面 API)。 EndpointAccessProfile
節點管理訪問 nodeManagement 端點的網路存取配置檔(Batch 服務管理 Batch 集區的計算節點)。 EndpointAccessProfile

UserAssignedIdentities

名稱 Description 價值觀