azure-batch
Microsoft Azure Batch Client Library for Python
Description
Microsoft Azure SDK for Python
This is the Microsoft Azure Batch Client Library.
This package has been tested with Python 3.6+
For a more complete set of Azure libraries, see https://aka.ms/azsdk/python/all
Usage
For code examples, see the Batch samples repo on GitHub or see Batch on docs.microsoft.com.
Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.

Release History
14.2.0 (2024-02-01)
Features Added
- Added
UpgradePolicytoCloudPooldefinition for pool creation- Added
AutomaticOSUpgradePolicyto include configuration parameters for automatic OS upgrades - Added
RollingUpgradePolicyto include configuration parameters for rolling upgrades
- Added
14.1.0 (2023-11-01)
Features Added
-
Added ResourceTags support to Pool Creation so users are able to specify resource tags for a pool. This feature is currently only supported for pool creation but will be updatable in the future.
- Added
resourceTagsproperty toPoolSpecificationdefinition - Added
resourceTagsproperty toCloudPooldefinition
- Added
-
Added
SecurityProfilesupport to Pool Creation. Trusted Launch provides advanced security to Guest OS preventing boot-kits/rootkits (like un-signed driver or kernel modification) to be introduced into boot-chain.- Added
serviceArtifactReferenceandsecurityProfileproperty toVirtualMachineConfigurationdefinition
- Added
-
Added
ServiceArtifactReferenceandOSDisksupport to Pool Creation- Added
standardssd_lrsvalue toStorageAccountTypeenum - Added
caching,managedDisk,diskSizeGB, andwriteAcceleratorEnabledproperty toNodePlacementPolicyTypedefinition - Added
scaleSetVmResourceIDproperty toVirtualMachineInfodefinition
- Added
14.0.0 (2023-05-01)
Features Added
- Added boolean property
enableAcceleratedNetworkingtoNetworkConfiguration.- This property determines whether this pool should enable accelerated networking, with default value as False.
- Whether this feature can be enabled is also related to whether an operating system/VM instance is supported, which should align with AcceleratedNetworking Policy (AcceleratedNetworking Limitations and constraints).
- Added boolean property
enableAutomaticUpgradetoVMExtension.- This property determines whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available.
- Added a new property
typetoContainerConfiguration. Possible values include:dockerCompatibleandcriCompatible.
Breaking Changes
- Removed lifetime statistics API. This API is no longer supported.
- Removed
job.get_all_lifetime_statisticsAPI. - Removed
pool.get_all_lifetime_statisticsAPI.
- Removed
Other Changes
- Deprecating
CertificateOperationsrelated methods.- This operation is deprecating and will be removed after February 2024. Please use Azure KeyVault Extension instead.
13.0.0 (2022-11-08)
Features Added
- Added new custom enum type
NodeCommunicationMode.- This property determines how a pool communicates with the Batch service.
- Possible values: Default, Classic, Simplified.
- Added properties
current_node_communication_modeandtarget_node_communication_modeof typeNodeCommunicationModetoCloudPool. - Added property
target_node_communication_modeof typeNodeCommunicationModetoPoolSpecification,PoolAddParameter,PoolPatchParameter, andPoolUpdatePropertiesParameter.
12.0.0 (2022-02-01)
Features
- Added property uploadHeaders to
OutputFileBlobContainerDestination.- Allows users to set custom HTTP headers on resource file uploads.
- Array of type HttpHeader (also being added).
- Added boolean property
allow_task_preemptiontoJobSpecification,CloudJob,JobAddParameter,JobPatchParameter,JobUpdateParameter- Mark Tasks as preemptible for higher priority Tasks (requires Comms-Enabled or Single Tenant Pool).
- Replaced comment (title, description, etc.) references of "low-priority" with "Spot/Low-Priority", to reflect new service behavior.
- No API change required.
- Low-Priority Compute Nodes (VMs) will continue to be used for User Subscription pools (and only User Subscription pools), as before.
- Spot Compute Nodes (VMs) will now be used for Batch Managed (and only Batch Managed pools) pools.
- Relevant docs:
11.0.0 (2021-07-30)
Features
- Add ability to assign user-assigned managed identities to
CloudPool. These identities will be made available on each node in the pool, and can be used to access various resources. - Added
identity_referenceproperty to the following models to support accessing resources via managed identity:AzureBlobFileSystemConfigurationOutputFileBlobContainerDestinationContainerRegistryResourceFileUploadBatchServiceLogsConfiguration
- Added new
compute_node_extensionoperations toBatchServiceClientfor getting/listing VM extensions on a node - Added new
extensionsproperty toVirtualMachineConfigurationonCloudPoolto specify virtual machine extensions for nodes - Added the ability to specify availability zones using a new property
node_placement_configurationonVirtualMachineConfiguration - Added new
os_diskproperty toVirtualMachineConfiguration, which contains settings for the operating system disk of the Virtual Machine.- The
placementproperty onDiffDiskSettingsspecifies the ephemeral disk placement for operating system disks for all VMs in the pool. Setting it to "CacheDisk" will store the ephemeral OS disk on the VM cache.
- The
- Added
max_parallel_tasksproperty onCloudJobto control the maximum allowed tasks per job (defaults to -1, meaning unlimited). - Added
virtual_machine_infoproperty onComputeNodewhich contains information about the current state of the virtual machine, including the exact version of the marketplace image the VM is using.
10.0.0 (2020-09-01)
Features
- [Breaking] Replaced property
maxTasksPerNodewithtaskSlotsPerNodeon the pool. Using this property tasks in a job can consume a dynamic amount of slots allowing for more fine-grained control over resource consumption. - [Breaking] Changed the response type of
GetTaskCountsto returnTaskCountsResult, which is a complex object containing the previousTaskCountsobject and a newTaskSlotCountsobject providing similar information in the context of slots being used. - Added property
requiredSlotsto the task allowing user to specify how many slots on a node it should take up.
9.0.0 (2020-03-24)
Features
- Added ability to encrypt
ComputeNodedisk drives using the newdisk_encryption_configurationproperty ofVirtualMachineConfiguration. - [Breaking] The
virtual_machine_idproperty ofImageReferencecan now only refer to a Shared Image Gallery image. - [Breaking] Pools can now be provisioned without a public IP using the new
public_ip_address_configurationproperty ofNetworkConfiguration.- The
public_ipsproperty ofNetworkConfigurationhas moved in topublic_ip_address_configurationas well. This property can only be specified ifip_provisioning_typeisUserManaged.
- The
REST API version
This version of the Batch .NET client library targets version 2020-03-01.11.0 of the Azure Batch REST API.
8.0.0 (2019-8-5)
- Using REST API version 2019-08-01.10.0.
- Added ability to specify a collection of public IPs on
NetworkConfigurationvia the newpublic_ipsproperty. This guarantees nodes in the Pool will have an IP from the list user provided IPs. - Added ability to mount remote file-systems on each node of a pool via the
mount_configurationproperty onCloudPool. - Shared Image Gallery images can now be specified on the
virtual_machine_image_idproperty ofImageReferenceby referencing the image via its ARM ID. - Breaking When not specified, the default value for
wait_for_successonStartTaskis nowTrue(wasFalse). - Breaking When not specified, the default value for
scopeonAutoUserSpecificationis now alwaysPool(wasTaskon Windows nodes,Poolon Linux nodes).
- Added ability to specify a collection of public IPs on
7.0.0 (2019-6-11)
- Using REST API version 2019-06-01.9.0.
- Breaking Replaced
AccountOperations.list_node_agent_skuswithAccountOperations.list_supported_images.list_supported_imagescontains all of the same information originally available inlist_node_agent_skusbut in a clearer format. New non-verified images are also now returned. Additional information aboutcapabilitiesandbatch_support_end_of_lifeis accessible on theImageInformationobject returned bylist_supported_images. - Now support network security rules blocking network access to a
CloudPoolbased on the source port of the traffic. This is done via thesource_port_rangesproperty onnetwork_security_group_rules. - When running a container, Batch now supports executing the task in the container working directory or in the Batch task working directory. This is controlled by the
working_directoryproperty onTaskContainerSettings.
- Breaking Replaced
6.0.1 (2019-2-26)
- Fix bug in TaskOperations.add_collection methods exception handling