Batch 帐户和 Azure 存储帐户Batch accounts and Azure Storage accounts

Azure Batch 帐户是 Batch 服务中唯一标识的实体。An Azure Batch account is a uniquely identified entity within the Batch service. 大多数 Batch 解决方案使用 Azure 存储来存储资源文件和输出文件,因此,每个批处理帐户通常与相应的存储帐户相关联。Most Batch solutions use Azure Storage for storing resource files and output files, so each Batch account is usually associated with a corresponding storage account.

批处理帐户Batch accounts

所有处理和资源都与一个 Batch 帐户相关联。All processing and resources are associated with a Batch account. 当应用程序针对 Batch 服务提出请求时,会使用 Azure Batch 帐户名称、帐户的 URL 以及访问密钥或 Azure Active Directory 令牌对请求进行身份验证。When your application makes a request against the Batch service, it authenticates the request using the Azure Batch account name, the URL of the account, and either an access key or an Azure Active Directory token.

可以在单个 Batch 帐户中运行多个 Batch 工作负荷。You can run multiple Batch workloads in a single Batch account. 还可以在相同订阅的不同 Azure 区域的 Batch 帐户之间分散工作负荷。You can also distribute your workloads among Batch accounts that are in the same subscription but located in different Azure regions.

备注

创建 Batch 帐户时,可在两种“池分配”模式间进行选择:“用户订阅”和“Batch 服务”。When creating a Batch account, you can choose between two pool allocation modes: user subscription and Batch service. 在大部分情况下,应使用默认的 Batch 服务模式,使用此模式时,池在 Azure 托管的订阅中以幕后方式分配。For most cases, you should use the default Batch service mode, in which pools are allocated behind the scenes in Azure-managed subscriptions. 在备用的“用户订阅”模式下,会在创建池后直接在订阅中创建 Batch VM 和其他资源。In the alternative user subscription mode, Batch VMs and other resources are created directly in your subscription when a pool is created. 如果想要使用 Azure 虚拟机预留实例创建 Batch 池,则需要使用“用户订阅”模式。User subscription mode is required if you want to create Batch pools using Azure Reserved VM Instances. 若要在用户订阅模式下创建 Batch 帐户,还需将订阅注册到 Azure Batch 中,并将该帐户与 Azure Key Vault 相关联。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.

可以通过 Azure 门户或编程方式(例如使用批处理管理 .NET 库)创建 Batch 帐户。You can create a Batch account using the Azure portal or programmatically, such as with the Batch Management .NET library. 创建该帐户时,可以关联一个 Azure 存储帐户,用于存储与作业相关的输入和输出数据或应用程序。When creating the account, you can associate an Azure storage account for storing job-related input and output data or applications.

Azure 存储帐户Azure Storage accounts

大多数 Batch 解决方案使用 Azure 存储来存储资源文件和输出文件。Most Batch solutions use Azure Storage for storing resource files and output files. 例如,Batch 任务(包括标准任务、启动任务、作业准备任务和作业释放任务)通常指定位于存储帐户中的资源文件。For example, your Batch tasks (including standard tasks, start tasks, job preparation tasks, and job release tasks) typically specify resource files that reside in a storage account. 存储帐户还会存储处理的数据和生成的任何输出数据。Storage accounts also stores that data that is processed and any output data that is generated.

Batch 支持以下类型的 Azure 存储帐户:Batch supports the following types of Azure Storage accounts:

  • 常规用途 v2 (GPv2) 帐户General-purpose v2 (GPv2) accounts
  • 常规用途 v1 (GPv1) 帐户General-purpose v1 (GPv1) accounts
  • Blob 存储帐户(目前支持虚拟机配置中的池)Blob storage accounts (currently supported for pools in the Virtual Machine configuration)

有关存储帐户的详细信息,请参阅 Azure 存储帐户概述For more information about storage accounts, see Azure storage account overview.

创建 Batch 帐户时可以将存储帐户与 Batch 帐户关联,也可以稍后关联。You can associate a storage account with your Batch account when you create the Batch account, or later. 选择存储帐户时,请考虑成本和性能要求。Consider your cost and performance requirements when choosing a storage account. 例如,与 GPv1 相比,GPv2 和 blob 存储帐户选项支持更大的容量和可伸缩性限制For example, the GPv2 and blob storage account options support greater capacity and scalability limits compared with GPv1. (请联系 Azure 支持以请求提高存储上限。)对于包含大量读取或写入存储帐户的并行任务的 Batch 解决方案,这些帐户选项可以提高其性能。(Contact Azure Support to request an increase in a storage limit.) These account options can improve the performance of Batch solutions that contain a large number of parallel tasks that read from or write to the storage account.

后续步骤Next steps