Package: azure-batch
Microsoft Azure SDK for PythonThis is the Microsoft Azure Batch Client Library.This package has been tested with Python 3.6+For a more complete set of Azure libraries, seehttps://aka.ms/azsdk/python/allUsageFor code examples, seethe Batch samples repoon GitHub or seeBatchon docs.microsoft.com.Provide FeedbackIf you encounter any bugs or have suggestions, please file an issue in theIssuessection of the project.Release History14.1.0 (2023-11-01)Features AddedAdded 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.AddedresourceTagsproperty toPoolSpecificationdefinitionAddedresourceTagsproperty toCloudPooldefinitionAddedSecurityProfilesupport 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.AddedserviceArtifactReferenceandsecurityProfileproperty toVirtualMachineConfigurationdefinitionAddedServiceArtifactReferenceandOSDisksupport to Pool CreationAddedstandardssd_lrsvalue toStorageAccountTypeenumAddedcaching,managedDisk,diskSizeGB, andwriteAcceleratorEnabledproperty toNodePlacementPolicyTypedefinitionAddedscaleSetVmResourceIDproperty toVirtualMachineInfodefinition14.0.0 (2023-05-01)Features AddedAdded boolean propertyenableAcceleratedNetworkingtoNetworkConfiguration.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 propertyenableAutomaticUpgradetoVMExtension.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 propertytypetoContainerConfiguration. Possible values include:dockerCompatibleandcriCompatible.Breaking ChangesRemoved lifetime statistics API. This API is no longer supported.Removedjob.get_all_lifetime_statisticsAPI.Removedpool.get_all_lifetime_statisticsAPI.Other ChangesDeprecatingCertificateOperationsrelated methods.This operation is deprecating and will be removed after February 2024. Please useAzure KeyVault Extensioninstead.13.0.0 (2022-11-08)Features AddedAdded new custom enum typeNodeCommunicationMode.This property determines how a pool communicates with the Batch service.Possible values: Default, Classic, Simplified.Added propertiescurrent_node_communication_modeandtarget_node_communication_modeof typeNodeCommunicationModetoCloudPool.Added propertytarget_node_communication_modeof typeNodeCommunicationModetoPoolSpecification,PoolAddParameter,PoolPatchParameter, andPoolUpdatePropertiesParameter.12.0.0 (2022-02-01)FeaturesAdded property uploadHeaders toOutputFileBlobContainerDestination.Allows users to set custom HTTP headers on resource file uploads.Array of type HttpHeader (also being added).Added boolean propertyallow_task_preemptiontoJobSpecification,CloudJob,JobAddParameter,JobPatchParameter,JobUpdateParameterMark 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:https://docs.microsoft.com/azure/batch/nodes-and-poolshttps://docs.microsoft.com/azure/batch/batch-spot-vms11.0.0 (2021-07-30)FeaturesAdd ability to assign user-assigned managed identities toCloudPool. These identities will be made available on each node in the pool, and can be used to access various resources.Addedidentity_referenceproperty to the following models to support accessing resources via managed identity:AzureBlobFileSystemConfigurationOutputFileBlobContainerDestinationContainerRegistryResourceFileUploadBatchServiceLogsConfigurationAdded newcompute_node_extensionoperations toBatchServiceClientfor getting/listing VM extensions on a nodeAdded newextensionsproperty toVirtualMachineConfigurationonCloudPoolto specify virtual machine extensions for nodesAdded the ability to specify availability zones using a new propertynode_placement_configurationonVirtualMachineConfigurationAdded newos_diskproperty toVirtualMachineConfiguration, which contains settings for the operating system disk of the Virtual Machine.Theplacementproperty 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.Addedmax_parallel_tasksproperty onCloudJobto control the maximum allowed tasks per job (defaults to -1, meaning unlimited).Addedvirtual_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 propertymaxTasksPerNodewithtaskSlotsPerNodeon 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 ofGetTaskCountsto returnTaskCountsResult, which is a complex object containing the previousTaskCountsobject and a newTaskSlotCountsobject providing similar information in the context of slots being used.Added propertyrequiredSlotsto the task allowing user to specify how many slots on a node it should take up.9.0.0 (2020-03-24)FeaturesAdded ability to encryptComputeNodedisk drives using the newdisk_encryption_configurationproperty ofVirtualMachineConfiguration.[Breaking]Thevirtual_machine_idproperty ofImageReferencecan now only refer to a Shared Image Gallery image.[Breaking]Pools can now be provisioned without a public IP using the newpublic_ip_address_configurationproperty ofNetworkConfiguration.Thepublic_ipsproperty ofNetworkConfigurationhas moved in topublic_ip_address_configurationas well. This property can only be specified ifip_provisioning_typeisUserManaged.REST API versionThis 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 onNetworkConfigurationvia 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 themount_configurationproperty onCloudPool.Shared Image Gallery images can now be specified on thevirtual_machine_image_idproperty ofImageReferenceby referencing the image via its ARM ID.BreakingWhen not specified, the default value forwait_for_successonStartTaskis nowTrue(wasFalse).BreakingWhen not specified, the default value forscopeonAutoUserSpecificationis now alwaysPool(wasTaskon Windows nodes,Poolon Linux nodes).7.0.0 (2019-6-11)Using REST API version 2019-06-01.9.0.BreakingReplacedAccountOperations.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 aCloudPoolbased 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 theworking_directoryproperty onTaskContainerSettings.6.0.1 (2019-2-26)Fix bug in TaskOperations.add_collection methods exception handling6.0.0 (2018-12-14)Using REST API version 2018-12-01.8.0.BreakingRemoved support for theupgrade_osAPI onCloudServiceConfigurationpools.RemovedPoolOperations.upgrade_osAPI.Renamedtarget_os_versiontoos_versionand removedcurrent_os_versiononCloudServiceConfiguration.Removedupgradingstate fromPoolStateenum.BreakingRemoveddata_egress_gi_banddata_ingress_gi_bfromPoolUsageMetrics. These properties are no longer supported.BreakingResourceFile improvementsAdded the ability specify an entire Azure Storage container inResourceFile. There are now three supported modes forResourceFile:http_urlcreates aResourceFilepointing to a single HTTP URL.storage_container_urlcreates aResourceFilepointing to the blobs under an Azure Blob Storage container.auto_storage_container_namecreates aResourceFilepointing to the blobs under an Azure Blob Storage container in the Batch registered auto-storage account.URLs provided toResourceFilevia thehttp_urlproperty can now be any HTTP URL. Previously, these had to be an Azure Blob Storage URL.The blobs under the Azure Blob Storage container can be filtered byblob_prefixproperty.BreakingRemovedos_diskproperty fromVirtualMachineConfiguration. This property is no longer supported.Pools which set thedynamic_vnet_assignment_scopeonNetworkConfigurationto beDynamicVNetAssignmentScope.jobcan now dynamically assign a Virtual Network to each node the job's tasks run on. The specific Virtual Network to join the nodes to is specified in the newnetwork_configurationproperty onCloudJobandJobSpecification.Note: This feature is in public preview. It is disabled for all Batch accounts except for those which have contacted us and requested to be in the pilot.The maximum lifetime of a task is now 180 days (previously it was 7).Added support on Windows pools for creating users with a specific login mode (eitherbatchorinteractive) viaWindowsUserConfiguration.login_mode.The default task retention time for all tasks is now 7 days, previously it was infinite.BreakingRenamed thebase_urlparameter tobatch_urlonBatchServiceClientclass, and it is required now.5.1.1 (2018-10-16)BugfixesFix authentication class to allow HTTP session to be re-usedNoteazure-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)5.1.0 (2018-08-28)Update operation TaskOperations.add_collection with the following added functionality:Retry server side errors.Automatically chunk lists of more than 100 tasks to multiple requests.If tasks are too large to be submitted in chunks of 100, reduces number of tasks per request.Add a parameter to specify number of threads to use when submitting tasks.5.0.0 (2018-08-24)Using REST API version 2018-08-01.7.0.Addednode_agent_infoin ComputeNode to return the node agent informationBreakingRemoved thevalidation_statusproperty fromTaskCounts.BreakingThe default caching type forDataDiskandOSDiskis nowread_writeinstead ofnone.BatchServiceClientcan be used as a context manager to keep the underlying HTTP session open for performance.BreakingModel signatures are now using only keywords-arguments syntax. Each positional argument must be rewritten as a keyword argument.BreakingThe following operations signatures are changed:Operation PoolOperations.enable_auto_scaleOperation TaskOperations.updateOperation ComputeNodeOperations.reimageOperation ComputeNodeOperations.disable_schedulingOperation ComputeNodeOperations.rebootOperation JobOperations.terminateEnum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.4.1.3 (2018-04-24)Update some APIs' commentsNew propertyleaving_poolinnode_countstype.4.1.2 (2018-04-23)BugfixesCompatibility of the sdist with wheel 0.31.0Compatibility with msrestazure 0.4.284.1.1 (2018-03-26)Fix regression on methodenable_auto_scale.4.1.0 (2018-03-07)Using REST API version 2018-03-01.6.1.Added the ability to query pool node counts by state, via the newlist_pool_node_countsmethod.Added the ability to upload Azure Batch node agent logs from a particular node, via theupload_batch_service_logsmethod.This is intended for use in debugging by Microsoft support when there are problems on a node.4.0.0 (2017-09-25)Using REST API version 2017-09-01.6.0.Added the ability to get a discount on Windows VM pricing if you have on-premises licenses for the OS SKUs you are deploying, vialicense_typeonVirtualMachineConfiguration.Added support for attaching empty data drives toVirtualMachineConfigurationbased pools, via the newdata_disksattribute onVirtualMachineConfiguration.BreakingCustom images must now be deployed using a reference to an ARM Image, instead of pointing to .vhd files in blobs directly.The newvirtual_machine_image_idproperty onImageReferencecontains the reference to the ARM Image, andOSDisk.image_urisno longer exists.Because of this,image_referenceis now a required attribute ofVirtualMachineConfiguration.BreakingMulti-instance tasks (created usingMultiInstanceSettings) must now specify acoordination_commandLine, andnumber_of_instancesis now optional and defaults to 1.Added support for tasks run using Docker containers. To run a task using a Docker container you must specify acontainer_configurationon theVirtualMachineConfigurationfor a pool, and then addcontainer_settingson the Task.3.1.0 (2017-07-24)Added a new operationjob.get_task_countsto retrieve the number of tasks in each state.Added suuport for inbound endpoint configuration on a pool - there is a newpool_endpoint_configurationattribute onNetworkConfiguration.
This property is only supported on pools that usevirtual_machine_configuration.AComputeNodenow also has anendpoint_configurationattribute with the details of the applied endpoint configuration for that node.3.0.0 (2017-05-10)Added support for the new low-priority node type;AddPoolParameterandPoolSpecificationnow have an additional propertytarget_low_priority_nodes.target_dedicatedandcurrent_dedicatedonCloudPool,AddPoolParameterandPoolSpecificationhave been renamed totarget_dedicated_nodesandcurrent_dedicated_nodes.resize_erroronCloudPoolis now a collection calledresize_errors.Added a newis_dedicatedproperty onComputeNode, which isfalsefor low-priority nodes.Added a newallow_low_priority_nodeproperty toJobManagerTask, which iftrueallows theJobManagerTaskto run on a low-priority compute node.PoolResizeParameternow takes two optional parameters,target_dedicated_nodesandtarget_low_priority_nodes, instead of one required parametertarget_dedicated.
At least one of these two parameters must be specified.Added support for uploading task output files to persistent storage, via theOutputFilesproperty onCloudTaskandJobManagerTask.Added support for specifying actions to take based on a task's output file upload status, via thefile_upload_errorproperty onExitConditions.Added support for determining if a task was a success or a failure via the newresultproperty on all task execution information objects.Renamedscheduling_erroron all task execution information objects tofailure_information.TaskFailureInformationreplacesTaskSchedulingErrorand is returned any
time there is a task failure. This includes all previous scheduling error cases, as well as nonzero task exit codes, and file upload failures from the new output files feature.RenamedSchedulingErrorCategoryenum toErrorCategory.Renamedscheduling_erroronExitConditionstopre_processing_errorto more clearly clarify when the error took place in the task life-cycle.Added support for provisioning application licenses to your pool, via a newapplication_licensesproperty onPoolAddParameter,CloudPoolandPoolSpecification.
Please note that this feature is in gated public preview, and you must request access to it via a support ticket.Thessh_private_keyattribute of aUserAccountobject has been replaced with an expandedLinuxUserConfigurationobject with additional settings for a user ID and group ID of the
user account.Removedunmappedenum state fromAddTaskStatus,CertificateFormat,CertificateVisibility,CertStoreLocation,ComputeNodeFillType,OSType, andPoolLifetimeOptionas they were not ever used.Improved and clarified documentation.2.0.1 (2017-04-19)This wheel package is now built with the azure wheel extension2.0.0 (2017-02-23)AAD token authentication now supported.Some operation names have changed (along with their associated parameter model classes):pool.list_pool_usage_metrics -> pool.list_usage_metricspool.get_all_pools_lifetime_statistics -> pool.get_all_lifetime_statisticsjob.get_all_jobs_lifetime_statistics -> job.get_all_lifetime_statisticsfile.get_node_file_properties_from_task -> file.get_properties_from_taskfile.get_node_file_properties_from_compute_node -> file.get_properties_from_compute_nodeThe attribute 'file_name' in relation to file operations has been renamed to 'file_path'.Change in naming convention for enum values to use underscores: e.g. StartTaskState.waitingforstarttask -> StartTaskState.waiting_for_start_task.Support for running tasks under a predefined or automatic user account. This includes tasks, job manager tasks, job preparation and release tasks and pool start tasks. This feature replaces the previous 'run_elevated' option on a task.Tasks now have an optional scoped authentication token (only applies to tasks and job manager tasks).Support for creating pools with a list of user accounts.Support for creating pools using a custom VM image (only supported on accounts created with a "User Subscription" pool allocation mode).1.1.0 (2016-09-15)Added support for task reactivation1.0.0 (2016-08-09)Added support for joining a CloudPool to a virtual network on using the network_configuration property.Added support for application package references on CloudTask and JobManagerTask.Added support for automatically terminating jobs when all tasks complete or when a task fails, via the on_all_tasks_complete property and
the CloudTask exit_conditions property.0.30.0rc5Initial Release