New-AzBatchPool
Creates a pool in the Batch service.
Syntax
CloudServiceAndTargetDedicated (Default)
New-AzBatchPool
[-Id] <String>
-VirtualMachineSize <String>
-BatchContext <BatchAccountContext>
[-DisplayName <String>]
[-ResizeTimeout <TimeSpan>]
[-TargetDedicatedComputeNodes <Int32>]
[-TargetLowPriorityComputeNodes <Int32>]
[-TaskSlotsPerNode <Int32>]
[-UpgradePolicy <PSUpgradePolicy>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-ResourceTag <IDictionary>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-CloudServiceConfiguration <PSCloudServiceConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-MountConfiguration <PSMountConfiguration[]>]
[-UserAccount <PSUserAccount[]>]
[-CurrentNodeCommunicationMode <NodeCommunicationMode>]
[-TargetNodeCommunicationMode <NodeCommunicationMode>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
VirtualMachineAndTargetDedicated
New-AzBatchPool
[-Id] <String>
-VirtualMachineSize <String>
-BatchContext <BatchAccountContext>
[-DisplayName <String>]
[-ResizeTimeout <TimeSpan>]
[-TargetDedicatedComputeNodes <Int32>]
[-TargetLowPriorityComputeNodes <Int32>]
[-TaskSlotsPerNode <Int32>]
[-UpgradePolicy <PSUpgradePolicy>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-ResourceTag <IDictionary>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-VirtualMachineConfiguration <PSVirtualMachineConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-MountConfiguration <PSMountConfiguration[]>]
[-UserAccount <PSUserAccount[]>]
[-CurrentNodeCommunicationMode <NodeCommunicationMode>]
[-TargetNodeCommunicationMode <NodeCommunicationMode>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
CloudServiceAndAutoScale
New-AzBatchPool
[-Id] <String>
-VirtualMachineSize <String>
-BatchContext <BatchAccountContext>
[-DisplayName <String>]
[-AutoScaleEvaluationInterval <TimeSpan>]
[-AutoScaleFormula <String>]
[-TaskSlotsPerNode <Int32>]
[-UpgradePolicy <PSUpgradePolicy>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-ResourceTag <IDictionary>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-CloudServiceConfiguration <PSCloudServiceConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-MountConfiguration <PSMountConfiguration[]>]
[-UserAccount <PSUserAccount[]>]
[-CurrentNodeCommunicationMode <NodeCommunicationMode>]
[-TargetNodeCommunicationMode <NodeCommunicationMode>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
VirtualMachineAndAutoScale
New-AzBatchPool
[-Id] <String>
-VirtualMachineSize <String>
-BatchContext <BatchAccountContext>
[-DisplayName <String>]
[-AutoScaleEvaluationInterval <TimeSpan>]
[-AutoScaleFormula <String>]
[-TaskSlotsPerNode <Int32>]
[-UpgradePolicy <PSUpgradePolicy>]
[-TaskSchedulingPolicy <PSTaskSchedulingPolicy>]
[-ResourceTag <IDictionary>]
[-Metadata <IDictionary>]
[-InterComputeNodeCommunicationEnabled]
[-StartTask <PSStartTask>]
[-CertificateReferences <PSCertificateReference[]>]
[-ApplicationPackageReferences <PSApplicationPackageReference[]>]
[-ApplicationLicenses <System.Collections.Generic.List`1[System.String]>]
[-VirtualMachineConfiguration <PSVirtualMachineConfiguration>]
[-NetworkConfiguration <PSNetworkConfiguration>]
[-MountConfiguration <PSMountConfiguration[]>]
[-UserAccount <PSUserAccount[]>]
[-CurrentNodeCommunicationMode <NodeCommunicationMode>]
[-TargetNodeCommunicationMode <NodeCommunicationMode>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzBatchPool cmdlet creates a pool in the Azure Batch service under the account specified by the BatchContext parameter.
Examples
Example 1: Create a new pool using the TargetDedicated parameter set using CloudServiceConfiguration
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSCloudServiceConfiguration" -ArgumentList @(4,"*")
New-AzBatchPool -Id "MyPool" -VirtualMachineSize "STANDARD_D1_V2" -CloudServiceConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context
The pool is configured to use STANDARD_D1_V2 virtual machines with operating system version of family four.
Example 2: Create a new pool using the TargetDedicated parameter set using VirtualMachineConfiguration
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
New-AzBatchPool -Id "MyPool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context
This command creates a new pool with ID MyPool using the TargetDedicated parameter set.
The target allocation is three compute nodes.
The pool is configured to use STANDARD_D1_V2 virtual machines with the Windows-2016-Datacenter operating system image.
Example 3: Create a new pool using the AutoScale parameter set
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
New-AzBatchPool -Id "AutoScalePool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -AutoScaleFormula '$TargetDedicated=2;' -BatchContext $Context
This command creates a new pool with ID AutoScalePool using the AutoScale parameter set.
The pool is configured to use STANDARD_D1_V2 virtual machines with the Windows-2016-Datacenter operating system image, and the target number of compute nodes are determined by the Autoscale formula.
Example 4: Create a pool with nodes in a subnet
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
$networkConfig = New-Object Microsoft.Azure.Commands.Batch.Models.PSNetworkConfiguration
$networkConfig.SubnetId = "/subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}"
New-AzBatchPool -Id "AutoScalePool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -NetworkConfiguration $networkConfig -BatchContext $Context
Example 5: Create a pool with custom user accounts
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
$userAccount = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserAccount -ArgumentList @("myaccount", "mypassword")
New-AzBatchPool -Id "AutoScalePool" -VirtualMachineSize "STANDARD_D1_V2" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -UserAccount $userAccount
Parameters
-ApplicationLicenses
The list of application licenses the Batch service will make available on each compute node in the pool.
Parameter properties
Type: List<T> [ String ]
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ApplicationLicense
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ApplicationPackageReferences
The New-AzBatchPool cmdlet creates a pool in the Azure Batch service under the account specified by the BatchContext parameter.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AutoScaleEvaluationInterval
Specifies the amount of time, in minutes, that elapses before the pool size is automatically adjusted according to the AutoScale formula.
The default value is 15 minutes, and the minimum value is 5 minutes.
Parameter properties
Parameter sets
CloudServiceAndAutoScale
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
VirtualMachineAndAutoScale
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Specifies the formula for automatically scaling the pool.
Type: String
Default value: None
Supports wildcards: False
DontShow: False
CloudServiceAndAutoScale
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
VirtualMachineAndAutoScale
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BatchContext
Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service.
If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Microsoft Entra authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKey cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-CertificateReferences
Specifies certificates associated with the pool.
The Batch service installs the referenced certificates on each compute node of the pool.
Parameter properties
Type: PSCertificateReference [ ]
Default value: None
Supports wildcards: False
DontShow: False
Aliases: CertificateReference
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CloudServiceConfiguration
Specifies configuration settings for a pool based on the Azure cloud service platform.
Parameter properties
Parameter sets
CloudServiceAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CloudServiceAndAutoScale
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: False
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CurrentNodeCommunicationMode
The current pool communication mode.
Parameter properties
Type: NodeCommunicationMode
Default value: None
Accepted values: Default, Classic, Simplified
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DisplayName
Specifies the display name of the pool.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Id
Specifies the ID of the pool to create.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-InterComputeNodeCommunicationEnabled
Indicates that this cmdlet sets up the pool for direct communication between dedicated compute nodes.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Specifies the metadata, as key/value pairs, to add to the new pool.
The key is the metadata name.
The value is the metadata value.
Type: IDictionary
Default value: None
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-MountConfiguration
A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-NetworkConfiguration
The network configuration for the pool.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResizeTimeout
Specifies the time-out for allocating compute nodes to the pool.
Parameter properties
Parameter sets
CloudServiceAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
VirtualMachineAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceTag
The user defined tags to be associated with the Azure Batch Pool.When specified, these tags are propagated to the backing Azure resources associated with the pool.This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'.
Parameter properties
Type: IDictionary
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-StartTask
Specifies the start task specification for the pool.
The start task is run when a compute node joins the pool, or when the compute node is rebooted or reimaged.
Parameter properties
Type: PSStartTask
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetDedicatedComputeNodes
Specifies the target number of dedicated compute nodes to allocate to the pool.
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Aliases: TargetDedicated
Parameter sets
CloudServiceAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
VirtualMachineAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetLowPriorityComputeNodes
Specifies the target number of low-priority compute nodes to allocate to the pool.
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
CloudServiceAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
VirtualMachineAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetNodeCommunicationMode
The desired node communication mode for the pool.
Parameter properties
Type: NodeCommunicationMode
Default value: None
Accepted values: Default, Classic, Simplified
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TaskSchedulingPolicy
Specifies the task scheduling policy, such as the ComputeNodeFillType.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TaskSlotsPerNode
The number of task slots that can be used to run concurrent tasks on a single compute node in the pool.
The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Aliases: MaxTasksPerComputeNode
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UpgradePolicy
The upgrade policy for the pool in NewBatchPoolCommand.cs .
Parameter properties
Type: PSUpgradePolicy
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-UserAccount
The list of user accounts to be created on each node in the pool.
Parameter properties
Type: PSUserAccount [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VirtualMachineConfiguration
Specifies configuration settings for a pool on the virtual machines infrastructure.
Parameter properties
Parameter sets
VirtualMachineAndTargetDedicated
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
VirtualMachineAndAutoScale
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-VirtualMachineSize
Specifies the size of the virtual machines in the pool.
For more information about virtual machine sizes, see Sizes for virtual machines in the Microsoft Azure site.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: False
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs