Pools - Replace Pool Properties
Updates the properties of the specified Pool.
This fully replaces all the updatable properties of the Pool. For example, if
the Pool has a StartTask associated with it and if StartTask is not specified
with this request, then the Batch service will remove the existing StartTask.
POST {endpoint}/pools/{poolId}/updateproperties?api-version=2025-06-01
POST {endpoint}/pools/{poolId}/updateproperties?api-version=2025-06-01&timeOut={timeOut}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
Batch account endpoint (for example: https://batchaccount.eastus2.batch.azure.com). |
|
pool
|
path | True |
string |
The ID of the Pool to update. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
|
time
|
query |
integer (int32) |
The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". |
Request Header
Media Types: "application/json; odata=minimalmetadata"
| Name | Required | Type | Description |
|---|---|---|---|
| client-request-id |
string |
The caller-generated request identity, in the form of a GUID with no decoration such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. |
|
| return-client-request-id |
boolean |
Whether the server should return the client-request-id in the response. |
|
| ocp-date |
string (date-time-rfc7231) |
The time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly. |
Request Body
Media Types: "application/json; odata=minimalmetadata"
| Name | Required | Type | Description |
|---|---|---|---|
| applicationPackageReferences | True |
The list of Application Packages to be installed on each Compute Node in the Pool. The list replaces any existing Application Package references on the Pool. Changes to Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool. |
|
| metadata | True |
A list of name-value pairs associated with the Pool as metadata. This list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool. |
|
| startTask |
A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool. |
Responses
| Name | Type | Description |
|---|---|---|
| 204 No Content |
There is no content to send for this request, but the headers may be useful. Headers
|
|
| Other Status Codes |
An unexpected error response. |
Security
OAuth2Auth
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
| Name | Description |
|---|---|
| https://batch.core.windows.net//.default |
Examples
Pool update
Sample request
POST {endpoint}/pools/poolId/updateproperties?api-version=2025-06-01
{
"startTask": {
"commandLine": "/bin/bash -c 'echo start task'"
},
"applicationPackageReferences": [],
"metadata": []
}
Sample response
Definitions
| Name | Description |
|---|---|
|
Auto |
AutoUserScope enums |
|
Auto |
Specifies the options for the auto user that runs an Azure Batch Task. |
|
Batch |
A reference to an Package to be deployed to Compute Nodes. |
|
Batch |
An error response received from the Azure Batch service. |
|
Batch |
An item of additional information included in an Azure Batch error response. |
|
Batch |
An error message received in an Azure Batch error response. |
|
Batch |
The Batch service does not assign any meaning to this metadata; it is solely for the use of user code. |
|
Batch |
The reference to a user assigned identity associated with the Batch pool which a compute node will use. |
|
Batch |
Parameters for replacing properties on an Azure Batch Pool. |
|
Batch |
Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask. |
|
Batch |
The container settings for a Task. |
|
Container |
The entry of path and mount mode you want to mount into task container. |
|
Container |
The paths which will be mounted to container task's container. |
|
Container |
A private container registry. |
|
Container |
ContainerWorkingDirectory enums |
|
Elevation |
ElevationLevel enums |
|
Environment |
An environment variable to be set on a Task process. |
|
Resource |
A single file or multiple files to be downloaded to a Compute Node. |
|
User |
The definition of the user identity under which the Task is run. Specify either the userName or autoUser property, but not both. |
AutoUserScope
AutoUserScope enums
| Value | Description |
|---|---|
| task |
Specifies that the service should create a new user for the Task. |
| pool |
Specifies that the Task runs as the common auto user Account which is created on every Compute Node in a Pool. |
AutoUserSpecification
Specifies the options for the auto user that runs an Azure Batch Task.
| Name | Type | Description |
|---|---|---|
| elevationLevel |
The elevation level of the auto user. The default value is nonAdmin. |
|
| scope |
The scope for the auto user. The default value is pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks. |
BatchApplicationPackageReference
A reference to an Package to be deployed to Compute Nodes.
| Name | Type | Description |
|---|---|---|
| applicationId |
string |
The ID of the application to deploy. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). |
| version |
string |
The version of the application to deploy. If omitted, the default version is deployed. If this is omitted on a Pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a Task, and no default version is specified for this application, the Task fails with a pre-processing error. |
BatchError
An error response received from the Azure Batch service.
| Name | Type | Description |
|---|---|---|
| code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
| message |
A message describing the error, intended to be suitable for display in a user interface. |
|
| values |
A collection of key-value pairs containing additional details about the error. |
BatchErrorDetail
An item of additional information included in an Azure Batch error response.
| Name | Type | Description |
|---|---|---|
| key |
string |
An identifier specifying the meaning of the Value property. |
| value |
string |
The additional information included with the error response. |
BatchErrorMessage
An error message received in an Azure Batch error response.
| Name | Type | Description |
|---|---|---|
| lang |
string |
The language code of the error message. |
| value |
string |
The text of the message. |
BatchMetadataItem
The Batch service does not assign any meaning to this metadata; it is solely for the use of user code.
| Name | Type | Description |
|---|---|---|
| name |
string |
The name of the metadata item. |
| value |
string |
The value of the metadata item. |
BatchNodeIdentityReference
The reference to a user assigned identity associated with the Batch pool which a compute node will use.
| Name | Type | Description |
|---|---|---|
| resourceId |
string (arm-id) |
The ARM resource id of the user assigned identity. |
BatchPoolReplaceOptions
Parameters for replacing properties on an Azure Batch Pool.
| Name | Type | Description |
|---|---|---|
| applicationPackageReferences |
The list of Application Packages to be installed on each Compute Node in the Pool. The list replaces any existing Application Package references on the Pool. Changes to Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool. |
|
| metadata |
A list of name-value pairs associated with the Pool as metadata. This list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool. |
|
| startTask |
A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool. |
BatchStartTask
Batch will retry Tasks when a recovery operation is triggered on a Node. Examples of recovery operations include (but are not limited to) when an unhealthy Node is rebooted or a Compute Node disappeared due to host failure. Retries due to recovery operations are independent of and are not counted against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to a recovery operation may occur. Because of this, all Tasks should be idempotent. This means Tasks need to tolerate being interrupted and restarted without causing any corruption or duplicate data. The best practice for long running Tasks is to use some form of checkpointing. In some cases the StartTask may be re-run even though the Compute Node was not rebooted. Special care should be taken to avoid StartTasks which create breakaway process or install/launch services from the StartTask working directory, as this will block Batch from being able to re-run the StartTask.
| Name | Type | Description |
|---|---|---|
| commandLine |
string |
The command line of the StartTask. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables). |
| containerSettings |
The settings for the container under which the StartTask runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all Task environment variables are mapped into the container, and the Task command line is executed in the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. |
|
| environmentSettings |
A list of environment variable settings for the StartTask. |
|
| maxTaskRetryCount |
integer (int32) |
The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the Task. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). |
| resourceFiles |
A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. |
|
| userIdentity |
The user identity under which the StartTask runs. If omitted, the Task runs as a non-administrative user unique to the Task. |
|
| waitForSuccess |
boolean |
Whether the Batch service should wait for the StartTask to complete successfully (that is, to exit with exit code 0) before scheduling any Tasks on the Compute Node. If true and the StartTask fails on a Node, the Batch service retries the StartTask up to its maximum retry count (maxTaskRetryCount). If the Task has still not completed successfully after all retries, then the Batch service marks the Node unusable, and will not schedule Tasks to it. This condition can be detected via the Compute Node state and failure info details. If false, the Batch service will not wait for the StartTask to complete. In this case, other Tasks can start executing on the Compute Node while the StartTask is still running; and even if the StartTask fails, new Tasks will continue to be scheduled on the Compute Node. The default is true. |
BatchTaskContainerSettings
The container settings for a Task.
| Name | Type | Description |
|---|---|---|
| containerHostBatchBindMounts |
The paths you want to mounted to container task. If this array is null or be not present, container task will mount entire temporary disk drive in windows (or AZ_BATCH_NODE_ROOT_DIR in Linux). It won't' mount any data paths into container if this array is set as empty. |
|
| containerRunOptions |
string |
Additional options to the container create command. These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. |
| imageName |
string |
The Image to use to create the container in which the Task will run. This is the full Image reference, as would be specified to "docker pull". If no tag is provided as part of the Image name, the tag ":latest" is used as a default. |
| registry |
The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation. |
|
| workingDirectory |
The location of the container Task working directory. The default is 'taskWorkingDirectory'. |
ContainerHostBatchBindMountEntry
The entry of path and mount mode you want to mount into task container.
| Name | Type | Description |
|---|---|---|
| isReadOnly |
boolean |
Mount this source path as read-only mode or not. Default value is false (read/write mode). For Linux, if you mount this path as a read/write mode, this does not mean that all users in container have the read/write access for the path, it depends on the access in host VM. If this path is mounted read-only, all users within the container will not be able to modify the path. |
| source |
The path which be mounted to container customer can select. |
ContainerHostDataPath
The paths which will be mounted to container task's container.
| Value | Description |
|---|---|
| Shared |
The path for multi-instances task to shared their files. |
| Startup |
The path for start task. |
| VfsMounts |
The path contains all virtual file systems are mounted on this node. |
| Task |
The task path. |
| JobPrep |
The job-prep task path. |
| Applications |
The applications path. |
ContainerRegistryReference
A private container registry.
| Name | Type | Description |
|---|---|---|
| identityReference |
The reference to the user assigned identity to use to access an Azure Container Registry instead of username and password. |
|
| password |
string (password) |
The password to log into the registry server. |
| registryServer |
string (uri) |
The registry URL. If omitted, the default is "docker.io". |
| username |
string |
The user name to log into the registry server. |
ContainerWorkingDirectory
ContainerWorkingDirectory enums
| Value | Description |
|---|---|
| taskWorkingDirectory |
Use the standard Batch service Task working directory, which will contain the Task Resource Files populated by Batch. |
| containerImageDefault |
Use the working directory defined in the container Image. Beware that this directory will not contain the Resource Files downloaded by Batch. |
ElevationLevel
ElevationLevel enums
| Value | Description |
|---|---|
| nonadmin |
The user is a standard user without elevated access. |
| admin |
The user is a user with elevated access and operates with full Administrator permissions. |
EnvironmentSetting
An environment variable to be set on a Task process.
| Name | Type | Description |
|---|---|---|
| name |
string |
The name of the environment variable. |
| value |
string |
The value of the environment variable. |
ResourceFile
A single file or multiple files to be downloaded to a Compute Node.
| Name | Type | Description |
|---|---|---|
| autoStorageContainerName |
string |
The storage container name in the auto storage Account. The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. |
| blobPrefix |
string |
The blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin with the specified prefix will be downloaded. The property is valid only when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded. |
| fileMode |
string |
The file permission mode attribute in octal format. This property applies only to files being downloaded to Linux Compute Nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows Compute Node. If this property is not specified for a Linux Compute Node, then a default value of 0770 is applied to the file. |
| filePath |
string |
The location on the Compute Node to which to download the file(s), relative to the Task's working directory. If the httpUrl property is specified, the filePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the autoStorageContainerName or storageContainerUrl property is specified, filePath is optional and is the directory to download the files to. In the case where filePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified filePath directory. The specified relative path cannot break out of the Task's working directory (for example by using '..'). |
| httpUrl |
string (uri) |
The URL of the file to download. The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. If the URL points to Azure Blob Storage, it must be readable from compute nodes. There are three ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, use a managed identity with read permission, or set the ACL for the blob or its container to allow public access. |
| identityReference |
The reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl or httpUrl. |
|
| storageContainerUrl |
string (uri) |
The URL of the blob container within Azure Blob Storage. The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. This URL must be readable and listable from compute nodes. There are three ways to get such a URL for a container in Azure storage: include a Shared Access Signature (SAS) granting read and list permissions on the container, use a managed identity with read and list permissions, or set the ACL for the container to allow public access. |
UserIdentity
The definition of the user identity under which the Task is run. Specify either the userName or autoUser property, but not both.
| Name | Type | Description |
|---|---|---|
| autoUser |
The auto user under which the Task is run. The userName and autoUser properties are mutually exclusive; you must specify one but not both. |
|
| username |
string |
The name of the user identity under which the Task is run. The userName and autoUser properties are mutually exclusive; you must specify one but not both. |