Létrehoz egy új készletet a megadott fiókon belül.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}?api-version=2025-06-01
URI-paraméterek
| Name |
In |
Kötelező |
Típus |
Description |
|
accountName
|
path |
True
|
string
minLength: 3 maxLength: 24 pattern: ^[a-zA-Z0-9]+$
|
Egy név a Batch fióknak, amelynek egyedinek kell lennie a régión belül. A csomagi számlanevek 3 és 24 karakter közötti hosszúságúak lehetnek, és csak számokat és kisbetűket kell használniuk. Ez a név a DNS név részeként szolgál, amely a Batch szolgáltatáshoz való hozzáférést szolgál abban a régióban, ahol a fiók létrejött. Például: http://accountname.region.batch.azure.com/.
|
|
poolName
|
path |
True
|
string
minLength: 1 maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$
|
A készlet neve. Ennek egyedinek kell lennie a fiókon belül.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Az erőforráscsoport neve. A név nem megkülönbözteti a kis- és nagybetűket.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
A cél-előfizetés azonosítója. Az értéknek UUID-nek kell lennie.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
A művelethez használandó API-verzió.
|
| Name |
Kötelező |
Típus |
Description |
|
If-Match
|
|
string
|
A frissítendő készlet entitásállapotának (ETag) verziója. A "*" érték csak akkor alkalmazható a műveletre, ha a készlet már létezik. Ha nincs megadva, a program mindig alkalmazza ezt a műveletet.
|
|
If-None-Match
|
|
string
|
Állítsa a "*" értékre egy új készlet létrehozásának engedélyezéséhez, de egy meglévő készlet frissítésének megakadályozásához. A program figyelmen kívül hagyja az egyéb értékeket.
|
Kérelem törzse
| Name |
Típus |
Description |
|
identity
|
BatchPoolIdentity
|
A Batch-készlethez használt identitás típusa.
|
|
properties.applicationPackages
|
ApplicationPackageReference[]
|
A készlet minden számítási csomópontján telepíteni kívánt alkalmazáscsomagok listája.
Az alkalmazáscsomag-hivatkozások módosítása hatással van a készlethez csatlakozó összes új számítási csomópontra, de nem érinti a készletben lévő számítási csomópontokat, amíg újra nem indítja vagy újra nem alakítja őket. Egy adott készleten legfeljebb 10 alkalmazáscsomag-hivatkozás található.
|
|
properties.deploymentConfiguration
|
DeploymentConfiguration
|
Ez a tulajdonság azokat a virtuális gépeket ismerteti, amelyeken a készletcsomópontok üzembe lesznek helyezve.
Az üzembe helyezés konfigurációs tulajdonságai.
|
|
properties.displayName
|
string
|
A készlet megjelenítendő neve.
A megjelenítendő névnek nem kell egyedinek lennie, és legfeljebb 1024 hosszúságú Unicode-karaktereket tartalmazhat.
|
|
properties.interNodeCommunication
|
InterNodeCommunicationState
|
Lehetővé teszi-e a készlet a csomópontok közötti közvetlen kommunikációt.
Ez korlátozza, hogy mely csomópontok rendelhetők hozzá a készlethez. Ennek az értéknek az engedélyezése csökkentheti a készletben lefoglalni kívánt csomópontok számát. Ha nincs megadva, ez az érték alapértelmezés szerint "Letiltva" lesz.
|
|
properties.metadata
|
MetadataItem[]
|
A készlethez metaadatként társított név-érték párok listája.
A Batch szolgáltatás nem rendel semmilyen jelentést a metaadatokhoz; kizárólag a felhasználói kód használatára szolgál.
|
|
properties.mountConfiguration
|
MountConfiguration[]
|
A készlet minden csomópontjára csatlakoztatni kívánt fájlrendszerek listája.
Ez támogatja az Azure Filest, az NFS-t, a CIFS-t/SMB-t és a Blobfuse-t.
|
|
properties.networkConfiguration
|
NetworkConfiguration
|
A készlet hálózati konfigurációja.
A készlet hálózati konfigurációja.
|
|
properties.scaleSettings
|
ScaleSettings
|
A készletben lévő csomópontok számát konfiguráló beállítások.
Meghatározza a készlet kívánt méretét. Ez lehet "rögzített skálázás", ahol meg van adva a kért targetDedicatedNodes, vagy az "automatikus skálázás", amely egy rendszeresen újraértékelt képletet definiál. Ha ez a tulajdonság nincs megadva, a készlet rögzített skálával fog rendelkezni 0 targetDedicatedNodes értékekkel.
|
|
properties.startTask
|
StartTask
|
Az egyes számítási csomópontokon a készlethez való csatlakozáskor futtatandó feladat.
A PATCH (frissítési) műveletben ez a tulajdonság egy üres objektumra állítható be, hogy eltávolítsa a kezdő feladatot a készletből.
|
|
properties.taskSchedulingPolicy
|
TaskSchedulingPolicy
|
A tevékenységek elosztása a készlet számítási csomópontjai között.
Ha nincs megadva, az alapértelmezett oldalpár.
|
|
properties.taskSlotsPerNode
|
integer
(int32)
|
A készlet egyetlen számítási csomópontján egyidejű feladatok futtatásához használható feladathelyek száma.
Az alapértelmezett érték 1. A maximális érték a készlet VmSize-jének 4-szerese, vagy 256.
|
|
properties.upgradePolicy
|
UpgradePolicy
|
A készlet frissítési szabályzata.
Egy frissítési szabályzatot ír le – automatikus, manuális vagy működés közben.
|
|
properties.userAccounts
|
UserAccount[]
|
A készlet minden csomópontján létrehozandó felhasználói fiókok listája.
A készlet minden csomópontján létrehozandó felhasználói fiókok listája.
|
|
properties.vmSize
|
string
|
A virtuális gépek mérete a készletben. A készlet összes virtuális gépe azonos méretű.
Az elérhető virtuálisgép-méretekről további információt az Azure-beli virtuális gépek méretei (https://learn.microsoft.com/azure/virtual-machines/sizes/overview) című témakörben talál. A Batch az összes Azure-beli virtuálisgép-méretet támogatja, kivéve STANDARD_A0 és prémium szintű tárterülettel (STANDARD_GS, STANDARD_DS és STANDARD_DSV2 sorozattal).
|
|
tags
|
object
|
Az erőforrás címkéi.
|
Válaszok
| Name |
Típus |
Description |
|
200 OK
|
Pool
|
A kérés sikeres volt.
Fejlécek
ETag: string
|
|
Other Status Codes
|
CloudError
|
Váratlan hibaválasz.
|
Biztonság
azure_auth
Azure Active Directory OAuth2-folyamat.
Típus:
oauth2
Folyamat:
implicit
Engedélyezési URL:
https://login.microsoftonline.com/common/oauth2/authorize
Hatókörök
| Name |
Description |
|
user_impersonation
|
a felhasználói fiók megszemélyesítése
|
Példák
CreatePool - accelerated networking
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2016-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64"
}
},
"networkConfiguration": {
"enableAcceleratedNetworking": true,
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"vmSize": "STANDARD_D1_V2"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_accelerated_networking.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2016-datacenter-smalldisk",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.windows amd64",
}
},
"networkConfiguration": {
"enableAcceleratedNetworking": True,
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 1, "targetLowPriorityNodes": 0}},
"vmSize": "STANDARD_D1_V2",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_AcceleratedNetworking.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_AcceleratedNetworking.json
func ExamplePoolClient_Create_createPoolAcceleratedNetworking() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("WindowsServer"),
Publisher: to.Ptr("MicrosoftWindowsServer"),
SKU: to.Ptr("2016-datacenter-smalldisk"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
},
},
NetworkConfiguration: &armbatch.NetworkConfiguration{
EnableAcceleratedNetworking: to.Ptr(true),
SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
VMSize: to.Ptr("STANDARD_D1_V2"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8DB46CB72A227E2\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateSteady),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T03:00:34.0646502Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](1),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("WindowsServer"),
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// SKU: to.Ptr("2016-datacenter-smalldisk"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()),
// NetworkConfiguration: &armbatch.NetworkConfiguration{
// DynamicVNetAssignmentScope: to.Ptr(armbatch.DynamicVNetAssignmentScopeNone),
// EnableAcceleratedNetworking: to.Ptr(true),
// SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
// },
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()),
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()),
// TargetDedicatedNodes: to.Ptr[int32](1),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// ResizeTimeout: to.Ptr("PT15M"),
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D1_V2"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_AcceleratedNetworking.json
*/
async function createPoolAcceleratedNetworking() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "WindowsServer",
publisher: "MicrosoftWindowsServer",
sku: "2016-datacenter-smalldisk",
version: "latest",
},
nodeAgentSkuId: "batch.node.windows amd64",
},
},
networkConfiguration: {
enableAcceleratedNetworking: true,
subnetId:
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } },
vmSize: "STANDARD_D1_V2",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_AcceleratedNetworking.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D1_V2",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2016-datacenter-smalldisk",
Version = "latest",
}, "batch.node.windows amd64"),
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 1,
TargetLowPriorityNodes = 0,
},
},
NetworkConfiguration = new BatchNetworkConfiguration
{
SubnetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
EnableAcceleratedNetworking = true,
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8DB46CB72A227E2"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Steady",
"allocationStateTransitionTime": "2023-04-27T03:00:34.0646502Z",
"creationTime": "2023-04-27T02:59:41.8592226Z",
"currentDedicatedNodes": 1,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2016-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2023-04-27T02:59:41.8592226Z",
"networkConfiguration": {
"dynamicVnetAssignmentScope": "none",
"enableAcceleratedNetworking": true,
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"
},
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2023-04-27T02:59:41.8592226Z",
"resizeOperationStatus": {
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2023-04-27T02:59:41.8592226Z",
"targetDedicatedNodes": 1
},
"scaleSettings": {
"fixedScale": {
"resizeTimeout": "PT15M",
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D1_V2"
}
}
CreatePool - confidential disk encryption set for user subscription accounts
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"vmSize": "Standard_DC2as_v5",
"taskSchedulingPolicy": {
"nodeFillType": "Pack"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2019-datacenter-core-g2",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"securityProfile": {
"securityType": "confidentialVM",
"encryptionAtHost": false,
"uefiSettings": {
"vTpmEnabled": true,
"secureBootEnabled": true
}
},
"osDisk": {
"managedDisk": {
"storageAccountType": "Standard_LRS",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
},
"securityProfile": {
"securityEncryptionType": "DiskWithVMGuestState",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId"
}
}
}
},
"dataDisks": [
{
"lun": 0,
"diskSizeGB": 1024,
"managedDisk": {
"storageAccountType": "Standard_LRS",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
}
}
}
]
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"resizeTimeout": "PT15M"
}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_confidential_disk_encryption_set_for_user_subscription_accounts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"dataDisks": [
{
"diskSizeGB": 1024,
"lun": 0,
"managedDisk": {
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
},
"storageAccountType": "Standard_LRS",
},
}
],
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-core-g2",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.windows amd64",
"osDisk": {
"managedDisk": {
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
},
"securityProfile": {
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId"
},
"securityEncryptionType": "DiskWithVMGuestState",
},
"storageAccountType": "Standard_LRS",
}
},
"securityProfile": {
"encryptionAtHost": False,
"securityType": "confidentialVM",
"uefiSettings": {"secureBootEnabled": True, "vTpmEnabled": True},
},
}
},
"scaleSettings": {"fixedScale": {"resizeTimeout": "PT15M", "targetDedicatedNodes": 1}},
"taskSchedulingPolicy": {"nodeFillType": "Pack"},
"vmSize": "Standard_DC2as_v5",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_ConfidentialDiskEncryptionSet_ForUserSubscriptionAccounts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_ConfidentialDiskEncryptionSet_ForUserSubscriptionAccounts.json
func ExamplePoolClient_Create_createPoolConfidentialDiskEncryptionSetForUserSubscriptionAccounts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
VMSize: to.Ptr("Standard_DC2as_v5"),
TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack),
},
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Publisher: to.Ptr("MicrosoftWindowsServer"),
Offer: to.Ptr("WindowsServer"),
SKU: to.Ptr("2019-datacenter-core-g2"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
SecurityProfile: &armbatch.SecurityProfile{
SecurityType: to.Ptr(armbatch.SecurityTypesConfidentialVM),
EncryptionAtHost: to.Ptr(false),
UefiSettings: &armbatch.UefiSettings{
VTpmEnabled: to.Ptr(true),
SecureBootEnabled: to.Ptr(true),
},
},
OSDisk: &armbatch.OSDisk{
ManagedDisk: &armbatch.ManagedDisk{
StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
},
SecurityProfile: &armbatch.VMDiskSecurityProfile{
SecurityEncryptionType: to.Ptr(armbatch.SecurityEncryptionTypesDiskWithVMGuestState),
DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId"),
},
},
},
},
DataDisks: []*armbatch.DataDisk{
{
Lun: to.Ptr[int32](0),
DiskSizeGB: to.Ptr[int32](1024),
ManagedDisk: &armbatch.ManagedDisk{
StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
},
},
},
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
ResizeTimeout: to.Ptr("PT15M"),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""),
// Properties: &armbatch.PoolProperties{
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522647Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522634Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522634Z"); return t}()),
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522647Z"); return t}()),
// VMSize: to.Ptr("STANDARD_DC2as_v5"),
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// TaskSlotsPerNode: to.Ptr[int32](1),
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack),
// JobDefaultOrder: to.Ptr(armbatch.JobDefaultOrderNone),
// },
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// Offer: to.Ptr("WindowsServer"),
// SKU: to.Ptr("2019-datacenter-core-g2"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// DataDisks: []*armbatch.DataDisk{
// {
// Lun: to.Ptr[int32](0),
// Caching: to.Ptr(armbatch.CachingTypeNone),
// DiskSizeGB: to.Ptr[int32](1024),
// ManagedDisk: &armbatch.ManagedDisk{
// StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
// DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
// },
// },
// },
// },
// OSDisk: &armbatch.OSDisk{
// Caching: to.Ptr(armbatch.CachingTypeNone),
// ManagedDisk: &armbatch.ManagedDisk{
// StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
// SecurityProfile: &armbatch.VMDiskSecurityProfile{
// SecurityEncryptionType: to.Ptr(armbatch.SecurityEncryptionTypesDiskWithVMGuestState),
// DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId"),
// },
// },
// DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
// },
// },
// },
// SecurityProfile: &armbatch.SecurityProfile{
// SecurityType: to.Ptr(armbatch.SecurityTypesConfidentialVM),
// EncryptionAtHost: to.Ptr(false),
// UefiSettings: &armbatch.UefiSettings{
// SecureBootEnabled: to.Ptr(true),
// VTpmEnabled: to.Ptr(true),
// },
// },
// },
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// ResizeTimeout: to.Ptr("PT15M"),
// },
// },
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// TargetDedicatedNodes: to.Ptr[int32](1),
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522324Z"); return t}()),
// },
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_ConfidentialDiskEncryptionSet_ForUserSubscriptionAccounts.json
*/
async function createPoolConfidentialDiskEncryptionSetForUserSubscriptionAccounts() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
vmSize: "Standard_DC2as_v5",
taskSchedulingPolicy: { nodeFillType: "Pack" },
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
publisher: "MicrosoftWindowsServer",
offer: "WindowsServer",
sku: "2019-datacenter-core-g2",
version: "latest",
},
nodeAgentSkuId: "batch.node.windows amd64",
securityProfile: {
securityType: "confidentialVM",
encryptionAtHost: false,
uefiSettings: { vTpmEnabled: true, secureBootEnabled: true },
},
osDisk: {
managedDisk: {
storageAccountType: "Standard_LRS",
diskEncryptionSet: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId",
},
securityProfile: {
securityEncryptionType: "DiskWithVMGuestState",
diskEncryptionSet: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId",
},
},
},
},
dataDisks: [
{
lun: 0,
diskSizeGB: 1024,
managedDisk: {
storageAccountType: "Standard_LRS",
diskEncryptionSet: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId",
},
},
},
],
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, resizeTimeout: "PT15M" } },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_ConfidentialDiskEncryptionSet_ForUserSubscriptionAccounts.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_DC2as_v5",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2019-datacenter-core-g2",
Version = "latest",
}, "batch.node.windows amd64")
{
DataDisks = {new BatchVmDataDisk(0, 1024)
{
ManagedDisk = new ManagedDisk
{
StorageAccountType = BatchStorageAccountType.StandardLrs,
DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
},
}},
OSDisk = new BatchOSDisk
{
ManagedDisk = new ManagedDisk
{
StorageAccountType = BatchStorageAccountType.StandardLrs,
SecurityProfile = new VmDiskSecurityProfile
{
SecurityEncryptionType = BatchSecurityEncryptionType.DiskWithVmGuestState,
DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId"),
},
DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
},
},
SecurityProfile = new BatchSecurityProfile
{
SecurityType = BatchSecurityType.ConfidentialVm,
EncryptionAtHost = false,
UefiSettings = new BatchUefiSettings
{
IsSecureBootEnabled = true,
IsVTpmEnabled = true,
},
},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"),
TargetDedicatedNodes = 1,
},
},
TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Pack),
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"etag": "W/\"0x8D4EDFEBFADF4AB\"",
"properties": {
"lastModified": "2025-06-30T07:30:49.7522647Z",
"creationTime": "2025-06-30T07:30:49.7522634Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2025-06-30T07:30:49.7522634Z",
"allocationState": "Resizing",
"allocationStateTransitionTime": "2025-06-30T07:30:49.7522647Z",
"vmSize": "STANDARD_DC2as_v5",
"interNodeCommunication": "Disabled",
"taskSlotsPerNode": 1,
"taskSchedulingPolicy": {
"nodeFillType": "Pack",
"jobDefaultOrder": "None"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2019-datacenter-core-g2",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"dataDisks": [
{
"lun": 0,
"caching": "None",
"diskSizeGB": 1024,
"managedDisk": {
"storageAccountType": "Standard_LRS",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
}
}
}
],
"osDisk": {
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"securityProfile": {
"securityEncryptionType": "DiskWithVMGuestState",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId"
}
},
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
}
}
},
"securityProfile": {
"securityType": "confidentialVM",
"encryptionAtHost": false,
"uefiSettings": {
"secureBootEnabled": true,
"vTpmEnabled": true
}
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0,
"resizeTimeout": "PT15M"
}
},
"resizeOperationStatus": {
"targetDedicatedNodes": 1,
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2025-06-30T07:30:49.7522324Z"
},
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0
}
}
CreatePool - Custom Image
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_shared_image_gallery.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
}
},
"vmSize": "STANDARD_D4",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_SharedImageGallery.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_SharedImageGallery.json
func ExamplePoolClient_Create_createPoolCustomImage() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
},
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateSteady),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](0),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_SharedImageGallery.json
*/
async function createPoolCustomImage() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1",
},
nodeAgentSkuId: "batch.node.ubuntu 18.04",
},
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_SharedImageGallery.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Id = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
}, "batch.node.ubuntu 18.04"),
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Steady",
"allocationStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"creationTime": "2017-08-28T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2017-08-28T10:22:55.9407275Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 0,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - customer managed key for Batch managed accounts
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"vmSize": "Standard_D4ds_v5",
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"sku": "2022-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"diskEncryptionConfiguration": {
"targets": [
"OsDisk"
],
"customerManagedKey": {
"keyUrl": "http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9",
"identityReference": {
"resourceId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"
}
}
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"resizeTimeout": "PT15M"
}
}
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_customer_managed_key_for_batch_managed_accounts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
},
},
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"diskEncryptionConfiguration": {
"customerManagedKey": {
"identityReference": {
"resourceId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"
},
"keyUrl": "http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9",
},
"targets": ["OsDisk"],
},
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2022-Datacenter",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.windows amd64",
}
},
"scaleSettings": {"fixedScale": {"resizeTimeout": "PT15M", "targetDedicatedNodes": 1}},
"vmSize": "Standard_D4ds_v5",
},
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_CustomerManagedKey_ForBatchManagedAccounts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_CustomerManagedKey_ForBatchManagedAccounts.json
func ExamplePoolClient_Create_createPoolCustomerManagedKeyForBatchManagedAccounts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
VMSize: to.Ptr("Standard_D4ds_v5"),
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
SKU: to.Ptr("2022-Datacenter"),
Publisher: to.Ptr("MicrosoftWindowsServer"),
Version: to.Ptr("latest"),
Offer: to.Ptr("WindowsServer"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
DiskEncryptionConfiguration: &armbatch.DiskEncryptionConfiguration{
Targets: []*armbatch.DiskEncryptionTarget{
to.Ptr(armbatch.DiskEncryptionTargetOsDisk),
},
CustomerManagedKey: &armbatch.DiskCustomerManagedKey{
KeyURL: to.Ptr("http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9"),
IdentityReference: &armbatch.ComputeNodeIdentityReference{
ResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"),
},
},
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
ResizeTimeout: to.Ptr("PT15M"),
},
},
},
Identity: &armbatch.PoolIdentity{
Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Identity: &armbatch.PoolIdentity{
// Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{
// "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armbatch.UserAssignedIdentities{
// PrincipalID: to.Ptr("principalId"),
// ClientID: to.Ptr("clientId"),
// },
// },
// },
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""),
// Properties: &armbatch.PoolProperties{
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309281Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309266Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309266Z"); return t}()),
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309281Z"); return t}()),
// VMSize: to.Ptr("Standard_D4ds_v5"),
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// TaskSlotsPerNode: to.Ptr[int32](1),
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// JobDefaultOrder: to.Ptr(armbatch.JobDefaultOrderNone),
// },
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// Offer: to.Ptr("WindowsServer"),
// SKU: to.Ptr("2022-Datacenter"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// DiskEncryptionConfiguration: &armbatch.DiskEncryptionConfiguration{
// Targets: []*armbatch.DiskEncryptionTarget{
// to.Ptr(armbatch.DiskEncryptionTargetOsDisk),
// },
// CustomerManagedKey: &armbatch.DiskCustomerManagedKey{
// KeyURL: to.Ptr("http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9"),
// IdentityReference: &armbatch.ComputeNodeIdentityReference{
// ResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"),
// },
// },
// },
// },
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// ResizeTimeout: to.Ptr("PT15M"),
// },
// },
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// TargetDedicatedNodes: to.Ptr[int32](1),
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309126Z"); return t}()),
// },
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_CustomerManagedKey_ForBatchManagedAccounts.json
*/
async function createPoolCustomerManagedKeyForBatchManagedAccounts() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
vmSize: "Standard_D4ds_v5",
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
sku: "2022-Datacenter",
publisher: "MicrosoftWindowsServer",
version: "latest",
offer: "WindowsServer",
},
nodeAgentSkuId: "batch.node.windows amd64",
diskEncryptionConfiguration: {
targets: ["OsDisk"],
customerManagedKey: {
keyUrl: "http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9",
identityReference: {
resourceId:
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1",
},
},
},
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, resizeTimeout: "PT15M" } },
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1":
{},
},
},
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_CustomerManagedKey_ForBatchManagedAccounts.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity()
},
},
VmSize = "Standard_D4ds_v5",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2022-Datacenter",
Version = "latest",
}, "batch.node.windows amd64")
{
DiskEncryptionConfiguration = new BatchDiskEncryptionConfiguration
{
Targets = { BatchDiskEncryptionTarget.OSDisk },
CustomerManagedKey = new BatchDiskCustomerManagedKey
{
KeyUri = new Uri("http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9"),
IdentityReferenceResourceId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"),
},
},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"),
TargetDedicatedNodes = 1,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
"principalId": "principalId",
"clientId": "clientId"
}
}
},
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"etag": "W/\"0x8D4EDFEBFADF4AB\"",
"properties": {
"lastModified": "2025-06-30T07:16:33.4309281Z",
"creationTime": "2025-06-30T07:16:33.4309266Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2025-06-30T07:16:33.4309266Z",
"allocationState": "Resizing",
"allocationStateTransitionTime": "2025-06-30T07:16:33.4309281Z",
"vmSize": "Standard_D4ds_v5",
"interNodeCommunication": "Disabled",
"taskSlotsPerNode": 1,
"taskSchedulingPolicy": {
"nodeFillType": "Spread",
"jobDefaultOrder": "None"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2022-Datacenter",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"diskEncryptionConfiguration": {
"targets": [
"OsDisk"
],
"customerManagedKey": {
"keyUrl": "http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9",
"identityReference": {
"resourceId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"
}
}
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0,
"resizeTimeout": "PT15M"
}
},
"resizeOperationStatus": {
"targetDedicatedNodes": 1,
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2025-06-30T07:16:33.4309126Z"
},
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0
}
}
CreatePool - disk encryption set for user subscription accounts
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"vmSize": "Standard_D4ds_v5",
"taskSchedulingPolicy": {
"nodeFillType": "Pack"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"sku": "2022-Datacenter",
"publisher": "MicrosoftWindowsServer",
"version": "latest",
"offer": "WindowsServer"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"securityProfile": {
"encryptionAtHost": false
},
"osDisk": {
"managedDisk": {
"storageAccountType": "Standard_LRS",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
}
}
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"resizeTimeout": "PT15M"
}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_disk_encryption_set_for_user_subscription_accounts.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2022-Datacenter",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.windows amd64",
"osDisk": {
"managedDisk": {
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
},
"storageAccountType": "Standard_LRS",
}
},
"securityProfile": {"encryptionAtHost": False},
}
},
"scaleSettings": {"fixedScale": {"resizeTimeout": "PT15M", "targetDedicatedNodes": 1}},
"taskSchedulingPolicy": {"nodeFillType": "Pack"},
"vmSize": "Standard_D4ds_v5",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_DiskEncryptionSet_ForUserSubscriptionAccounts.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_DiskEncryptionSet_ForUserSubscriptionAccounts.json
func ExamplePoolClient_Create_createPoolDiskEncryptionSetForUserSubscriptionAccounts() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
VMSize: to.Ptr("Standard_D4ds_v5"),
TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack),
},
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
SKU: to.Ptr("2022-Datacenter"),
Publisher: to.Ptr("MicrosoftWindowsServer"),
Version: to.Ptr("latest"),
Offer: to.Ptr("WindowsServer"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
SecurityProfile: &armbatch.SecurityProfile{
EncryptionAtHost: to.Ptr(false),
},
OSDisk: &armbatch.OSDisk{
ManagedDisk: &armbatch.ManagedDisk{
StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
},
},
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
ResizeTimeout: to.Ptr("PT15M"),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""),
// Properties: &armbatch.PoolProperties{
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:45:46.1580726Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:35:44.5579791Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:35:44.5579791Z"); return t}()),
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:45:46.1580727Z"); return t}()),
// VMSize: to.Ptr("Standard_D4ds_v5"),
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// TaskSlotsPerNode: to.Ptr[int32](1),
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack),
// JobDefaultOrder: to.Ptr(armbatch.JobDefaultOrderNone),
// },
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// Offer: to.Ptr("WindowsServer"),
// SKU: to.Ptr("2022-Datacenter"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// OSDisk: &armbatch.OSDisk{
// Caching: to.Ptr(armbatch.CachingTypeNone),
// ManagedDisk: &armbatch.ManagedDisk{
// StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
// DiskEncryptionSet: &armbatch.DiskEncryptionSetParameters{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
// },
// },
// },
// SecurityProfile: &armbatch.SecurityProfile{
// EncryptionAtHost: to.Ptr(false),
// },
// },
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// ResizeTimeout: to.Ptr("PT15M"),
// },
// },
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// TargetDedicatedNodes: to.Ptr[int32](1),
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:45:46.1580724Z"); return t}()),
// },
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_DiskEncryptionSet_ForUserSubscriptionAccounts.json
*/
async function createPoolDiskEncryptionSetForUserSubscriptionAccounts() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
vmSize: "Standard_D4ds_v5",
taskSchedulingPolicy: { nodeFillType: "Pack" },
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
sku: "2022-Datacenter",
publisher: "MicrosoftWindowsServer",
version: "latest",
offer: "WindowsServer",
},
nodeAgentSkuId: "batch.node.windows amd64",
securityProfile: { encryptionAtHost: false },
osDisk: {
managedDisk: {
storageAccountType: "Standard_LRS",
diskEncryptionSet: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId",
},
},
},
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, resizeTimeout: "PT15M" } },
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_DiskEncryptionSet_ForUserSubscriptionAccounts.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_D4ds_v5",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2022-Datacenter",
Version = "latest",
}, "batch.node.windows amd64")
{
OSDisk = new BatchOSDisk
{
ManagedDisk = new ManagedDisk
{
StorageAccountType = BatchStorageAccountType.StandardLrs,
DiskEncryptionSetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"),
},
},
SecurityProfile = new BatchSecurityProfile
{
EncryptionAtHost = false,
},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"),
TargetDedicatedNodes = 1,
},
},
TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Pack),
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"etag": "W/\"0x8D4EDFEBFADF4AB\"",
"properties": {
"lastModified": "2025-06-30T07:45:46.1580726Z",
"creationTime": "2025-06-30T07:35:44.5579791Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2025-06-30T07:35:44.5579791Z",
"allocationState": "Resizing",
"allocationStateTransitionTime": "2025-06-30T07:45:46.1580727Z",
"vmSize": "Standard_D4ds_v5",
"interNodeCommunication": "Disabled",
"taskSlotsPerNode": 1,
"taskSchedulingPolicy": {
"nodeFillType": "Pack",
"jobDefaultOrder": "None"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2022-Datacenter",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"osDisk": {
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"diskEncryptionSet": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId"
}
}
},
"securityProfile": {
"encryptionAtHost": false
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0,
"resizeTimeout": "PT15M"
}
},
"resizeOperationStatus": {
"targetDedicatedNodes": 1,
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2025-06-30T07:45:46.1580724Z"
},
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0
}
}
CreatePool - dual stack networking
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch/providers/Microsoft.Batch/batchAccounts/exampleacc/pools/dualstackpool?api-version=2025-06-01
{
"properties": {
"vmSize": "Standard_D4ds_v5",
"networkConfiguration": {
"publicIPAddressConfiguration": {
"ipFamilies": [
"IPv4",
"IPv6"
]
},
"endpointConfiguration": {
"inboundNatPools": [
{
"backendPort": 22,
"frontendPortRangeStart": 40000,
"frontendPortRangeEnd": 40500,
"name": "sshpool",
"protocol": "TCP",
"networkSecurityGroupRules": [
{
"access": "Allow",
"priority": 1000,
"sourceAddressPrefix": "*",
"sourcePortRanges": [
"*"
]
}
]
}
]
}
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "Canonical",
"offer": "ubuntu-24_04-lts",
"sku": "server"
},
"nodeAgentSkuId": "batch.node.ubuntu 24.04"
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
}
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_dual_stack_networking.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch",
account_name="exampleacc",
pool_name="dualstackpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {"offer": "ubuntu-24_04-lts", "publisher": "Canonical", "sku": "server"},
"nodeAgentSkuId": "batch.node.ubuntu 24.04",
}
},
"networkConfiguration": {
"endpointConfiguration": {
"inboundNatPools": [
{
"backendPort": 22,
"frontendPortRangeEnd": 40500,
"frontendPortRangeStart": 40000,
"name": "sshpool",
"networkSecurityGroupRules": [
{
"access": "Allow",
"priority": 1000,
"sourceAddressPrefix": "*",
"sourcePortRanges": ["*"],
}
],
"protocol": "TCP",
}
]
},
"publicIPAddressConfiguration": {"ipFamilies": ["IPv4", "IPv6"]},
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 1, "targetLowPriorityNodes": 0}},
"vmSize": "Standard_D4ds_v5",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_DualStackNetworking.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_DualStackNetworking.json
func ExamplePoolClient_Create_createPoolDualStackNetworking() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch", "exampleacc", "dualstackpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
VMSize: to.Ptr("Standard_D4ds_v5"),
NetworkConfiguration: &armbatch.NetworkConfiguration{
PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{
IPFamilies: []*armbatch.IPFamily{
to.Ptr(armbatch.IPFamilyIPv4),
to.Ptr(armbatch.IPFamilyIPv6),
},
},
EndpointConfiguration: &armbatch.PoolEndpointConfiguration{
InboundNatPools: []*armbatch.InboundNatPool{
{
BackendPort: to.Ptr[int32](22),
FrontendPortRangeStart: to.Ptr[int32](40000),
FrontendPortRangeEnd: to.Ptr[int32](40500),
Name: to.Ptr("sshpool"),
Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP),
NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{
{
Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow),
Priority: to.Ptr[int32](1000),
SourceAddressPrefix: to.Ptr("*"),
SourcePortRanges: []*string{
to.Ptr("*"),
},
},
},
},
},
},
},
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Publisher: to.Ptr("Canonical"),
Offer: to.Ptr("ubuntu-24_04-lts"),
SKU: to.Ptr("server"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 24.04"),
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/dualstackpool"),
// Name: to.Ptr("dualstackpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// Etag: to.Ptr("W/\"0x8DDC34D4A01A419\""),
// Properties: &armbatch.PoolProperties{
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7998105Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7997967Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7997967Z"); return t}()),
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7998136Z"); return t}()),
// VMSize: to.Ptr("Standard_D4ds_v5"),
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// TaskSlotsPerNode: to.Ptr[int32](1),
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// JobDefaultOrder: to.Ptr(armbatch.JobDefaultOrderNone),
// },
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Publisher: to.Ptr("Canonical"),
// Offer: to.Ptr("ubuntu-24_04-lts"),
// SKU: to.Ptr("server"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 24.04"),
// },
// },
// NetworkConfiguration: &armbatch.NetworkConfiguration{
// PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{
// IPFamilies: []*armbatch.IPFamily{
// to.Ptr(armbatch.IPFamilyIPv4),
// to.Ptr(armbatch.IPFamilyIPv6),
// },
// },
// EndpointConfiguration: &armbatch.PoolEndpointConfiguration{
// InboundNatPools: []*armbatch.InboundNatPool{
// {
// Name: to.Ptr("sshpool"),
// Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP),
// BackendPort: to.Ptr[int32](22),
// FrontendPortRangeStart: to.Ptr[int32](40000),
// FrontendPortRangeEnd: to.Ptr[int32](40500),
// NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{
// {
// Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow),
// SourceAddressPrefix: to.Ptr("*"),
// Priority: to.Ptr[int32](1000),
// SourcePortRanges: []*string{
// to.Ptr("*"),
// },
// },
// },
// },
// },
// },
// DynamicVNetAssignmentScope: to.Ptr(armbatch.DynamicVNetAssignmentScopeNone),
// EnableAcceleratedNetworking: to.Ptr(false),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// ResizeTimeout: to.Ptr("PT15M"),
// },
// },
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// TargetDedicatedNodes: to.Ptr[int32](1),
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7994621Z"); return t}()),
// },
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_DualStackNetworking.json
*/
async function createPoolDualStackNetworking() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create("default-azurebatch", "exampleacc", "dualstackpool", {
vmSize: "Standard_D4ds_v5",
networkConfiguration: {
publicIPAddressConfiguration: { ipFamilies: ["IPv4", "IPv6"] },
endpointConfiguration: {
inboundNatPools: [
{
backendPort: 22,
frontendPortRangeStart: 40000,
frontendPortRangeEnd: 40500,
name: "sshpool",
protocol: "TCP",
networkSecurityGroupRules: [
{
access: "Allow",
priority: 1000,
sourceAddressPrefix: "*",
sourcePortRanges: ["*"],
},
],
},
],
},
},
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: { publisher: "Canonical", offer: "ubuntu-24_04-lts", sku: "server" },
nodeAgentSkuId: "batch.node.ubuntu 24.04",
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } },
});
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_DualStackNetworking.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch";
string accountName = "exampleacc";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "dualstackpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_D4ds_v5",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "Canonical",
Offer = "ubuntu-24_04-lts",
Sku = "server",
}, "batch.node.ubuntu 24.04"),
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 1,
TargetLowPriorityNodes = 0,
},
},
NetworkConfiguration = new BatchNetworkConfiguration
{
EndpointInboundNatPools = {new BatchInboundNatPool("sshpool", BatchInboundEndpointProtocol.Tcp, 22, 40000, 40500)
{
NetworkSecurityGroupRules = {new BatchNetworkSecurityGroupRule(1000, BatchNetworkSecurityGroupRuleAccess.Allow, "*")
{
SourcePortRanges = {"*"},
}},
}},
PublicIPAddressConfiguration = new BatchPublicIPAddressConfiguration
{
IPFamilies = { BatchIPFamily.IPv4, BatchIPFamily.IPv6 },
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/dualstackpool",
"name": "dualstackpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"etag": "W/\"0x8DDC34D4A01A419\"",
"properties": {
"lastModified": "2025-07-15T03:11:27.7998105Z",
"creationTime": "2025-07-15T03:11:27.7997967Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2025-07-15T03:11:27.7997967Z",
"allocationState": "Resizing",
"allocationStateTransitionTime": "2025-07-15T03:11:27.7998136Z",
"vmSize": "Standard_D4ds_v5",
"interNodeCommunication": "Disabled",
"taskSlotsPerNode": 1,
"taskSchedulingPolicy": {
"nodeFillType": "Spread",
"jobDefaultOrder": "None"
},
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"publisher": "Canonical",
"offer": "ubuntu-24_04-lts",
"sku": "server",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 24.04"
}
},
"networkConfiguration": {
"publicIPAddressConfiguration": {
"ipFamilies": [
"IPv4",
"IPv6"
]
},
"endpointConfiguration": {
"inboundNatPools": [
{
"name": "sshpool",
"protocol": "TCP",
"backendPort": 22,
"frontendPortRangeStart": 40000,
"frontendPortRangeEnd": 40500,
"networkSecurityGroupRules": [
{
"access": "Allow",
"sourceAddressPrefix": "*",
"priority": 1000,
"sourcePortRanges": [
"*"
]
}
]
}
]
},
"dynamicVnetAssignmentScope": "none",
"enableAcceleratedNetworking": false
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0,
"resizeTimeout": "PT15M"
}
},
"resizeOperationStatus": {
"targetDedicatedNodes": 1,
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2025-07-15T03:11:27.7994621Z"
},
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0
}
}
CreatePool - Full VirtualMachineConfiguration
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"dataDisks": [
{
"caching": "ReadWrite",
"diskSizeGB": 30,
"lun": 0,
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
}
},
{
"caching": "None",
"diskSizeGB": 200,
"lun": 1,
"managedDisk": {
"storageAccountType": "Premium_LRS"
}
}
],
"diskEncryptionConfiguration": {
"targets": [
"OsDisk",
"TemporaryDisk"
]
},
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2016-Datacenter-SmallDisk",
"version": "latest"
},
"licenseType": "Windows_Server",
"nodeAgentSkuId": "batch.node.windows amd64",
"nodePlacementConfiguration": {
"policy": "Zonal"
},
"osDisk": {
"ephemeralOSDiskSettings": {
"placement": "CacheDisk"
}
},
"windowsConfiguration": {
"enableAutomaticUpdates": false
}
}
},
"networkConfiguration": {
"endpointConfiguration": {
"inboundNatPools": [
{
"name": "testnat",
"backendPort": 12001,
"frontendPortRangeEnd": 15100,
"frontendPortRangeStart": 15000,
"networkSecurityGroupRules": [
{
"access": "Allow",
"priority": 150,
"sourceAddressPrefix": "192.100.12.45",
"sourcePortRanges": [
"1",
"2"
]
},
{
"access": "Deny",
"priority": 3500,
"sourceAddressPrefix": "*",
"sourcePortRanges": [
"*"
]
}
],
"protocol": "TCP"
}
]
}
},
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_virtual_machine_configuration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"dataDisks": [
{
"caching": "ReadWrite",
"diskSizeGB": 30,
"lun": 0,
"managedDisk": {"storageAccountType": "StandardSSD_LRS"},
},
{
"caching": "None",
"diskSizeGB": 200,
"lun": 1,
"managedDisk": {"storageAccountType": "Premium_LRS"},
},
],
"diskEncryptionConfiguration": {"targets": ["OsDisk", "TemporaryDisk"]},
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2016-Datacenter-SmallDisk",
"version": "latest",
},
"licenseType": "Windows_Server",
"nodeAgentSkuId": "batch.node.windows amd64",
"nodePlacementConfiguration": {"policy": "Zonal"},
"osDisk": {"ephemeralOSDiskSettings": {"placement": "CacheDisk"}},
"windowsConfiguration": {"enableAutomaticUpdates": False},
}
},
"networkConfiguration": {
"endpointConfiguration": {
"inboundNatPools": [
{
"backendPort": 12001,
"frontendPortRangeEnd": 15100,
"frontendPortRangeStart": 15000,
"name": "testnat",
"networkSecurityGroupRules": [
{
"access": "Allow",
"priority": 150,
"sourceAddressPrefix": "192.100.12.45",
"sourcePortRanges": ["1", "2"],
},
{
"access": "Deny",
"priority": 3500,
"sourceAddressPrefix": "*",
"sourcePortRanges": ["*"],
},
],
"protocol": "TCP",
}
]
}
},
"scaleSettings": {"autoScale": {"evaluationInterval": "PT5M", "formula": "$TargetDedicatedNodes=1"}},
"vmSize": "STANDARD_D4",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_VirtualMachineConfiguration.json
func ExamplePoolClient_Create_createPoolFullVirtualMachineConfiguration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
DataDisks: []*armbatch.DataDisk{
{
Caching: to.Ptr(armbatch.CachingTypeReadWrite),
DiskSizeGB: to.Ptr[int32](30),
Lun: to.Ptr[int32](0),
ManagedDisk: &armbatch.ManagedDisk{
StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardSSDLRS),
},
},
{
Caching: to.Ptr(armbatch.CachingTypeNone),
DiskSizeGB: to.Ptr[int32](200),
Lun: to.Ptr[int32](1),
ManagedDisk: &armbatch.ManagedDisk{
StorageAccountType: to.Ptr(armbatch.StorageAccountTypePremiumLRS),
},
},
},
DiskEncryptionConfiguration: &armbatch.DiskEncryptionConfiguration{
Targets: []*armbatch.DiskEncryptionTarget{
to.Ptr(armbatch.DiskEncryptionTargetOsDisk),
to.Ptr(armbatch.DiskEncryptionTargetTemporaryDisk),
},
},
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("WindowsServer"),
Publisher: to.Ptr("MicrosoftWindowsServer"),
SKU: to.Ptr("2016-Datacenter-SmallDisk"),
Version: to.Ptr("latest"),
},
LicenseType: to.Ptr("Windows_Server"),
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
NodePlacementConfiguration: &armbatch.NodePlacementConfiguration{
Policy: to.Ptr(armbatch.NodePlacementPolicyTypeZonal),
},
OSDisk: &armbatch.OSDisk{
EphemeralOSDiskSettings: &armbatch.DiffDiskSettings{
Placement: to.Ptr("CacheDisk"),
},
},
WindowsConfiguration: &armbatch.WindowsConfiguration{
EnableAutomaticUpdates: to.Ptr(false),
},
},
},
NetworkConfiguration: &armbatch.NetworkConfiguration{
EndpointConfiguration: &armbatch.PoolEndpointConfiguration{
InboundNatPools: []*armbatch.InboundNatPool{
{
Name: to.Ptr("testnat"),
BackendPort: to.Ptr[int32](12001),
FrontendPortRangeEnd: to.Ptr[int32](15100),
FrontendPortRangeStart: to.Ptr[int32](15000),
NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{
{
Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow),
Priority: to.Ptr[int32](150),
SourceAddressPrefix: to.Ptr("192.100.12.45"),
SourcePortRanges: []*string{
to.Ptr("1"),
to.Ptr("2"),
},
},
{
Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessDeny),
Priority: to.Ptr[int32](3500),
SourceAddressPrefix: to.Ptr("*"),
SourcePortRanges: []*string{
to.Ptr("*"),
},
},
},
Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP),
},
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
AutoScale: &armbatch.AutoScaleSettings{
EvaluationInterval: to.Ptr("PT5M"),
Formula: to.Ptr("$TargetDedicatedNodes=1"),
},
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// DataDisks: []*armbatch.DataDisk{
// {
// Caching: to.Ptr(armbatch.CachingTypeReadWrite),
// DiskSizeGB: to.Ptr[int32](30),
// Lun: to.Ptr[int32](0),
// ManagedDisk: &armbatch.ManagedDisk{
// StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardSSDLRS),
// },
// },
// {
// Caching: to.Ptr(armbatch.CachingTypeNone),
// DiskSizeGB: to.Ptr[int32](200),
// Lun: to.Ptr[int32](1),
// ManagedDisk: &armbatch.ManagedDisk{
// StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS),
// },
// },
// },
// DiskEncryptionConfiguration: &armbatch.DiskEncryptionConfiguration{
// Targets: []*armbatch.DiskEncryptionTarget{
// to.Ptr(armbatch.DiskEncryptionTargetOsDisk),
// to.Ptr(armbatch.DiskEncryptionTargetTemporaryDisk),
// },
// },
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("WindowsServer"),
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// SKU: to.Ptr("2016-Datacenter-SmallDisk"),
// Version: to.Ptr("latest"),
// },
// LicenseType: to.Ptr("Windows_Server"),
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// NodePlacementConfiguration: &armbatch.NodePlacementConfiguration{
// Policy: to.Ptr(armbatch.NodePlacementPolicyTypeZonal),
// },
// WindowsConfiguration: &armbatch.WindowsConfiguration{
// EnableAutomaticUpdates: to.Ptr(false),
// },
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// NetworkConfiguration: &armbatch.NetworkConfiguration{
// EndpointConfiguration: &armbatch.PoolEndpointConfiguration{
// InboundNatPools: []*armbatch.InboundNatPool{
// {
// Name: to.Ptr("testnat"),
// BackendPort: to.Ptr[int32](12001),
// FrontendPortRangeEnd: to.Ptr[int32](15100),
// FrontendPortRangeStart: to.Ptr[int32](15000),
// NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{
// {
// Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow),
// Priority: to.Ptr[int32](150),
// SourceAddressPrefix: to.Ptr("192.100.12.45"),
// SourcePortRanges: []*string{
// to.Ptr("1"),
// to.Ptr("2"),
// },
// },
// {
// Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessDeny),
// Priority: to.Ptr[int32](3500),
// SourceAddressPrefix: to.Ptr("*"),
// SourcePortRanges: []*string{
// to.Ptr("*"),
// },
// },
// },
// Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP),
// },
// },
// },
// },
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// AutoScale: &armbatch.AutoScaleSettings{
// EvaluationInterval: to.Ptr("PT5M"),
// Formula: to.Ptr("$TargetDedicatedNodes=1"),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration.json
*/
async function createPoolFullVirtualMachineConfiguration() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
dataDisks: [
{
caching: "ReadWrite",
diskSizeGB: 30,
lun: 0,
managedDisk: { storageAccountType: "StandardSSD_LRS" },
},
{
caching: "None",
diskSizeGB: 200,
lun: 1,
managedDisk: { storageAccountType: "Premium_LRS" },
},
],
diskEncryptionConfiguration: { targets: ["OsDisk", "TemporaryDisk"] },
imageReference: {
offer: "WindowsServer",
publisher: "MicrosoftWindowsServer",
sku: "2016-Datacenter-SmallDisk",
version: "latest",
},
licenseType: "Windows_Server",
nodeAgentSkuId: "batch.node.windows amd64",
nodePlacementConfiguration: { policy: "Zonal" },
osDisk: { ephemeralOSDiskSettings: { placement: "CacheDisk" } },
windowsConfiguration: { enableAutomaticUpdates: false },
},
},
networkConfiguration: {
endpointConfiguration: {
inboundNatPools: [
{
name: "testnat",
backendPort: 12001,
frontendPortRangeEnd: 15100,
frontendPortRangeStart: 15000,
networkSecurityGroupRules: [
{
access: "Allow",
priority: 150,
sourceAddressPrefix: "192.100.12.45",
sourcePortRanges: ["1", "2"],
},
{
access: "Deny",
priority: 3500,
sourceAddressPrefix: "*",
sourcePortRanges: ["*"],
},
],
protocol: "TCP",
},
],
},
},
scaleSettings: {
autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" },
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_VirtualMachineConfiguration.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2016-Datacenter-SmallDisk",
Version = "latest",
}, "batch.node.windows amd64")
{
IsAutomaticUpdateEnabled = false,
DataDisks = {new BatchVmDataDisk(0, 30)
{
Caching = BatchDiskCachingType.ReadWrite,
ManagedDisk = new ManagedDisk
{
StorageAccountType = BatchStorageAccountType.StandardSsdLrs,
},
}, new BatchVmDataDisk(1, 200)
{
Caching = BatchDiskCachingType.None,
ManagedDisk = new ManagedDisk
{
StorageAccountType = BatchStorageAccountType.PremiumLrs,
},
}},
LicenseType = "Windows_Server",
DiskEncryptionConfiguration = new BatchDiskEncryptionConfiguration
{
Targets = { BatchDiskEncryptionTarget.OSDisk, BatchDiskEncryptionTarget.TemporaryDisk },
},
NodePlacementPolicy = BatchNodePlacementPolicyType.Zonal,
OSDisk = new BatchOSDisk
{
EphemeralOSDiskPlacement = BatchDiffDiskPlacement.CacheDisk,
},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
AutoScale = new BatchAccountAutoScaleSettings("$TargetDedicatedNodes=1")
{
EvaluationInterval = XmlConvert.ToTimeSpan("PT5M"),
},
},
NetworkConfiguration = new BatchNetworkConfiguration
{
EndpointInboundNatPools = {new BatchInboundNatPool("testnat", BatchInboundEndpointProtocol.Tcp, 12001, 15000, 15100)
{
NetworkSecurityGroupRules = {new BatchNetworkSecurityGroupRule(150, BatchNetworkSecurityGroupRuleAccess.Allow, "192.100.12.45")
{
SourcePortRanges = {"1", "2"},
}, new BatchNetworkSecurityGroupRule(3500, BatchNetworkSecurityGroupRuleAccess.Deny, "*")
{
SourcePortRanges = {"*"},
}},
}},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"creationTime": "2017-08-28T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"dataDisks": [
{
"caching": "ReadWrite",
"diskSizeGB": 30,
"lun": 0,
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
}
},
{
"caching": "None",
"diskSizeGB": 200,
"lun": 1,
"managedDisk": {
"storageAccountType": "Standard_LRS"
}
}
],
"diskEncryptionConfiguration": {
"targets": [
"OsDisk",
"TemporaryDisk"
]
},
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2016-Datacenter-SmallDisk",
"version": "latest"
},
"licenseType": "Windows_Server",
"nodeAgentSkuId": "batch.node.windows amd64",
"nodePlacementConfiguration": {
"policy": "Zonal"
},
"windowsConfiguration": {
"enableAutomaticUpdates": false
}
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2017-08-28T10:22:55.9407275Z",
"networkConfiguration": {
"endpointConfiguration": {
"inboundNatPools": [
{
"name": "testnat",
"backendPort": 12001,
"frontendPortRangeEnd": 15100,
"frontendPortRangeStart": 15000,
"networkSecurityGroupRules": [
{
"access": "Allow",
"priority": 150,
"sourceAddressPrefix": "192.100.12.45",
"sourcePortRanges": [
"1",
"2"
]
},
{
"access": "Deny",
"priority": 3500,
"sourceAddressPrefix": "*",
"sourcePortRanges": [
"*"
]
}
],
"protocol": "TCP"
}
]
}
},
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - Minimal VirtualMachineConfiguration
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18.04-LTS",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_minimal_virtual_machine_configuration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18.04-LTS",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
}
},
"scaleSettings": {"autoScale": {"evaluationInterval": "PT5M", "formula": "$TargetDedicatedNodes=1"}},
"vmSize": "STANDARD_D4",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_MinimalVirtualMachineConfiguration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_MinimalVirtualMachineConfiguration.json
func ExamplePoolClient_Create_createPoolMinimalVirtualMachineConfiguration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("UbuntuServer"),
Publisher: to.Ptr("Canonical"),
SKU: to.Ptr("18.04-LTS"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
},
},
ScaleSettings: &armbatch.ScaleSettings{
AutoScale: &armbatch.AutoScaleSettings{
EvaluationInterval: to.Ptr("PT5M"),
Formula: to.Ptr("$TargetDedicatedNodes=1"),
},
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("UbuntuServer"),
// Publisher: to.Ptr("Canonical"),
// SKU: to.Ptr("18.04-LTS"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// AutoScale: &armbatch.AutoScaleSettings{
// EvaluationInterval: to.Ptr("PT5M"),
// Formula: to.Ptr("$TargetDedicatedNodes=1"),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_MinimalVirtualMachineConfiguration.json
*/
async function createPoolMinimalVirtualMachineConfiguration() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "UbuntuServer",
publisher: "Canonical",
sku: "18.04-LTS",
version: "latest",
},
nodeAgentSkuId: "batch.node.ubuntu 18.04",
},
},
scaleSettings: {
autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" },
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "Canonical",
Offer = "UbuntuServer",
Sku = "18.04-LTS",
Version = "latest",
}, "batch.node.ubuntu 18.04"),
ScaleSettings = new BatchAccountPoolScaleSettings
{
AutoScale = new BatchAccountAutoScaleSettings("$TargetDedicatedNodes=1")
{
EvaluationInterval = XmlConvert.ToTimeSpan("PT5M"),
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"creationTime": "2017-08-28T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18.04-LTS",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2017-08-28T10:22:55.9407275Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - No public IP
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"networkConfiguration": {
"publicIPAddressConfiguration": {
"provision": "NoPublicIPAddresses"
},
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_no_public_ip_addresses.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
}
},
"networkConfiguration": {
"publicIPAddressConfiguration": {"provision": "NoPublicIPAddresses"},
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
"vmSize": "STANDARD_D4",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_NoPublicIPAddresses.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_NoPublicIPAddresses.json
func ExamplePoolClient_Create_createPoolNoPublicIP() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
},
},
NetworkConfiguration: &armbatch.NetworkConfiguration{
PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{
Provision: to.Ptr(armbatch.IPAddressProvisioningTypeNoPublicIPAddresses),
},
SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateSteady),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// NetworkConfiguration: &armbatch.NetworkConfiguration{
// PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{
// Provision: to.Ptr(armbatch.IPAddressProvisioningTypeNoPublicIPAddresses),
// },
// SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
// },
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](0),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_NoPublicIPAddresses.json
*/
async function createPoolNoPublicIP() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1",
},
nodeAgentSkuId: "batch.node.ubuntu 18.04",
},
},
networkConfiguration: {
publicIPAddressConfiguration: { provision: "NoPublicIPAddresses" },
subnetId:
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_NoPublicIPAddresses.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Id = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
}, "batch.node.ubuntu 18.04"),
NetworkConfiguration = new BatchNetworkConfiguration
{
SubnetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
PublicIPAddressConfiguration = new BatchPublicIPAddressConfiguration
{
Provision = BatchIPAddressProvisioningType.NoPublicIPAddresses,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Steady",
"allocationStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"creationTime": "2017-08-28T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2017-08-28T10:22:55.9407275Z",
"networkConfiguration": {
"publicIPAddressConfiguration": {
"provision": "NoPublicIPAddresses"
},
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"
},
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 0,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - Public IPs
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"networkConfiguration": {
"publicIPAddressConfiguration": {
"ipAddressIds": [
"/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"
],
"provision": "UserManaged"
},
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_public_ips.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
}
},
"networkConfiguration": {
"publicIPAddressConfiguration": {
"ipAddressIds": [
"/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"
],
"provision": "UserManaged",
},
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
"vmSize": "STANDARD_D4",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_PublicIPs.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_PublicIPs.json
func ExamplePoolClient_Create_createPoolPublicIPs() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
},
},
NetworkConfiguration: &armbatch.NetworkConfiguration{
PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{
IPAddressIDs: []*string{
to.Ptr("/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"),
},
Provision: to.Ptr(armbatch.IPAddressProvisioningTypeUserManaged),
},
SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateSteady),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// NetworkConfiguration: &armbatch.NetworkConfiguration{
// PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{
// IPAddressIDs: []*string{
// to.Ptr("/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"),
// },
// Provision: to.Ptr(armbatch.IPAddressProvisioningTypeUserManaged),
// },
// SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
// },
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// TargetDedicatedNodes: to.Ptr[int32](0),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_PublicIPs.json
*/
async function createPoolPublicIPs() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1",
},
nodeAgentSkuId: "batch.node.ubuntu 18.04",
},
},
networkConfiguration: {
publicIPAddressConfiguration: {
ipAddressIds: [
"/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135",
],
provision: "UserManaged",
},
subnetId:
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_PublicIPs.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Id = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"),
}, "batch.node.ubuntu 18.04"),
NetworkConfiguration = new BatchNetworkConfiguration
{
SubnetId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"),
PublicIPAddressConfiguration = new BatchPublicIPAddressConfiguration
{
Provision = BatchIPAddressProvisioningType.UserManaged,
IPAddressIds = { new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135") },
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Steady",
"allocationStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"creationTime": "2017-08-28T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2017-08-28T10:22:55.9407275Z",
"networkConfiguration": {
"publicIPAddressConfiguration": {
"ipAddressIds": [
"/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"
],
"provision": "UserManaged"
},
"subnetId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"
},
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 0,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - SecurityProfile
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18_04-lts-gen2",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
"securityProfile": {
"encryptionAtHost": true,
"securityType": "trustedLaunch",
"uefiSettings": {
"secureBootEnabled": null,
"vTpmEnabled": false
}
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"vmSize": "Standard_d4s_v3"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_security_profile.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18_04-lts-gen2",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
"securityProfile": {
"encryptionAtHost": True,
"securityType": "trustedLaunch",
"uefiSettings": {"secureBootEnabled": None, "vTpmEnabled": False},
},
}
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 1, "targetLowPriorityNodes": 0}},
"vmSize": "Standard_d4s_v3",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_SecurityProfile.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_SecurityProfile.json
func ExamplePoolClient_Create_createPoolSecurityProfile() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("UbuntuServer"),
Publisher: to.Ptr("Canonical"),
SKU: to.Ptr("18_04-lts-gen2"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
SecurityProfile: &armbatch.SecurityProfile{
EncryptionAtHost: to.Ptr(true),
SecurityType: to.Ptr(armbatch.SecurityTypesTrustedLaunch),
UefiSettings: &armbatch.UefiSettings{
VTpmEnabled: to.Ptr(false),
},
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
VMSize: to.Ptr("Standard_d4s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8DB554F8E08BCF4\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("UbuntuServer"),
// Publisher: to.Ptr("Canonical"),
// SKU: to.Ptr("18_04-lts-gen2"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
// SecurityProfile: &armbatch.SecurityProfile{
// EncryptionAtHost: to.Ptr(true),
// SecurityType: to.Ptr(armbatch.SecurityTypesTrustedLaunch),
// UefiSettings: &armbatch.UefiSettings{
// VTpmEnabled: to.Ptr(false),
// },
// },
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// TargetDedicatedNodes: to.Ptr[int32](1),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// ResizeTimeout: to.Ptr("PT15M"),
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4S_V3"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_SecurityProfile.json
*/
async function createPoolSecurityProfile() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "UbuntuServer",
publisher: "Canonical",
sku: "18_04-lts-gen2",
version: "latest",
},
nodeAgentSkuId: "batch.node.ubuntu 18.04",
securityProfile: {
encryptionAtHost: true,
securityType: "trustedLaunch",
uefiSettings: { vTpmEnabled: false },
},
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } },
vmSize: "Standard_d4s_v3",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_SecurityProfile.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_d4s_v3",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "Canonical",
Offer = "UbuntuServer",
Sku = "18_04-lts-gen2",
Version = "latest",
}, "batch.node.ubuntu 18.04")
{
SecurityProfile = new BatchSecurityProfile
{
SecurityType = BatchSecurityType.TrustedLaunch,
EncryptionAtHost = true,
UefiSettings = new BatchUefiSettings
{
IsSecureBootEnabled = default,
IsVTpmEnabled = false,
},
},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 1,
TargetLowPriorityNodes = 0,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8DB554F8E08BCF4"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2023-06-14T07:03:58.3231917Z",
"creationTime": "2023-06-14T07:03:58.3231917Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18_04-lts-gen2",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
"securityProfile": {
"encryptionAtHost": true,
"securityType": "trustedLaunch",
"uefiSettings": {
"vTpmEnabled": false
}
}
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2023-06-14T07:03:58.3231917Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2023-06-14T07:03:58.3231917Z",
"resizeOperationStatus": {
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2023-06-14T07:03:58.3231917Z",
"targetDedicatedNodes": 1
},
"scaleSettings": {
"fixedScale": {
"resizeTimeout": "PT15M",
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4S_V3"
}
}
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "0001-com-ubuntu-server-jammy",
"publisher": "Canonical",
"sku": "22_04-lts",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 22.04"
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"vmSize": "Standard_d4s_v3"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_tags.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "0001-com-ubuntu-server-jammy",
"publisher": "Canonical",
"sku": "22_04-lts",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.ubuntu 22.04",
}
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 1, "targetLowPriorityNodes": 0}},
"vmSize": "Standard_d4s_v3",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_Tags.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_Tags.json
func ExamplePoolClient_Create_createPoolTags() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("0001-com-ubuntu-server-jammy"),
Publisher: to.Ptr("Canonical"),
SKU: to.Ptr("22_04-lts"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 22.04"),
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
VMSize: to.Ptr("Standard_d4s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8DB554F8E08BCF4\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("0001-com-ubuntu-server-jammy"),
// Publisher: to.Ptr("Canonical"),
// SKU: to.Ptr("22_04-lts"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 22.04"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()),
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-27T07:33:13.0625789Z"); return t}()),
// TargetDedicatedNodes: to.Ptr[int32](1),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// ResizeTimeout: to.Ptr("PT15M"),
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4S_V3"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_Tags.json
*/
async function createPoolTags() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "0001-com-ubuntu-server-jammy",
publisher: "Canonical",
sku: "22_04-lts",
version: "latest",
},
nodeAgentSkuId: "batch.node.ubuntu 22.04",
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } },
vmSize: "Standard_d4s_v3",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_Tags.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_d4s_v3",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "Canonical",
Offer = "0001-com-ubuntu-server-jammy",
Sku = "22_04-lts",
Version = "latest",
}, "batch.node.ubuntu 22.04"),
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 1,
TargetLowPriorityNodes = 0,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8DB554F8E08BCF4"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2023-06-14T07:03:58.3231917Z",
"creationTime": "2023-06-14T07:03:58.3231917Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "0001-com-ubuntu-server-jammy",
"publisher": "Canonical",
"sku": "22_04-lts",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 22.04"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2023-06-14T07:03:58.3231917Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2023-06-14T07:03:58.3231917Z",
"resizeOperationStatus": {
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2023-09-27T07:33:13.0625789Z",
"targetDedicatedNodes": 1
},
"scaleSettings": {
"fixedScale": {
"resizeTimeout": "PT15M",
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4S_V3"
}
}
CreatePool - UpgradePolicy
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"nodePlacementConfiguration": {
"policy": "Zonal"
},
"windowsConfiguration": {
"enableAutomaticUpdates": false
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 2,
"targetLowPriorityNodes": 0
}
},
"upgradePolicy": {
"automaticOSUpgradePolicy": {
"disableAutomaticRollback": true,
"enableAutomaticOSUpgrade": true,
"osRollingUpgradeDeferral": true,
"useRollingUpgradePolicy": true
},
"mode": "automatic",
"rollingUpgradePolicy": {
"enableCrossZoneUpgrade": true,
"maxBatchInstancePercent": 20,
"maxUnhealthyInstancePercent": 20,
"maxUnhealthyUpgradedInstancePercent": 20,
"pauseTimeBetweenBatches": "PT0S",
"prioritizeUnhealthyInstances": false,
"rollbackFailedInstancesOnPolicyBreach": false
}
},
"vmSize": "Standard_d4s_v3"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_upgrade_policy.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-smalldisk",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.windows amd64",
"nodePlacementConfiguration": {"policy": "Zonal"},
"windowsConfiguration": {"enableAutomaticUpdates": False},
}
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 2, "targetLowPriorityNodes": 0}},
"upgradePolicy": {
"automaticOSUpgradePolicy": {
"disableAutomaticRollback": True,
"enableAutomaticOSUpgrade": True,
"osRollingUpgradeDeferral": True,
"useRollingUpgradePolicy": True,
},
"mode": "automatic",
"rollingUpgradePolicy": {
"enableCrossZoneUpgrade": True,
"maxBatchInstancePercent": 20,
"maxUnhealthyInstancePercent": 20,
"maxUnhealthyUpgradedInstancePercent": 20,
"pauseTimeBetweenBatches": "PT0S",
"prioritizeUnhealthyInstances": False,
"rollbackFailedInstancesOnPolicyBreach": False,
},
},
"vmSize": "Standard_d4s_v3",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_UpgradePolicy.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_UpgradePolicy.json
func ExamplePoolClient_Create_createPoolUpgradePolicy() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("WindowsServer"),
Publisher: to.Ptr("MicrosoftWindowsServer"),
SKU: to.Ptr("2019-datacenter-smalldisk"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
NodePlacementConfiguration: &armbatch.NodePlacementConfiguration{
Policy: to.Ptr(armbatch.NodePlacementPolicyTypeZonal),
},
WindowsConfiguration: &armbatch.WindowsConfiguration{
EnableAutomaticUpdates: to.Ptr(false),
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](2),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
UpgradePolicy: &armbatch.UpgradePolicy{
AutomaticOSUpgradePolicy: &armbatch.AutomaticOSUpgradePolicy{
DisableAutomaticRollback: to.Ptr(true),
EnableAutomaticOSUpgrade: to.Ptr(true),
OSRollingUpgradeDeferral: to.Ptr(true),
UseRollingUpgradePolicy: to.Ptr(true),
},
Mode: to.Ptr(armbatch.UpgradeModeAutomatic),
RollingUpgradePolicy: &armbatch.RollingUpgradePolicy{
EnableCrossZoneUpgrade: to.Ptr(true),
MaxBatchInstancePercent: to.Ptr[int32](20),
MaxUnhealthyInstancePercent: to.Ptr[int32](20),
MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](20),
PauseTimeBetweenBatches: to.Ptr("PT0S"),
PrioritizeUnhealthyInstances: to.Ptr(false),
RollbackFailedInstancesOnPolicyBreach: to.Ptr(false),
},
},
VMSize: to.Ptr("Standard_d4s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8DB51E64D3C3B69\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("WindowsServer"),
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// SKU: to.Ptr("2019-datacenter-smalldisk"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// NodePlacementConfiguration: &armbatch.NodePlacementConfiguration{
// Policy: to.Ptr(armbatch.NodePlacementPolicyTypeZonal),
// },
// WindowsConfiguration: &armbatch.WindowsConfiguration{
// EnableAutomaticUpdates: to.Ptr(false),
// },
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()),
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()),
// TargetDedicatedNodes: to.Ptr[int32](2),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// ResizeTimeout: to.Ptr("PT15M"),
// TargetDedicatedNodes: to.Ptr[int32](2),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// UpgradePolicy: &armbatch.UpgradePolicy{
// AutomaticOSUpgradePolicy: &armbatch.AutomaticOSUpgradePolicy{
// DisableAutomaticRollback: to.Ptr(true),
// EnableAutomaticOSUpgrade: to.Ptr(true),
// OSRollingUpgradeDeferral: to.Ptr(true),
// UseRollingUpgradePolicy: to.Ptr(true),
// },
// Mode: to.Ptr(armbatch.UpgradeModeAutomatic),
// RollingUpgradePolicy: &armbatch.RollingUpgradePolicy{
// EnableCrossZoneUpgrade: to.Ptr(true),
// MaxBatchInstancePercent: to.Ptr[int32](20),
// MaxUnhealthyInstancePercent: to.Ptr[int32](20),
// MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](20),
// PauseTimeBetweenBatches: to.Ptr("PT0S"),
// PrioritizeUnhealthyInstances: to.Ptr(false),
// RollbackFailedInstancesOnPolicyBreach: to.Ptr(false),
// },
// },
// VMSize: to.Ptr("STANDARD_D4S_V3"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_UpgradePolicy.json
*/
async function createPoolUpgradePolicy() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "WindowsServer",
publisher: "MicrosoftWindowsServer",
sku: "2019-datacenter-smalldisk",
version: "latest",
},
nodeAgentSkuId: "batch.node.windows amd64",
nodePlacementConfiguration: { policy: "Zonal" },
windowsConfiguration: { enableAutomaticUpdates: false },
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 } },
upgradePolicy: {
automaticOSUpgradePolicy: {
disableAutomaticRollback: true,
enableAutomaticOSUpgrade: true,
osRollingUpgradeDeferral: true,
useRollingUpgradePolicy: true,
},
mode: "automatic",
rollingUpgradePolicy: {
enableCrossZoneUpgrade: true,
maxBatchInstancePercent: 20,
maxUnhealthyInstancePercent: 20,
maxUnhealthyUpgradedInstancePercent: 20,
pauseTimeBetweenBatches: "PT0S",
prioritizeUnhealthyInstances: false,
rollbackFailedInstancesOnPolicyBreach: false,
},
},
vmSize: "Standard_d4s_v3",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_UpgradePolicy.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_d4s_v3",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2019-datacenter-smalldisk",
Version = "latest",
}, "batch.node.windows amd64")
{
IsAutomaticUpdateEnabled = false,
NodePlacementPolicy = BatchNodePlacementPolicyType.Zonal,
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 2,
TargetLowPriorityNodes = 0,
},
},
UpgradePolicy = new UpgradePolicy(UpgradeMode.Automatic)
{
AutomaticOSUpgradePolicy = new AutomaticOSUpgradePolicy
{
DisableAutomaticRollback = true,
EnableAutomaticOSUpgrade = true,
UseRollingUpgradePolicy = true,
OSRollingUpgradeDeferral = true,
},
RollingUpgradePolicy = new RollingUpgradePolicy
{
EnableCrossZoneUpgrade = true,
MaxBatchInstancePercent = 20,
MaxUnhealthyInstancePercent = 20,
MaxUnhealthyUpgradedInstancePercent = 20,
PauseTimeBetweenBatches = "PT0S",
PrioritizeUnhealthyInstances = false,
RollbackFailedInstancesOnPolicyBreach = false,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8DB51E64D3C3B69"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2023-05-11T06:16:44.2372184Z",
"creationTime": "2023-05-11T06:16:44.2372184Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"nodePlacementConfiguration": {
"policy": "Zonal"
},
"windowsConfiguration": {
"enableAutomaticUpdates": false
}
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2023-05-11T06:16:44.2372184Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2023-05-11T06:16:44.2372184Z",
"resizeOperationStatus": {
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2023-05-11T06:16:44.2372184Z",
"targetDedicatedNodes": 2
},
"scaleSettings": {
"fixedScale": {
"resizeTimeout": "PT15M",
"targetDedicatedNodes": 2,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"upgradePolicy": {
"automaticOSUpgradePolicy": {
"disableAutomaticRollback": true,
"enableAutomaticOSUpgrade": true,
"osRollingUpgradeDeferral": true,
"useRollingUpgradePolicy": true
},
"mode": "automatic",
"rollingUpgradePolicy": {
"enableCrossZoneUpgrade": true,
"maxBatchInstancePercent": 20,
"maxUnhealthyInstancePercent": 20,
"maxUnhealthyUpgradedInstancePercent": 20,
"pauseTimeBetweenBatches": "PT0S",
"prioritizeUnhealthyInstances": false,
"rollbackFailedInstancesOnPolicyBreach": false
}
},
"vmSize": "STANDARD_D4S_V3"
}
}
CreatePool - UserAssignedIdentities
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}
}
},
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18.04-LTS",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_user_assigned_identities.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {},
},
},
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18.04-LTS",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04",
}
},
"scaleSettings": {"autoScale": {"evaluationInterval": "PT5M", "formula": "$TargetDedicatedNodes=1"}},
"vmSize": "STANDARD_D4",
},
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_UserAssignedIdentities.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_UserAssignedIdentities.json
func ExamplePoolClient_Create_createPoolUserAssignedIdentities() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Identity: &armbatch.PoolIdentity{
Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {},
},
},
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("UbuntuServer"),
Publisher: to.Ptr("Canonical"),
SKU: to.Ptr("18.04-LTS"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
},
},
ScaleSettings: &armbatch.ScaleSettings{
AutoScale: &armbatch.AutoScaleSettings{
EvaluationInterval: to.Ptr("PT5M"),
Formula: to.Ptr("$TargetDedicatedNodes=1"),
},
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Identity: &armbatch.PoolIdentity{
// Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{
// "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armbatch.UserAssignedIdentities{
// ClientID: to.Ptr("clientId1"),
// PrincipalID: to.Ptr("principalId1"),
// },
// "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armbatch.UserAssignedIdentities{
// ClientID: to.Ptr("clientId2"),
// PrincipalID: to.Ptr("principalId2"),
// },
// },
// },
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("UbuntuServer"),
// Publisher: to.Ptr("Canonical"),
// SKU: to.Ptr("18.04-LTS"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"),
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// AutoScale: &armbatch.AutoScaleSettings{
// EvaluationInterval: to.Ptr("PT5M"),
// Formula: to.Ptr("$TargetDedicatedNodes=1"),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_UserAssignedIdentities.json
*/
async function createPoolUserAssignedIdentities() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1":
{},
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2":
{},
},
},
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "UbuntuServer",
publisher: "Canonical",
sku: "18.04-LTS",
version: "latest",
},
nodeAgentSkuId: "batch.node.ubuntu 18.04",
},
},
scaleSettings: {
autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" },
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_UserAssignedIdentities.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(),
[new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2")] = new UserAssignedIdentity()
},
},
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "Canonical",
Offer = "UbuntuServer",
Sku = "18.04-LTS",
Version = "latest",
}, "batch.node.ubuntu 18.04"),
ScaleSettings = new BatchAccountPoolScaleSettings
{
AutoScale = new BatchAccountAutoScaleSettings("$TargetDedicatedNodes=1")
{
EvaluationInterval = XmlConvert.ToTimeSpan("PT5M"),
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
"clientId": "clientId1",
"principalId": "principalId1"
},
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {
"clientId": "clientId2",
"principalId": "principalId2"
}
}
},
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2020-10-01T10:22:55.9407275Z",
"creationTime": "2020-10-01T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "18.04-LTS",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.ubuntu 18.04"
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2020-10-01T10:22:55.9407275Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2020-10-01T10:22:55.9407275Z",
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - VirtualMachineConfiguration Extensions
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "0001-com-ubuntu-server-focal",
"publisher": "Canonical",
"sku": "20_04-lts"
},
"nodeAgentSkuId": "batch.node.ubuntu 20.04",
"extensions": [
{
"name": "batchextension1",
"type": "KeyVaultForLinux",
"autoUpgradeMinorVersion": true,
"enableAutomaticUpgrade": true,
"publisher": "Microsoft.Azure.KeyVault",
"settings": {
"authenticationSettingsKey": "authenticationSettingsValue",
"secretsManagementSettingsKey": "secretsManagementSettingsValue"
},
"typeHandlerVersion": "2.0"
}
]
}
},
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"vmSize": "STANDARD_D4"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_virtual_machine_configuration_extensions.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"extensions": [
{
"autoUpgradeMinorVersion": True,
"enableAutomaticUpgrade": True,
"name": "batchextension1",
"publisher": "Microsoft.Azure.KeyVault",
"settings": {
"authenticationSettingsKey": "authenticationSettingsValue",
"secretsManagementSettingsKey": "secretsManagementSettingsValue",
},
"type": "KeyVaultForLinux",
"typeHandlerVersion": "2.0",
}
],
"imageReference": {
"offer": "0001-com-ubuntu-server-focal",
"publisher": "Canonical",
"sku": "20_04-lts",
},
"nodeAgentSkuId": "batch.node.ubuntu 20.04",
}
},
"scaleSettings": {"autoScale": {"evaluationInterval": "PT5M", "formula": "$TargetDedicatedNodes=1"}},
"vmSize": "STANDARD_D4",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_Extensions.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_VirtualMachineConfiguration_Extensions.json
func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationExtensions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("0001-com-ubuntu-server-focal"),
Publisher: to.Ptr("Canonical"),
SKU: to.Ptr("20_04-lts"),
},
NodeAgentSKUID: to.Ptr("batch.node.ubuntu 20.04"),
Extensions: []*armbatch.VMExtension{
{
Name: to.Ptr("batchextension1"),
Type: to.Ptr("KeyVaultForLinux"),
AutoUpgradeMinorVersion: to.Ptr(true),
EnableAutomaticUpgrade: to.Ptr(true),
Publisher: to.Ptr("Microsoft.Azure.KeyVault"),
Settings: map[string]any{
"authenticationSettingsKey": "authenticationSettingsValue",
"secretsManagementSettingsKey": "secretsManagementSettingsValue",
},
TypeHandlerVersion: to.Ptr("2.0"),
},
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
AutoScale: &armbatch.AutoScaleSettings{
EvaluationInterval: to.Ptr("PT5M"),
Formula: to.Ptr("$TargetDedicatedNodes=1"),
},
},
VMSize: to.Ptr("STANDARD_D4"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8D4EDFEBFADF4AB\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("0001-com-ubuntu-server-focal"),
// Publisher: to.Ptr("Canonical"),
// SKU: to.Ptr("20_04-lts"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.ubuntu 20.04"),
// Extensions: []*armbatch.VMExtension{
// {
// Name: to.Ptr("batchextension1"),
// Type: to.Ptr("KeyVaultForLinux"),
// AutoUpgradeMinorVersion: to.Ptr(true),
// EnableAutomaticUpgrade: to.Ptr(true),
// Publisher: to.Ptr("Microsoft.Azure.KeyVault"),
// Settings: map[string]any{
// "authenticationSettingsKey": "authenticationSettingsValue",
// "secretsManagementSettingsKey": "secretsManagementSettingsValue",
// },
// TypeHandlerVersion: to.Ptr("2.0"),
// },
// },
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()),
// ScaleSettings: &armbatch.ScaleSettings{
// AutoScale: &armbatch.AutoScaleSettings{
// EvaluationInterval: to.Ptr("PT5M"),
// Formula: to.Ptr("$TargetDedicatedNodes=1"),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D4"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_Extensions.json
*/
async function createPoolVirtualMachineConfigurationExtensions() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "0001-com-ubuntu-server-focal",
publisher: "Canonical",
sku: "20_04-lts",
},
nodeAgentSkuId: "batch.node.ubuntu 20.04",
extensions: [
{
name: "batchextension1",
type: "KeyVaultForLinux",
autoUpgradeMinorVersion: true,
enableAutomaticUpgrade: true,
publisher: "Microsoft.Azure.KeyVault",
settings: {
authenticationSettingsKey: "authenticationSettingsValue",
secretsManagementSettingsKey: "secretsManagementSettingsValue",
},
typeHandlerVersion: "2.0",
},
],
},
},
scaleSettings: {
autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" },
},
vmSize: "STANDARD_D4",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "STANDARD_D4",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "Canonical",
Offer = "0001-com-ubuntu-server-focal",
Sku = "20_04-lts",
}, "batch.node.ubuntu 20.04")
{
Extensions = {new BatchVmExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux")
{
TypeHandlerVersion = "2.0",
AutoUpgradeMinorVersion = true,
EnableAutomaticUpgrade = true,
Settings = BinaryData.FromObjectAsJson(new
{
authenticationSettingsKey = "authenticationSettingsValue",
secretsManagementSettingsKey = "secretsManagementSettingsValue",
}),
}},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
AutoScale = new BatchAccountAutoScaleSettings("$TargetDedicatedNodes=1")
{
EvaluationInterval = XmlConvert.ToTimeSpan("PT5M"),
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8D4EDFEBFADF4AB"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"creationTime": "2017-08-28T10:22:55.9407275Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "0001-com-ubuntu-server-focal",
"publisher": "Canonical",
"sku": "20_04-lts"
},
"nodeAgentSkuId": "batch.node.ubuntu 20.04",
"extensions": [
{
"name": "batchextension1",
"type": "KeyVaultForLinux",
"autoUpgradeMinorVersion": true,
"enableAutomaticUpgrade": true,
"publisher": "Microsoft.Azure.KeyVault",
"settings": {
"authenticationSettingsKey": "authenticationSettingsValue",
"secretsManagementSettingsKey": "secretsManagementSettingsValue"
},
"typeHandlerVersion": "2.0"
}
]
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2017-08-28T10:22:55.9407275Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2017-08-28T10:22:55.9407275Z",
"scaleSettings": {
"autoScale": {
"evaluationInterval": "PT5M",
"formula": "$TargetDedicatedNodes=1"
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D4"
}
}
CreatePool - VirtualMachineConfiguration OSDisk
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "windowsserver",
"publisher": "microsoftwindowsserver",
"sku": "2022-datacenter-smalldisk"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"osDisk": {
"caching": "ReadWrite",
"diskSizeGB": 100,
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
},
"writeAcceleratorEnabled": false
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"vmSize": "Standard_d2s_v3"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_virtual_machine_configuration_managed_os_disk.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "windowsserver",
"publisher": "microsoftwindowsserver",
"sku": "2022-datacenter-smalldisk",
},
"nodeAgentSkuId": "batch.node.windows amd64",
"osDisk": {
"caching": "ReadWrite",
"diskSizeGB": 100,
"managedDisk": {"storageAccountType": "StandardSSD_LRS"},
"writeAcceleratorEnabled": False,
},
}
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 1, "targetLowPriorityNodes": 0}},
"vmSize": "Standard_d2s_v3",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json
func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationOSDisk() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("windowsserver"),
Publisher: to.Ptr("microsoftwindowsserver"),
SKU: to.Ptr("2022-datacenter-smalldisk"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
OSDisk: &armbatch.OSDisk{
Caching: to.Ptr(armbatch.CachingTypeReadWrite),
DiskSizeGB: to.Ptr[int32](100),
ManagedDisk: &armbatch.ManagedDisk{
StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardSSDLRS),
},
WriteAcceleratorEnabled: to.Ptr(false),
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](1),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
VMSize: to.Ptr("Standard_d2s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8DB51F14DC1A8AD\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("testpool"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("windowsserver"),
// Publisher: to.Ptr("microsoftwindowsserver"),
// SKU: to.Ptr("2022-datacenter-smalldisk"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// OSDisk: &armbatch.OSDisk{
// Caching: to.Ptr(armbatch.CachingTypeReadWrite),
// DiskSizeGB: to.Ptr[int32](100),
// ManagedDisk: &armbatch.ManagedDisk{
// StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardSSDLRS),
// },
// WriteAcceleratorEnabled: to.Ptr(false),
// },
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()),
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()),
// TargetDedicatedNodes: to.Ptr[int32](1),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// ResizeTimeout: to.Ptr("PT15M"),
// TargetDedicatedNodes: to.Ptr[int32](1),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// VMSize: to.Ptr("STANDARD_D2_V3"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json
*/
async function createPoolVirtualMachineConfigurationOSDisk() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "windowsserver",
publisher: "microsoftwindowsserver",
sku: "2022-datacenter-smalldisk",
},
nodeAgentSkuId: "batch.node.windows amd64",
osDisk: {
caching: "ReadWrite",
diskSizeGB: 100,
managedDisk: { storageAccountType: "StandardSSD_LRS" },
writeAcceleratorEnabled: false,
},
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } },
vmSize: "Standard_d2s_v3",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_d2s_v3",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "microsoftwindowsserver",
Offer = "windowsserver",
Sku = "2022-datacenter-smalldisk",
}, "batch.node.windows amd64")
{
OSDisk = new BatchOSDisk
{
Caching = BatchDiskCachingType.ReadWrite,
ManagedDisk = new ManagedDisk
{
StorageAccountType = BatchStorageAccountType.StandardSsdLrs,
},
DiskSizeGB = 100,
IsWriteAcceleratorEnabled = false,
},
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 1,
TargetLowPriorityNodes = 0,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8DB51F14DC1A8AD"
{
"name": "testpool",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2023-08-24T02:12:27.7527697Z",
"creationTime": "2023-08-24T02:12:27.7527697Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "windowsserver",
"publisher": "microsoftwindowsserver",
"sku": "2022-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"osDisk": {
"caching": "ReadWrite",
"diskSizeGB": 100,
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
},
"writeAcceleratorEnabled": false
}
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2023-08-24T02:12:27.7527697Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2023-08-24T02:12:27.7527697Z",
"resizeOperationStatus": {
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2023-08-24T02:12:27.7527697Z",
"targetDedicatedNodes": 1
},
"scaleSettings": {
"fixedScale": {
"resizeTimeout": "PT15M",
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"vmSize": "STANDARD_D2_V3"
}
}
CreatePool - VirtualMachineConfiguration ServiceArtifactReference
Mintakérelem
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool?api-version=2025-06-01
{
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"serviceArtifactReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"
},
"windowsConfiguration": {
"enableAutomaticUpdates": false
}
}
},
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 2,
"targetLowPriorityNodes": 0
}
},
"upgradePolicy": {
"automaticOSUpgradePolicy": {
"enableAutomaticOSUpgrade": true
},
"mode": "automatic"
},
"vmSize": "Standard_d4s_v3"
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python pool_create_virtual_machine_configuration_service_artifact_reference.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.pool.create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
pool_name="testpool",
parameters={
"properties": {
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-smalldisk",
"version": "latest",
},
"nodeAgentSkuId": "batch.node.windows amd64",
"serviceArtifactReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"
},
"windowsConfiguration": {"enableAutomaticUpdates": False},
}
},
"scaleSettings": {"fixedScale": {"targetDedicatedNodes": 2, "targetLowPriorityNodes": 0}},
"upgradePolicy": {"automaticOSUpgradePolicy": {"enableAutomaticOSUpgrade": True}, "mode": "automatic"},
"vmSize": "Standard_d4s_v3",
}
},
)
print(response)
# x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4"
)
// Generated from example definition: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json
func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationServiceArtifactReference() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{
Properties: &armbatch.PoolProperties{
DeploymentConfiguration: &armbatch.DeploymentConfiguration{
VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
ImageReference: &armbatch.ImageReference{
Offer: to.Ptr("WindowsServer"),
Publisher: to.Ptr("MicrosoftWindowsServer"),
SKU: to.Ptr("2019-datacenter-smalldisk"),
Version: to.Ptr("latest"),
},
NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
ServiceArtifactReference: &armbatch.ServiceArtifactReference{
ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"),
},
WindowsConfiguration: &armbatch.WindowsConfiguration{
EnableAutomaticUpdates: to.Ptr(false),
},
},
},
ScaleSettings: &armbatch.ScaleSettings{
FixedScale: &armbatch.FixedScaleSettings{
TargetDedicatedNodes: to.Ptr[int32](2),
TargetLowPriorityNodes: to.Ptr[int32](0),
},
},
UpgradePolicy: &armbatch.UpgradePolicy{
AutomaticOSUpgradePolicy: &armbatch.AutomaticOSUpgradePolicy{
EnableAutomaticOSUpgrade: to.Ptr(true),
},
Mode: to.Ptr(armbatch.UpgradeModeAutomatic),
},
VMSize: to.Ptr("Standard_d4s_v3"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbatch.PoolClientCreateResponse{
// ETag: "W/\"0x8DB51F14DC1A8AD\""
// Pool: &armbatch.Pool{
// Name: to.Ptr("mypool41"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"),
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"),
// Properties: &armbatch.PoolProperties{
// AllocationState: to.Ptr(armbatch.AllocationStateResizing),
// AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()),
// CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()),
// CurrentDedicatedNodes: to.Ptr[int32](0),
// CurrentLowPriorityNodes: to.Ptr[int32](0),
// DeploymentConfiguration: &armbatch.DeploymentConfiguration{
// VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{
// ImageReference: &armbatch.ImageReference{
// Offer: to.Ptr("WindowsServer"),
// Publisher: to.Ptr("MicrosoftWindowsServer"),
// SKU: to.Ptr("2019-datacenter-smalldisk"),
// Version: to.Ptr("latest"),
// },
// NodeAgentSKUID: to.Ptr("batch.node.windows amd64"),
// ServiceArtifactReference: &armbatch.ServiceArtifactReference{
// ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"),
// },
// WindowsConfiguration: &armbatch.WindowsConfiguration{
// EnableAutomaticUpdates: to.Ptr(false),
// },
// },
// },
// InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled),
// LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()),
// ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded),
// ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()),
// ResizeOperationStatus: &armbatch.ResizeOperationStatus{
// NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue),
// ResizeTimeout: to.Ptr("PT15M"),
// StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()),
// TargetDedicatedNodes: to.Ptr[int32](2),
// },
// ScaleSettings: &armbatch.ScaleSettings{
// FixedScale: &armbatch.FixedScaleSettings{
// ResizeTimeout: to.Ptr("PT15M"),
// TargetDedicatedNodes: to.Ptr[int32](2),
// TargetLowPriorityNodes: to.Ptr[int32](0),
// },
// },
// TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{
// NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread),
// },
// TaskSlotsPerNode: to.Ptr[int32](1),
// UpgradePolicy: &armbatch.UpgradePolicy{
// AutomaticOSUpgradePolicy: &armbatch.AutomaticOSUpgradePolicy{
// EnableAutomaticOSUpgrade: to.Ptr(true),
// },
// Mode: to.Ptr(armbatch.UpgradeModeAutomatic),
// },
// VMSize: to.Ptr("STANDARD_D4S_V3"),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to creates a new pool inside the specified account.
*
* @summary creates a new pool inside the specified account.
* x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json
*/
async function createPoolVirtualMachineConfigurationServiceArtifactReference() {
const credential = new DefaultAzureCredential();
const subscriptionId = "12345678-1234-1234-1234-123456789012";
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.pool.create(
"default-azurebatch-japaneast",
"sampleacct",
"testpool",
{
deploymentConfiguration: {
virtualMachineConfiguration: {
imageReference: {
offer: "WindowsServer",
publisher: "MicrosoftWindowsServer",
sku: "2019-datacenter-smalldisk",
version: "latest",
},
nodeAgentSkuId: "batch.node.windows amd64",
serviceArtifactReference: {
id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile",
},
windowsConfiguration: { enableAutomaticUpdates: false },
},
},
scaleSettings: { fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 } },
upgradePolicy: {
automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true },
mode: "automatic",
},
vmSize: "Standard_d4s_v3",
},
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/Batch/stable/2025-06-01/examples/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json
// this example is just showing the usage of "Pool_Create" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this BatchAccountResource created on azure
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
string subscriptionId = "12345678-1234-1234-1234-123456789012";
string resourceGroupName = "default-azurebatch-japaneast";
string accountName = "sampleacct";
ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId);
// get the collection of this BatchAccountPoolResource
BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools();
// invoke the operation
string poolName = "testpool";
BatchAccountPoolData data = new BatchAccountPoolData
{
VmSize = "Standard_d4s_v3",
DeploymentVmConfiguration = new BatchVmConfiguration(new BatchImageReference
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2019-datacenter-smalldisk",
Version = "latest",
}, "batch.node.windows amd64")
{
IsAutomaticUpdateEnabled = false,
ServiceArtifactReferenceId = new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"),
},
ScaleSettings = new BatchAccountPoolScaleSettings
{
FixedScale = new BatchAccountFixedScaleSettings
{
TargetDedicatedNodes = 2,
TargetLowPriorityNodes = 0,
},
},
UpgradePolicy = new UpgradePolicy(UpgradeMode.Automatic)
{
AutomaticOSUpgradePolicy = new AutomaticOSUpgradePolicy
{
EnableAutomaticOSUpgrade = true,
},
},
};
ArmOperation<BatchAccountPoolResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, poolName, data);
BatchAccountPoolResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
BatchAccountPoolData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Mintaválasz
ETag: W/"0x8DB51F14DC1A8AD"
{
"name": "mypool41",
"type": "Microsoft.Batch/batchAccounts/pools",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool",
"properties": {
"allocationState": "Resizing",
"allocationStateTransitionTime": "2023-05-11T07:44:44.8580493Z",
"creationTime": "2023-05-11T07:44:44.8580493Z",
"currentDedicatedNodes": 0,
"currentLowPriorityNodes": 0,
"deploymentConfiguration": {
"virtualMachineConfiguration": {
"imageReference": {
"offer": "WindowsServer",
"publisher": "MicrosoftWindowsServer",
"sku": "2019-datacenter-smalldisk",
"version": "latest"
},
"nodeAgentSkuId": "batch.node.windows amd64",
"serviceArtifactReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"
},
"windowsConfiguration": {
"enableAutomaticUpdates": false
}
}
},
"interNodeCommunication": "Disabled",
"lastModified": "2023-05-11T07:44:44.8580493Z",
"provisioningState": "Succeeded",
"provisioningStateTransitionTime": "2023-05-11T07:44:44.8580493Z",
"resizeOperationStatus": {
"nodeDeallocationOption": "Requeue",
"resizeTimeout": "PT15M",
"startTime": "2023-05-11T07:44:44.8580493Z",
"targetDedicatedNodes": 2
},
"scaleSettings": {
"fixedScale": {
"resizeTimeout": "PT15M",
"targetDedicatedNodes": 2,
"targetLowPriorityNodes": 0
}
},
"taskSchedulingPolicy": {
"nodeFillType": "Spread"
},
"taskSlotsPerNode": 1,
"upgradePolicy": {
"automaticOSUpgradePolicy": {
"enableAutomaticOSUpgrade": true
},
"mode": "automatic"
},
"vmSize": "STANDARD_D4S_V3"
}
}
Definíciók
| Name |
Description |
|
AllocationState
|
A készlet átméretezése.
|
|
ApplicationPackageReference
|
Hivatkozás egy alkalmazáscsomagra a batch-fiókon belül
|
|
AutomaticOSUpgradePolicy
|
Az operációs rendszer automatikus frissítéséhez használt konfigurációs paraméterek.
|
|
AutoScaleRun
|
A készlet automatikus skálázási képletének végrehajtásából származó eredmények és hibák.
|
|
AutoScaleRunError
|
Hiba történt egy készlet automatikus skálázása során.
|
|
AutoScaleSettings
|
A készlet automatikus méretezési beállításai.
|
|
AutoUserScope
|
Az alapértelmezett érték a Készlet. Ha a készlet Windows rendszert futtat, a Tevékenység értéket kell megadni, ha szigorúbb elkülönítésre van szükség a tevékenységek között. Ha például a feladat olyan módon mutálja a beállításjegyzéket, amely hatással lehet más feladatokra.
|
|
AutoUserSpecification
|
Megadja annak az automatikus felhasználónak a paramétereit, aki egy feladatot futtat a Batch szolgáltatásban.
|
|
AzureBlobFileSystemConfiguration
|
Az Azure Storage-tárolóhoz Blobfuse használatával való csatlakozáshoz használt információk.
|
|
AzureFileShareConfiguration
|
Az Azure Fileshare-hoz való csatlakozáshoz használt információk.
|
|
BatchPoolIdentity
|
A Batch-készlet identitása, ha konfigurálva van. Ha a készlet identitása egy meglévő készlet frissítése során frissül, csak a készlet 0-ra zsugorítása után létrehozott új virtuális gépek rendelkeznek a frissített identitásokkal
|
|
CachingType
|
A lemezen engedélyezendő gyorsítótárazás típusa.
|
|
CIFSMountConfiguration
|
A CIFS-fájlrendszerhez való csatlakozáshoz használt információk.
|
|
CloudError
|
Hibaválasz a Batch szolgáltatástól.
|
|
CloudErrorBody
|
Hibaválasz a Batch szolgáltatástól.
|
|
ComputeNodeDeallocationOption
|
Meghatározza, hogy mi a teendő egy csomóponttal és annak futó feladatával, miután ki lett választva a felszabadításhoz.
|
|
ComputeNodeFillType
|
Hogyan kell elosztani a feladatokat a számítási csomópontok között.
|
|
ComputeNodeIdentityReference
|
A számítási csomópont által használt Batch-készlethez társított felhasználó által hozzárendelt identitásra mutató hivatkozás.
|
|
ContainerConfiguration
|
A tárolóbarát készletek konfigurációja.
|
|
ContainerHostBatchBindMountEntry
|
A feladattárolóba csatlakoztatni kívánt elérési út és csatlakoztatási mód bejegyzése.
|
|
ContainerHostDataPath
|
A tárolófeladat tárolójára csatlakoztatni kívánt elérési utak.
|
|
ContainerRegistry
|
Egy privát tárolóregisztrációs adatbázis.
|
|
ContainerType
|
A használandó tárolótechnológia.
|
|
ContainerWorkingDirectory
|
A tárolótevékenység munkakönyvtárának helyét jelző jelző. Az alapértelmezett érték a "taskWorkingDirectory".
|
|
createdByType
|
Az erőforrást létrehozó identitás típusa.
|
|
DataDisk
|
A készlet számítási csomópontjaihoz társított adatlemezek által használt beállítások. Csatolt adatlemezek használatakor a virtuális gépen belülről kell csatlakoztatnia és formáznia a lemezeket a használatukhoz.
|
|
DeploymentConfiguration
|
Az üzembe helyezés konfigurációs tulajdonságai.
|
|
DiffDiskPlacement
|
Az a hely, ahol az operációs rendszer lemezt kell helyezni.
|
|
DiffDiskSettings
|
Megadja a virtuális gép által használt operációsrendszer-lemez rövid élettartamú lemezbeállításait.
|
|
DiskCustomerManagedKey
|
Az ügyfél által felügyelt kulcs hivatkozása a lemez titkosításához.
|
|
DiskEncryptionConfiguration
|
A készlet számítási csomópontjaira alkalmazott lemeztitkosítási konfiguráció. A lemeztitkosítás konfigurálása nem támogatott a Virtuálisgép-rendszerképpel vagy az Azure Compute Gallery rendszerképével létrehozott Linux-készletben.
|
|
DiskEncryptionSetParameters
|
A lemeztitkosítási készlet ARM-erőforrás-azonosítója.
|
|
DiskEncryptionTarget
|
Ha nincs megadva, a készlet számítási csomópontjaiban lévő lemezek nem lesznek titkosítva.
|
|
DynamicVNetAssignmentScope
|
A dinamikus virtuális hálózatok hozzárendelésének hatóköre.
|
|
ElevationLevel
|
A felhasználó szintemelési szintje.
|
|
EnvironmentSetting
|
Egy tevékenységfolyamathoz beállítandó környezeti változó.
|
|
FixedScaleSettings
|
Kijavítottuk a készlet méretezési beállításait.
|
|
HostEndpointSettings
|
Megadja a gazdagép végpontjának adott beállításait.
|
|
HostEndpointSettingsModeTypes
|
Megadja a hozzáférés-vezérlési házirend végrehajtási módját.
|
|
ImageReference
|
Hivatkozás egy Azure Virtual Machines Marketplace-rendszerképre vagy egy egyéni virtuális gép Azure Image-erőforrására. Az Összes imageReferences Azure Batch által ellenőrzött listájának lekéréséhez tekintse meg a "Támogatott csomópontügynök termékváltozatainak listázása" műveletet.
|
|
InboundEndpointProtocol
|
A végpont protokollja.
|
|
InboundNatPool
|
Bejövő NAT-készlet, amely a Batch-készletben lévő számítási csomópontok adott portjainak külső kezelésére használható.
|
|
InterNodeCommunicationState
|
Ez korlátozza, hogy mely csomópontok rendelhetők hozzá a készlethez. Ennek az értéknek az engedélyezése csökkentheti a készletben lefoglalni kívánt csomópontok számát. Ha nincs megadva, ez az érték alapértelmezés szerint "Letiltva" lesz.
|
|
IPAddressProvisioningType
|
A Batch-készlet nyilvános IP-címeinek kiépítési típusa.
|
|
IPFamily
|
A készlet számára elérhető IP-verziók megadásához használt IP-családok.
|
|
IPTag
|
Meghatározza, hogy a tevékenységek hogyan legyenek elosztva a számítási csomópontok között.
|
|
JobDefaultOrder
|
A különböző feladatok azonos prioritású feladatok ütemezésének sorrendje.
|
|
LinuxUserConfiguration
|
A felhasználói fiók Linux-csomóponton való létrehozásához használt tulajdonságok.
|
|
LoginMode
|
Megadja a felhasználó bejelentkezési módját. Az alapértelmezett érték az Interaktív.
|
|
ManagedDisk
|
A felügyelt lemez paraméterei.
|
|
MetadataItem
|
Egy Batch-szolgáltatáserőforráshoz társított név-érték pár.
|
|
MountConfiguration
|
Az egyes csomópontokra csatlakoztatni kívánt fájlrendszer.
|
|
NetworkConfiguration
|
A készlet hálózati konfigurációja.
|
|
NetworkSecurityGroupRule
|
Egy bejövő végpontra alkalmazandó hálózati biztonsági csoportszabály.
|
|
NetworkSecurityGroupRuleAccess
|
A megadott IP-cím, alhálózati tartomány vagy címke esetében végrehajtandó művelet.
|
|
NFSMountConfiguration
|
NFS-fájlrendszerhez való csatlakozáshoz használt információk.
|
|
NodePlacementConfiguration
|
Node elhelyezés konfigurációja Batch poolokhoz.
|
|
NodePlacementPolicyType
|
Az alapértelmezett érték regionális.
|
|
OSDisk
|
A virtuális gép operációsrendszer-lemezének beállításai.
|
|
Pool
|
Készletre vonatkozó információkat tartalmaz.
|
|
PoolEndpointConfiguration
|
A készlet végpontkonfigurációja.
|
|
PoolIdentityType
|
A Batch-készlethez használt identitás típusa.
|
|
PoolProvisioningState
|
A készlet aktuális állapota.
|
|
ProxyAgentSettings
|
ProxyAgent-beállításokat ad meg a virtuális gép létrehozásakor.
|
|
PublicIPAddressConfiguration
|
A készlet hálózati konfigurációjának nyilvános IP-címkonfigurációja.
|
|
ResizeError
|
Hiba történt egy készlet átméretezésekor.
|
|
ResizeOperationStatus
|
Az aktuális vagy az utolsó befejezett átméretezési művelet részletei.
|
|
ResourceFile
|
Egy számítási csomópontra letöltendő egyetlen vagy több fájl.
|
|
RollingUpgradePolicy
|
A működés közbeni frissítés során használt konfigurációs paraméterek.
|
|
ScaleSettings
|
A készlet méretezési beállításai
|
|
SecurityEncryptionTypes
|
A felügyelt lemez EncryptionType tulajdonságát adja meg. A menedzselt lemez titkosításához DiskWithVMGuestState van beállítva, a VMGuestState blob-hoz a VMGuestState blokkhoz, VMGuestStateOnly a VMGuestState tömb titkosításához, NonPersistedTPM-hez pedig a VMGuestState blob firmware állapotának hiányosságához.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használata esetén kötelező.
|
|
SecurityProfile
|
Megadja a virtuális gép vagy a virtuálisgép-méretezési csoport biztonsági profilbeállításait.
|
|
SecurityTypes
|
A virtuális gép SecurityType tulajdonságát adja meg. Az UefiSettings engedélyezéséhez minden megadott értékre be kell állítani.
|
|
ServiceArtifactReference
|
Megadja azt a szolgáltatásösszetevő-referencia-azonosítót, amellyel a méretezési csoport összes virtuális gépe ugyanazt a rendszerképverziót állíthatja be a "legújabb" rendszerképverzió használatakor.
|
|
StartTask
|
Olyan feladat, amely akkor fut, amikor egy számítási csomópont csatlakozik egy készlethez az Azure Batch szolgáltatásban, vagy amikor a számítási csomópont újraindul vagy újraépül.
|
|
StorageAccountType
|
A tárfiók típusa adatlemezek vagy operációsrendszer-lemezek létrehozásához.
|
|
systemData
|
Az erőforrás létrehozásával és utolsó módosításával kapcsolatos metaadatok.
|
|
TaskContainerSettings
|
A feladat tárolóbeállításai.
|
|
TaskSchedulingPolicy
|
Meghatározza, hogy a tevékenységek hogyan legyenek elosztva a számítási csomópontok között.
|
|
UefiSettings
|
Megadja a virtuális gép létrehozásakor használt biztonsági beállításokat, például a biztonságos rendszerindítást és a vTPM-et.
|
|
UpgradeMode
|
Megadja a méretezési csoportban lévő virtuális gépekre való frissítés módját.
A lehetséges értékek a következők:
Manuális – A méretezési csoportban lévő virtuális gépek frissítéseinek alkalmazását szabályozhatja. Ezt a manualUpgrade művelet használatával teheti meg.
Automatikus – A méretezési csoportban lévő összes virtuális gép automatikusan frissül.
Gördülő – A méretezési csoport a frissítéseket kötegekben hajtja végre, köztük egy opcionális szünetidővel.
|
|
UpgradePolicy
|
Egy frissítési szabályzatot ír le – automatikus, manuális vagy működés közben.
|
|
UserAccount
|
A felhasználó Azure Batch-csomóponton való létrehozásához használt tulajdonságok.
|
|
UserAssignedIdentities
|
A társított felhasználói identitások listája.
|
|
UserIdentity
|
Annak a felhasználói identitásnak a definíciója, amely alatt a feladat fut.
|
|
VirtualMachineConfiguration
|
A számítási csomópontok konfigurációja egy készletben az Azure Virtual Machines-infrastruktúra alapján.
|
|
VMDiskSecurityProfile
|
Megadja a felügyelt lemez biztonsági profilbeállításait.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használatakor szükséges.
|
|
VMExtension
|
A virtuálisgép-bővítmények konfigurációja.
|
|
WindowsConfiguration
|
A windowsos operációs rendszer virtuális gépre vonatkozó beállításai.
|
|
WindowsUserConfiguration
|
A felhasználói fiók Windows-csomóponton való létrehozásához használt tulajdonságok.
|
AllocationState
Felsorolás
A készlet átméretezése.
| Érték |
Description |
|
Steady
|
A készlet nincs átméretezve. A készletben lévő csomópontok száma nem változik. A készlet ezt az állapotot adja meg a létrehozáskor, és amikor a készleten nem hajtanak végre műveleteket a csomópontok számának módosításához.
|
|
Resizing
|
A készlet átméretezve van; vagyis a számítási csomópontok a készlethez lesznek hozzáadva vagy eltávolítva.
|
|
Stopping
|
A készlet átméretezése megtörtént, de a felhasználó kérte az átméretezés leállítását, de a leállítási kérés még nem fejeződött be.
|
ApplicationPackageReference
Tárgy
Hivatkozás egy alkalmazáscsomagra a batch-fiókon belül
| Name |
Típus |
Description |
|
id
|
string
|
A telepíteni kívánt alkalmazáscsomag azonosítója. Ennek ugyanabban a Batch fiókban kell lennie, mint a pool. Ez lehet egy adott verzióra vagy az alapértelmezett verzióra való hivatkozás, ha létezik.
A telepíteni kívánt alkalmazáscsomag azonosítója. Ennek ugyanabban a kötegfiókban kell lennie, mint a készletnek. Ez lehet egy adott verzióra vagy az alapértelmezett verzióra való hivatkozás, ha létezik.
|
|
version
|
string
|
Az üzembe helyezendő alkalmazás verziója. Ha nincs megadva, az alapértelmezett verzió lesz üzembe helyezve.
Ha ez nincs megadva, és nincs megadva alapértelmezett verzió ehhez az alkalmazáshoz, a kérés az InvalidApplicationPackageReferences hibakóddal hiúsul meg. Ha közvetlenül a REST API-t hívja meg, a HTTP-állapotkód 409.
|
AutomaticOSUpgradePolicy
Tárgy
Az operációs rendszer automatikus frissítéséhez használt konfigurációs paraméterek.
| Name |
Típus |
Description |
|
disableAutomaticRollback
|
boolean
|
Le kell-e tiltani az operációs rendszer lemezkép-visszaállítási funkcióját.
|
|
enableAutomaticOSUpgrade
|
boolean
|
Azt jelzi, hogy az operációsrendszer-frissítéseket automatikusan alkalmazni kell-e a méretezési csoportok példányaira, amikor elérhetővé válik az operációsrendszer-rendszerkép egy újabb verziója.
Ha ez igaz értékre van állítva a Windows-alapú készletek esetében, WindowsConfiguration.enableAutomaticUpdates nem állítható be igaz értékre.
|
|
osRollingUpgradeDeferral
|
boolean
|
Ha feladatokat futtat, elhalasztja az operációsrendszer-frissítéseket a TVM-eken.
|
|
useRollingUpgradePolicy
|
boolean
|
Azt jelzi, hogy az automatikus operációsrendszer-frissítés során használni kell-e a működés közbeni frissítési szabályzatot. Az automatikus operációsrendszer-frissítés az alapértelmezett szabályzatra fog visszaállni, ha nincs meghatározva szabályzat a VMSS-en.
|
AutoScaleRun
Tárgy
A készlet automatikus skálázási képletének végrehajtásából származó eredmények és hibák.
| Name |
Típus |
Description |
|
error
|
AutoScaleRunError
|
A készlet automatikus skálázási képletének kiértékelése során észlelt hiba részletei, ha a kiértékelés sikertelen volt.
Hiba történt egy készlet automatikus skálázása során.
|
|
evaluationTime
|
string
(date-time)
|
Az automatikus skálázási képlet utolsó kiértékelésének időpontja.
Az automatikus skálázási képlet utolsó kiértékelésének időpontja.
|
|
results
|
string
|
Az automatikus skálázási képlet kiértékelése során használt összes változó végső értékei.
Az egyes változóértékek $variable=érték formában jelennek meg, a változókat pedig pontosvesszők választják el egymástól.
|
AutoScaleRunError
Tárgy
Hiba történt egy készlet automatikus skálázása során.
| Name |
Típus |
Description |
|
code
|
string
|
A hiba azonosítója. A kódok invariánsak, és programozott módon használhatók.
|
|
details
|
AutoScaleRunError[]
|
További részletek a hibáról.
További részletek a hibáról.
|
|
message
|
string
|
A hibát leíró üzenet, amely alkalmas a felhasználói felületen való megjelenítésre.
|
AutoScaleSettings
Tárgy
A készlet automatikus méretezési beállításai.
| Name |
Típus |
Description |
|
evaluationInterval
|
string
(duration)
|
Az az időintervallum, amellyel automatikusan módosíthatja a készlet méretét az automatikus skálázási képletnek megfelelően.
Ha nincs megadva, az alapértelmezett érték 15 perc (PT15M).
|
|
formula
|
string
|
A készletben lévő számítási csomópontok kívánt számának képlete.
A készletben lévő számítási csomópontok kívánt számának képlete.
|
AutoUserScope
Felsorolás
Az alapértelmezett érték a Készlet. Ha a készlet Windows rendszert futtat, a Tevékenység értéket kell megadni, ha szigorúbb elkülönítésre van szükség a tevékenységek között. Ha például a feladat olyan módon mutálja a beállításjegyzéket, amely hatással lehet más feladatokra.
| Érték |
Description |
|
Task
|
Megadja, hogy a szolgáltatásnak létre kell hoznia egy új felhasználót a feladathoz.
|
|
Pool
|
Megadja, hogy a feladat a készlet minden csomópontján létrehozott közös automatikus felhasználói fiókként fusson.
|
AutoUserSpecification
Tárgy
Megadja annak az automatikus felhasználónak a paramétereit, aki egy feladatot futtat a Batch szolgáltatásban.
| Name |
Típus |
Description |
|
elevationLevel
|
ElevationLevel
|
A felhasználó szintemelési szintje.
Az alapértelmezett érték nem Admin.
|
|
scope
|
AutoUserScope
|
Az automatikus felhasználó hatóköre
Az alapértelmezett érték a Készlet. Ha a készlet Windows rendszert futtat, a Tevékenység értéket kell megadni, ha szigorúbb elkülönítésre van szükség a tevékenységek között. Ha például a tevékenység úgy mutálja a beállításjegyzéket, hogy az hatással lehet más tevékenységekre, vagy olyan tanúsítványokat adott meg a készleten, amelyek nem lehetnek elérhetők a normál tevékenységek által, de a kezdési tevékenységeknek akadálymentesnek kell lenniük.
|
AzureBlobFileSystemConfiguration
Tárgy
Az Azure Storage-tárolóhoz Blobfuse használatával való csatlakozáshoz használt információk.
| Name |
Típus |
Description |
|
accountKey
|
string
(password)
|
Az Azure Storage-fiók kulcsa.
Ez a tulajdonság kölcsönösen kizárja mind a sasKey, mind az identitás; pontosan egyet kell megadni.
|
|
accountName
|
string
|
Az Azure Storage-fiók neve.
Az Azure Storage-fiók neve.
|
|
blobfuseOptions
|
string
|
További parancssori beállítások a csatlakoztatási parancsnak való továbbításhoz.
Ezek a Windowsban a "net use" és a "mount" (csatlakoztatási) lehetőségek a Linuxban.
|
|
containerName
|
string
|
Az Azure Blob Storage-tároló neve.
Az Azure Blob Storage-tároló neve.
|
|
identityReference
|
ComputeNodeIdentityReference
|
A containerName eléréséhez használandó felhasználó által hozzárendelt identitásra mutató hivatkozás
Ez a tulajdonság kölcsönösen kizárja az accountKey és a sasKey tulajdonságot; pontosan egyet kell megadni.
|
|
relativeMountPath
|
string
|
A relatív elérési út azon a számítási csomóponton, amelyen a fájlrendszer csatlakoztatva lesz
Minden fájlrendszer a Batch csatlakoztatási könyvtárához képest van csatlakoztatva, amely a AZ_BATCH_NODE_MOUNTS_DIR környezeti változón keresztül érhető el.
|
|
sasKey
|
string
(password)
|
Az Azure Storage SAS-jogkivonata.
Ez a tulajdonság kölcsönösen kizárható mind az accountKey, mind az identitás tekintetében; pontosan egyet kell megadni.
|
AzureFileShareConfiguration
Tárgy
Az Azure Fileshare-hoz való csatlakozáshoz használt információk.
| Name |
Típus |
Description |
|
accountKey
|
string
(password)
|
Az Azure Storage-fiókkulcs.
Az Azure Storage-fiókkulcs.
|
|
accountName
|
string
|
Az Azure Storage-fiók neve.
Az Azure Storage-fiók neve.
|
|
azureFileUrl
|
string
|
Az Azure Files URL-címe.
Ez "https://{account}.file.core.windows.net/" formátumú.
|
|
mountOptions
|
string
|
További parancssori beállítások a csatlakoztatási parancsnak való továbbításhoz.
Ezek a Windowsban a "net use" és a "mount" (csatlakoztatási) lehetőségek a Linuxban.
|
|
relativeMountPath
|
string
|
A relatív elérési út azon a számítási csomóponton, amelyen a fájlrendszer csatlakoztatva lesz
Minden fájlrendszer a Batch csatlakoztatási könyvtárához képest van csatlakoztatva, amely a AZ_BATCH_NODE_MOUNTS_DIR környezeti változón keresztül érhető el.
|
BatchPoolIdentity
Tárgy
A Batch-készlet identitása, ha konfigurálva van. Ha a készlet identitása egy meglévő készlet frissítése során frissül, csak a készlet 0-ra zsugorítása után létrehozott új virtuális gépek rendelkeznek a frissített identitásokkal
| Name |
Típus |
Description |
|
type
|
PoolIdentityType
|
A Batch-készlethez használt identitás típusa.
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentities>
|
A Batch-készlethez társított felhasználói identitások listája.
|
CachingType
Felsorolás
A lemezen engedélyezendő gyorsítótárazás típusa.
| Érték |
Description |
|
None
|
A lemez gyorsítótárazási módja nincs engedélyezve.
|
|
ReadOnly
|
A lemez gyorsítótárazási módja csak olvasható.
|
|
ReadWrite
|
A lemez gyorsítótárazási módja olvasás és írás.
|
CIFSMountConfiguration
Tárgy
A CIFS-fájlrendszerhez való csatlakozáshoz használt információk.
| Name |
Típus |
Description |
|
mountOptions
|
string
|
További parancssori beállítások a csatlakoztatási parancsnak való továbbításhoz.
Ezek a Windowsban a "net use" és a "mount" (csatlakoztatási) lehetőségek a Linuxban.
|
|
password
|
string
(password)
|
A CIFS fájlrendszeren való hitelesítéshez használandó jelszó.
A CIFS fájlrendszeren való hitelesítéshez használandó jelszó.
|
|
relativeMountPath
|
string
|
A relatív elérési út azon a számítási csomóponton, amelyen a fájlrendszer csatlakoztatva lesz
Minden fájlrendszer a Batch csatlakoztatási könyvtárához képest van csatlakoztatva, amely a AZ_BATCH_NODE_MOUNTS_DIR környezeti változón keresztül érhető el.
|
|
source
|
string
|
A csatlakoztatni kívánt fájlrendszer URI-ja.
A csatlakoztatni kívánt fájlrendszer URI-ja.
|
|
userName
|
string
|
A CIFS fájlrendszeren való hitelesítéshez használni kívánt felhasználó.
A CIFS fájlrendszeren való hitelesítéshez használni kívánt felhasználó.
|
CloudError
Tárgy
Hibaválasz a Batch szolgáltatástól.
CloudErrorBody
Tárgy
Hibaválasz a Batch szolgáltatástól.
| Name |
Típus |
Description |
|
code
|
string
|
A hiba azonosítója. A kódok invariánsak, és programozott módon használhatók.
|
|
details
|
CloudErrorBody[]
|
A hiba további részleteinek listája.
|
|
message
|
string
|
A hibát leíró üzenet, amely alkalmas a felhasználói felületen való megjelenítésre.
|
|
target
|
string
|
Az adott hiba célja. Például a tulajdonság neve hibás.
|
ComputeNodeDeallocationOption
Felsorolás
Meghatározza, hogy mi a teendő egy csomóponttal és annak futó feladatával, miután ki lett választva a felszabadításhoz.
| Érték |
Description |
|
Requeue
|
Állítsa le a futó tevékenységfolyamatokat, és állítsa le újra a feladatokat. A feladatok akkor futnak újra, ha egy csomópont elérhető. A tevékenységek leállása után távolítsa el a csomópontokat.
|
|
Terminate
|
A futó tevékenységek leállása. A feladatokat a failureInfo hiba jelzi, amely azt jelzi, hogy leálltak, és nem futnak újra. A tevékenységek leállása után távolítsa el a csomópontokat.
|
|
TaskCompletion
|
A jelenleg futó tevékenységek végrehajtásának engedélyezése. Ne ütemezzen új tevékenységeket várakozás közben. Távolítsa el a csomópontokat, ha az összes tevékenység befejeződött.
|
|
RetainedData
|
Hagyja, hogy az aktuálisan futó tevékenységek befejeződjenek, majd várja meg, amíg az összes tevékenységadat-adatmegőrzési időszak lejár. Ne ütemezzen új tevékenységeket várakozás közben. Távolítsa el a csomópontokat, ha az összes tevékenységmegőrzési időszak lejárt.
|
ComputeNodeFillType
Felsorolás
Hogyan kell elosztani a feladatokat a számítási csomópontok között.
| Érték |
Description |
|
Spread
|
A tevékenységeket egyenletesen kell hozzárendelni a készlet összes csomópontja számára.
|
|
Pack
|
A lehető legtöbb tevékenységet (taskSlotsPerNode) hozzá kell rendelni a készlet egyes csomópontjaihoz, mielőtt a tevékenységek a készlet következő csomóponthoz lesznek rendelve.
|
ComputeNodeIdentityReference
Tárgy
A számítási csomópont által használt Batch-készlethez társított felhasználó által hozzárendelt identitásra mutató hivatkozás.
| Name |
Típus |
Description |
|
resourceId
|
string
|
A felhasználó által hozzárendelt identitás ARM-erőforrás-azonosítója.
|
ContainerConfiguration
Tárgy
A tárolóbarát készletek konfigurációja.
| Name |
Típus |
Description |
|
containerImageNames
|
string[]
|
A tárolórendszerképek neveinek gyűjteménye.
Ez a teljes képhivatkozás, ahogyan a "docker pull" kifejezés is meg van adva. A rendszerképek az alapértelmezett Docker-beállításjegyzékből származnak, kivéve, ha a rendszerkép teljes mértékben egy alternatív beállításjegyzékkel van minősítve.
|
|
containerRegistries
|
ContainerRegistry[]
|
További magánregisztrációs adatbázisok, amelyekből tárolók húzhatók le.
Ha a rendszerképeket egy olyan privát beállításjegyzékből kell letölteni, amely hitelesítő adatokat igényel, akkor ezeket a hitelesítő adatokat itt kell megadni.
|
|
type
|
ContainerType
|
A használandó tárolótechnológia.
A használandó tárolótechnológia.
|
ContainerHostBatchBindMountEntry
Tárgy
A feladattárolóba csatlakoztatni kívánt elérési út és csatlakoztatási mód bejegyzése.
| Name |
Típus |
Description |
|
isReadOnly
|
boolean
|
Csatlakoztassa ezt a forrásútvonalat írásvédett módként vagy sem. Az alapértelmezett érték hamis (olvasási/írási mód).
Linux esetén, ha ezt az elérési utat írási/olvasási módként csatlakoztatja, az nem jelenti azt, hogy a tároló összes felhasználója rendelkezik olvasási/írási hozzáféréssel az elérési úthoz, az a gazdagép virtuális gépének hozzáférésétől függ. Ha ez az elérési út írásvédett, a tárolóban lévő összes felhasználó nem fogja tudni módosítani az elérési utat.
|
|
source
|
ContainerHostDataPath
|
A tárolófeladat tárolójára csatlakoztatni kívánt elérési utak.
A tárolófeladat tárolójára csatlakoztatni kívánt elérési utak.
|
ContainerHostDataPath
Felsorolás
A tárolófeladat tárolójára csatlakoztatni kívánt elérési utak.
| Érték |
Description |
|
Shared
|
A többpéldányos feladat elérési útja a fájlok megosztásához.
|
|
Startup
|
A tevékenység kezdési útvonala.
|
|
VfsMounts
|
Az elérési út az összes virtuális fájlrendszert tartalmazza ezen a csomóponton.
|
|
Task
|
A tevékenység elérési útja.
|
|
JobPrep
|
A feladat-előkészítési tevékenység elérési útja.
|
|
Applications
|
Az alkalmazások elérési útja.
|
ContainerRegistry
Tárgy
Egy privát tárolóregisztrációs adatbázis.
| Name |
Típus |
Description |
|
identityReference
|
ComputeNodeIdentityReference
|
A felhasználó által hozzárendelt identitásra mutató hivatkozás, a felhasználónév és a jelszó helyett az Azure Container Registry eléréséhez.
A számítási csomópont által használt Batch-készlethez társított felhasználó által hozzárendelt identitásra mutató hivatkozás.
|
|
password
|
string
(password)
|
A beállításjegyzék-kiszolgálóra való bejelentkezéshez szükséges jelszó.
A beállításjegyzék-kiszolgálóra való bejelentkezéshez szükséges jelszó.
|
|
registryServer
|
string
|
A beállításjegyzék URL-címe.
Ha nincs megadva, az alapértelmezett érték a "docker.io".
|
|
username
|
string
|
A beállításjegyzék-kiszolgálóra való bejelentkezéshez szükséges felhasználónév.
A beállításjegyzék-kiszolgálóra való bejelentkezéshez szükséges felhasználónév.
|
ContainerType
Felsorolás
A használandó tárolótechnológia.
| Érték |
Description |
|
DockerCompatible
|
A tárolók elindításához Docker-kompatibilis tárolótechnológiát használunk.
|
|
CriCompatible
|
A tárolók elindításához CRI-alapú technológiát használunk.
|
ContainerWorkingDirectory
Felsorolás
A tárolótevékenység munkakönyvtárának helyét jelző jelző. Az alapértelmezett érték a "taskWorkingDirectory".
| Érték |
Description |
|
TaskWorkingDirectory
|
Használja a Batch szolgáltatás tevékenységének szokásos munkakönyvtárát, amely tartalmazza a Batch által kitöltött feladat-erőforrásfájlokat.
|
|
ContainerImageDefault
|
Tárolórendszerkép által definiált munkakönyvtár használata. Ne feledje, hogy ez a könyvtár nem tartalmazza a Batch által letöltött erőforrásfájlokat.
|
createdByType
Felsorolás
Az erőforrást létrehozó identitás típusa.
| Érték |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DataDisk
Tárgy
A készlet számítási csomópontjaihoz társított adatlemezek által használt beállítások. Csatolt adatlemezek használatakor a virtuális gépen belülről kell csatlakoztatnia és formáznia a lemezeket a használatukhoz.
| Name |
Típus |
Description |
|
caching
|
CachingType
|
A lemezen engedélyezendő gyorsítótárazás típusa.
Az értékek a következők:
none – A lemez gyorsítótárazási módja nincs engedélyezve.
readOnly – A lemez gyorsítótárazási módja csak olvasható.
readWrite – A lemez gyorsítótárazási módja olvasás és írás.
A gyorsítótárazás alapértelmezett értéke nincs. A gyorsítótárazási lehetőségekről a következő témakörben talál további információt: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/.
|
|
diskSizeGB
|
integer
(int32)
|
A kezdeti lemezméret GB-ban az új adatlemez létrehozásakor.
A kezdeti lemezméret GB-ban az új adatlemez létrehozásakor.
|
|
lun
|
integer
(int32)
|
A logikai egység száma.
A lun az egyes adatlemezek egyedi azonosítására szolgál. Ha több lemezt csatol, mindegyiknek külön lun-nak kell lennie. Az értéknek 0 és 63 közöttinek kell lennie, beleértve az értéket is.
|
|
managedDisk
|
ManagedDisk
|
A felügyelt lemez paraméterei.
A felügyelt lemez paraméterei.
|
DeploymentConfiguration
Tárgy
Az üzembe helyezés konfigurációs tulajdonságai.
| Name |
Típus |
Description |
|
virtualMachineConfiguration
|
VirtualMachineConfiguration
|
A készlet virtuálisgép-konfigurációja.
A számítási csomópontok konfigurációja egy készletben az Azure Virtual Machines-infrastruktúra alapján.
|
DiffDiskPlacement
Felsorolás
Az a hely, ahol az operációs rendszer lemezt kell helyezni.
| Érték |
Description |
|
CacheDisk
|
Az operációs rendszer lemezét a VM gyorsítótár lemezére helyezik.
|
DiffDiskSettings
Tárgy
Megadja a virtuális gép által használt operációsrendszer-lemez rövid élettartamú lemezbeállításait.
DiskCustomerManagedKey
Tárgy
Az ügyfél által felügyelt kulcs hivatkozása a lemez titkosításához.
| Name |
Típus |
Description |
|
identityReference
|
ComputeNodeIdentityReference
|
A lemez titkosításához szükséges készletidentitások egyikének hivatkozása. Ez az identitás lesz a KeyVault eléréséhez használva.
|
|
keyUrl
|
string
(uri)
|
Teljes verziójú kulcs URL-címe, amely a KeyVault egyik kulcsára mutat. Az URL-cím verziószegmensére a rotációtól függetlenül szükség vanToLatestKeyVersionEnabled értékre.
|
|
rotationToLatestKeyVersionEnabled
|
boolean
|
Állítsa ezt a jelzőt true (igaz) értékre, hogy engedélyezze a lemeztitkosítás automatikus frissítését a legújabb kulcsverzióra. Az alapértelmezett érték false.
|
DiskEncryptionConfiguration
Tárgy
A készlet számítási csomópontjaira alkalmazott lemeztitkosítási konfiguráció. A lemeztitkosítás konfigurálása nem támogatott a Virtuálisgép-rendszerképpel vagy az Azure Compute Gallery rendszerképével létrehozott Linux-készletben.
| Name |
Típus |
Description |
|
customerManagedKey
|
DiskCustomerManagedKey
|
Az ügyfél által felügyelt kulcs hivatkozása az operációsrendszer-lemez titkosításához.
Az ügyfél által felügyelt kulcs a EncryptionAtRest titkosítja az operációsrendszer-lemezt, és alapértelmezés szerint az adatlemezt is titkosítjuk. Csak akkor használható, ha a készlet identitással van konfigurálva, és az OsDisk a DiskEncryption egyik célhelyeként van beállítva.
|
|
targets
|
DiskEncryptionTarget[]
|
A Batch szolgáltatás titkosítja a lemezcélok listáját a számítási csomóponton
Linux-készleten csak a "TemporaryDisk" támogatott; A Windows-készletben meg kell adni az "OsDisk" és az "TemporaryDisk" értéket.
|
DiskEncryptionSetParameters
Tárgy
A lemeztitkosítási készlet ARM-erőforrás-azonosítója.
| Name |
Típus |
Description |
|
id
|
string
(arm-id)
|
A lemeztitkosítási halmaz erőforrásazonosítója.
A lemeztitkosítási készlet ARM-erőforrás-azonosítója. Az erőforrásnak ugyanabban az előfizetésben kell lennie, mint a Batch fióknak.
|
DiskEncryptionTarget
Felsorolás
Ha nincs megadva, a készlet számítási csomópontjaiban lévő lemezek nem lesznek titkosítva.
| Érték |
Description |
|
OsDisk
|
A számítási csomópont operációsrendszer-lemeze titkosítva van.
|
|
TemporaryDisk
|
A számítási csomópont ideiglenes lemeze titkosítva van. Linux rendszeren ez a titkosítás más partíciókra (például csatlakoztatott adatlemezekre) vonatkozik, amikor a titkosítás a rendszerindításkor történik.
|
DynamicVNetAssignmentScope
Felsorolás
A dinamikus virtuális hálózatok hozzárendelésének hatóköre.
| Érték |
Description |
|
none
|
Nincs engedélyezve dinamikus virtuális hálózat-hozzárendelés.
|
|
job
|
A dinamikus virtuális hálózatok hozzárendelése feladatonként történik. Ha ez az érték be van állítva, a hálózati konfiguráció alhálózat-azonosítóját is be kell állítani. Ez a funkció használat előtt jóváhagyást igényel, forduljon az ügyfélszolgálathoz
|
ElevationLevel
Felsorolás
A felhasználó szintemelési szintje.
| Érték |
Description |
|
NonAdmin
|
A felhasználó egy általános jogú felhasználó, aki nem rendelkezik emelt szintű hozzáféréssel.
|
|
Admin
|
A felhasználó emelt szintű hozzáféréssel rendelkező felhasználó, és teljes rendszergazdai engedélyekkel rendelkezik.
|
EnvironmentSetting
Tárgy
Egy tevékenységfolyamathoz beállítandó környezeti változó.
| Name |
Típus |
Description |
|
name
|
string
|
A környezeti változó neve.
A környezeti változó neve.
|
|
value
|
string
|
A környezeti változó értéke.
A környezeti változó értéke.
|
FixedScaleSettings
Tárgy
Kijavítottuk a készlet méretezési beállításait.
| Name |
Típus |
Alapértelmezett érték |
Description |
|
nodeDeallocationOption
|
ComputeNodeDeallocationOption
|
|
Meghatározza, hogy mi a teendő egy csomóponttal és annak futó feladatával, miután ki lett választva a felszabadításhoz.
Ha nincs megadva, az alapértelmezett érték a Requeue lesz.
|
|
resizeTimeout
|
string
(duration)
|
PT15M
|
A számítási csomópontok készlethez való lefoglalásának időtúllépése.
Az alapértelmezett érték 15 perc. Az időtúllépési értékek ISO 8601 formátumot használnak. Használja például a PT10M-et 10 percig. A minimális érték 5 perc. Ha 5 percnél rövidebb értéket ad meg, a Batch szolgáltatás hibaüzenettel utasítja el a kérést; ha közvetlenül a REST API-t hívja meg, a HTTP-állapotkód 400 (hibás kérés).
|
|
targetDedicatedNodes
|
integer
(int32)
|
|
A készletben lévő dedikált számítási csomópontok kívánt száma.
A targetDedicatedNodes legalább egyikét be kell állítania a targetLowPriorityNodes értékre.
|
|
targetLowPriorityNodes
|
integer
(int32)
|
|
A készletben található kihasználatlan/alacsony prioritású számítási csomópontok kívánt száma.
A targetDedicatedNodes legalább egyikét be kell állítania a targetLowPriorityNodes értékre.
|
HostEndpointSettings
Tárgy
Megadja a gazdagép végpontjának adott beállításait.
| Name |
Típus |
Description |
|
inVMAccessControlProfileReferenceId
|
string
(arm-id)
|
Az InVMAccessControlProfileVersion erőforrás-azonosítóra mutató hivatkozást adja meg a következő formátumban: /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version}.
|
|
mode
|
HostEndpointSettingsModeTypes
|
Megadja a hozzáférés-vezérlési házirend végrehajtási módját.
|
HostEndpointSettingsModeTypes
Felsorolás
Megadja a hozzáférés-vezérlési házirend végrehajtási módját.
| Érték |
Description |
|
Audit
|
Naplózási módban a rendszer úgy működik, mintha a hozzáférés-vezérlési szabályzatot kényszeríti volna ki, beleértve a hozzáférés-megtagadási bejegyzések naplózását a naplókban, de valójában nem tagadja meg a gazdagépvégpontokra irányuló kéréseket.
|
|
Enforce
|
Az enforce mód a javasolt működési mód, és a rendszer érvényesíti a hozzáférési ellenőrzési szabályzatot. Ez a tulajdonság nem használható együtt az 'inVMAccessControlProfileReferenceId' funkcióval.
|
ImageReference
Tárgy
Hivatkozás egy Azure Virtual Machines Marketplace-rendszerképre vagy egy egyéni virtuális gép Azure Image-erőforrására. Az Összes imageReferences Azure Batch által ellenőrzött listájának lekéréséhez tekintse meg a "Támogatott csomópontügynök termékváltozatainak listázása" műveletet.
| Name |
Típus |
Description |
|
communityGalleryImageId
|
string
|
A közösségi galéria képének egyedi azonosítója
Ez a tulajdonság kölcsönösen kizárja a többi tulajdonságot, és lekérhető a közösségi katalógus képének GET hívásából.
|
|
id
|
string
|
Az Azure Compute Gallery rendszerképének ARM-erőforrás-azonosítója. A készlet számítási csomópontjai ezzel a képazonosítóval jönnek létre. Ez az űrlap /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/gallerys/{galleryName}/images/{imageDefinitionName}/versions/{versionId}.
Ez a tulajdonság kölcsönösen kizárja a többi tulajdonságot. Az Azure Compute Gallery rendszerképének replikáinak ugyanabban a régióban kell lenniük, mint az Azure Batch-fiók. A Batch-csomópont ügynökének a Batch szolgáltatással való kommunikációhoz szükséges tűzfalbeállításairól további információt a https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configurationcímű témakörben talál.
|
|
offer
|
string
|
Az Azure Virtual Machines Marketplace-rendszerkép ajánlattípusa.
Például: UbuntuServer vagy WindowsServer.
|
|
publisher
|
string
|
Az Azure Virtual Machines Marketplace-rendszerkép közzétevője.
Például a Canonical vagy a MicrosoftWindowsServer.
|
|
sharedGalleryImageId
|
string
|
A megosztott katalógus képének egyedi azonosítója
Ez a tulajdonság kölcsönösen kizárja a többi tulajdonságot, és lekérhető a megosztott katalógus képének GET hívásából.
|
|
sku
|
string
|
Az Azure Virtual Machines Marketplace-rendszerkép termékváltozata.
Például: 18.04-LTS vagy 2022-datacenter.
|
|
version
|
string
|
Az Azure Virtual Machines Marketplace rendszerképének verziója.
A rendszerkép legújabb verziójának kiválasztásához megadható a "legújabb" érték. Ha nincs megadva, az alapértelmezett érték a "legújabb".
|
InboundEndpointProtocol
Felsorolás
A végpont protokollja.
| Érték |
Description |
|
TCP
|
Használja a TCP-t a végponthoz.
|
|
UDP
|
Használja az UDP-t a végponthoz.
|
InboundNatPool
Tárgy
Bejövő NAT-készlet, amely a Batch-készletben lévő számítási csomópontok adott portjainak külső kezelésére használható.
| Name |
Típus |
Description |
|
backendPort
|
integer
(int32)
|
A számítási csomópont portszáma.
Ennek egyedinek kell lennie egy Batch-készleten belül. Az elfogadható értékek 1 és 65535 között vannak, kivéve a 29876-ot és a 29877-et, mivel ezek fenntartottak. Ha a rendszer fenntartott értékeket ad meg, a kérés a 400-ás HTTP-állapotkóddal meghiúsul.
|
|
frontendPortRangeEnd
|
integer
(int32)
|
A külső portok tartományának utolsó portszáma, amely az egyes számítási csomópontokon a háttérport bejövő hozzáférésének biztosítására szolgál.
Az elfogadható értékek 1 és 65534 között mozognak, kivéve a Batch szolgáltatás által fenntartott 50000 és 55000 közötti portokat. A készleten belüli összes tartománynak eltérőnek kell lennie, és nem lehet átfedésben. Ha a rendszer fenntartott vagy átfedésben lévő értékeket ad meg, a kérés a 400-ás HTTP-állapotkóddal meghiúsul.
|
|
frontendPortRangeStart
|
integer
(int32)
|
A külső portok tartományának első portszáma, amely az egyes számítási csomópontokon a háttérport bejövő hozzáférésének biztosítására szolgál.
Az elfogadható értékek 1 és 65534 között mozognak, kivéve az 50000 és 55000 közötti, fenntartott portokat. A készleten belüli összes tartománynak eltérőnek kell lennie, és nem lehet átfedésben. Ha a rendszer fenntartott vagy átfedésben lévő értékeket ad meg, a kérés a 400-ás HTTP-állapotkóddal meghiúsul.
|
|
name
|
string
|
A végpont neve.
A névnek egyedinek kell lennie egy Batch-készletben, tartalmazhat betűket, számokat, aláhúzásjeleket, pontokat és kötőjeleket. A neveknek betűvel vagy számmal kell kezdődniük, betűvel, számmal vagy aláhúzásjellel kell végződniük, és nem haladhatja meg a 77 karaktert. Ha érvénytelen értékeket ad meg, a kérés a 400-ás HTTP-állapotkóddal meghiúsul.
|
|
networkSecurityGroupRules
|
NetworkSecurityGroupRule[]
|
A végpontra alkalmazott hálózati biztonsági csoportszabályok listája.
A Batch-készlet összes végpontján megadható szabályok maximális száma 25. Ha nincs megadva hálózati biztonsági csoportra vonatkozó szabály, a rendszer létrehoz egy alapértelmezett szabályt, amely engedélyezi a bejövő hozzáférést a megadott háttérporthoz. Ha túllépi a hálózati biztonsági csoport szabályainak maximális számát, a kérés a 400-es HTTP-állapotkóddal meghiúsul.
|
|
protocol
|
InboundEndpointProtocol
|
A végpont protokollja.
A végpont protokollja.
|
InterNodeCommunicationState
Felsorolás
Ez korlátozza, hogy mely csomópontok rendelhetők hozzá a készlethez. Ennek az értéknek az engedélyezése csökkentheti a készletben lefoglalni kívánt csomópontok számát. Ha nincs megadva, ez az érték alapértelmezés szerint "Letiltva" lesz.
| Érték |
Description |
|
Enabled
|
Engedélyezze a virtuális gépek közötti hálózati kommunikációt.
|
|
Disabled
|
Tiltsa le a virtuális gépek közötti hálózati kommunikációt.
|
IPAddressProvisioningType
Felsorolás
A Batch-készlet nyilvános IP-címeinek kiépítési típusa.
| Érték |
Description |
|
BatchManaged
|
A Batch létrehoz és felügyel egy nyilvános IP-címet. A készlet méretétől függően több nyilvános IP-cím is lehet.
|
|
UserManaged
|
A nyilvános IP-címeket a felhasználó biztosítja, és a számítási csomópontok kiépítésére lesznek használva.
|
|
NoPublicIPAddresses
|
A készlet számítási csomópontjaihoz nem jön létre nyilvános IP-cím.
|
IPFamily
Felsorolás
A készlet számára elérhető IP-verziók megadásához használt IP-családok.
| Érték |
Description |
|
IPv4
|
IPv4 elérhető a poolban.
|
|
IPv6
|
IPv6 elérhető a poolban.
|
IPTag
Tárgy
Meghatározza, hogy a tevékenységek hogyan legyenek elosztva a számítási csomópontok között.
| Name |
Típus |
Description |
|
ipTagType
|
string
|
Az IP-címke típusa.
Példa: FirstPartyUsage.
|
|
tag
|
string
|
A nyilvános IP-címhez társított IP-címke értéke.
Példa: SQL.
|
JobDefaultOrder
Felsorolás
A különböző feladatok azonos prioritású feladatok ütemezésének sorrendje.
| Érték |
Description |
|
None
|
A feladatokat egyenletesen kell ütemezni az összes egyenrangú feladatból a poolban.
|
|
CreationTime
|
Ha a munkahelyek egyenlő prioritásúak, akkor a korábban létrehozott feladatokat először kell időzíteni.
|
LinuxUserConfiguration
Tárgy
A felhasználói fiók Linux-csomóponton való létrehozásához használt tulajdonságok.
| Name |
Típus |
Description |
|
gid
|
integer
(int32)
|
A felhasználói fiók csoportazonosítója.
Az uid és a gid tulajdonságokat együtt kell megadni, vagy egyáltalán nem. Ha nincs megadva, a mögöttes operációs rendszer kiválasztja a gidet.
|
|
sshPrivateKey
|
string
(password)
|
A felhasználói fiók SSH titkos kulcsa.
A titkos kulcs nem lehet jelszóval védett. A titkos kulcs használatával automatikusan konfigurálható az aszimmetrikus kulcsalapú hitelesítés a Linux-készlet csomópontjai között, ha a készlet enableInterNodeCommunication tulajdonsága igaz (a rendszer figyelmen kívül hagyja, ha az enableInterNodeCommunication értéke hamis). Ezt úgy teszi, hogy a kulcspárt a felhasználó .ssh könyvtárába helyezi. Ha nincs megadva, a jelszó nélküli SSH nincs konfigurálva a csomópontok között (a felhasználó .ssh könyvtárának módosítása nem történik meg).
|
|
uid
|
integer
(int32)
|
A felhasználói fiók felhasználói azonosítója.
Az uid és a gid tulajdonságokat együtt kell megadni, vagy egyáltalán nem. Ha nincs megadva, a mögöttes operációs rendszer választja ki a uid azonosítót.
|
LoginMode
Felsorolás
Megadja a felhasználó bejelentkezési módját. Az alapértelmezett érték az Interaktív.
| Érték |
Description |
|
Batch
|
A LOGON32_LOGON_BATCH Win32 bejelentkezési mód. A kötegelt bejelentkezési mód hosszú ideig futó párhuzamos folyamatokhoz ajánlott.
|
|
Interactive
|
A LOGON32_LOGON_INTERACTIVE Win32 bejelentkezési mód. Egyes alkalmazásokhoz az interaktív bejelentkezési módhoz kapcsolódó engedélyek szükségesek. Ha a feladatban használt alkalmazás esetében ez a helyzet, akkor ez a beállítás ajánlott.
|
ManagedDisk
Tárgy
A felügyelt lemez paraméterei.
| Name |
Típus |
Description |
|
diskEncryptionSet
|
DiskEncryptionSetParameters
|
Megadja a felügyelt lemez ügyfél által felügyelt lemeztitkosítási készletének erőforrás-azonosítóját. Csak UserSubscription módban állítható be.
|
|
securityProfile
|
VMDiskSecurityProfile
|
Megadja a felügyelt lemez biztonsági profilját.
Megadja a felügyelt lemez biztonsági profilbeállításait.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használatakor szükséges.
|
|
storageAccountType
|
StorageAccountType
|
A tárfiók típusa adatlemezek vagy operációsrendszer-lemezek létrehozásához.
A tárfiók típusa adatlemezek vagy operációsrendszer-lemezek létrehozásához.
|
Tárgy
Egy Batch-szolgáltatáserőforráshoz társított név-érték pár.
| Name |
Típus |
Description |
|
name
|
string
|
A metaadatelem neve.
A metaadatelem neve.
|
|
value
|
string
|
A metaadatelem értéke.
A metaadatelem értéke.
|
MountConfiguration
Tárgy
Az egyes csomópontokra csatlakoztatni kívánt fájlrendszer.
| Name |
Típus |
Description |
|
azureBlobFileSystemConfiguration
|
AzureBlobFileSystemConfiguration
|
Az Egyes csomópontokon blob FUSE használatával csatlakoztatandó Azure Storage-tároló.
Ez a tulajdonság kölcsönösen kizárja az összes többi tulajdonságot.
|
|
azureFileShareConfiguration
|
AzureFileShareConfiguration
|
Az egyes csomópontokra csatlakoztatni kívánt Azure-fájlmegosztás.
Ez a tulajdonság kölcsönösen kizárja az összes többi tulajdonságot.
|
|
cifsMountConfiguration
|
CIFSMountConfiguration
|
Az egyes csomópontokra csatlakoztatni kívánt CIFS/SMB fájlrendszer.
Ez a tulajdonság kölcsönösen kizárja az összes többi tulajdonságot.
|
|
nfsMountConfiguration
|
NFSMountConfiguration
|
Az egyes csomópontokra csatlakoztatni kívánt NFS-fájlrendszer.
Ez a tulajdonság kölcsönösen kizárja az összes többi tulajdonságot.
|
NetworkConfiguration
Tárgy
A készlet hálózati konfigurációja.
| Name |
Típus |
Alapértelmezett érték |
Description |
|
dynamicVnetAssignmentScope
|
DynamicVNetAssignmentScope
|
none
|
A dinamikus virtuális hálózatok hozzárendelésének hatóköre.
A dinamikus virtuális hálózatok hozzárendelésének hatóköre.
|
|
enableAcceleratedNetworking
|
boolean
|
|
A készletnek engedélyeznie kell-e a gyorsított hálózatkezelést.
A gyorsított hálózatkezelés lehetővé teszi a virtuális gépek egyetlen gyökérszintű I/O-virtualizálását (SR-IOV), ami jobb hálózati teljesítményt eredményezhet. További részletekért lásd: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview.
|
|
endpointConfiguration
|
PoolEndpointConfiguration
|
|
A Batch-készlet számítási csomópontjaihoz tartozó végpontok konfigurációja.
A készlet végpontkonfigurációja.
|
|
publicIPAddressConfiguration
|
PublicIPAddressConfiguration
|
|
A Batch-készlet számítási csomópontjaihoz tartozó nyilvános IPAddress-konfiguráció.
A készlet hálózati konfigurációjának nyilvános IP-címkonfigurációja.
|
|
subnetId
|
string
|
|
Annak a virtuális hálózati alhálózatnak az ARM-erőforrás-azonosítója, amelyhez a készlet számítási csomópontjai csatlakoznak. Ez az űrlap /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/alhálózatok/{alhálózat}.
A virtuális hálózatnak ugyanabban a régióban és előfizetésben kell lennie, mint az Azure Batch-fiók. A megadott alhálózatnak elegendő ingyenes IP-címmel kell rendelkeznie a készlet csomópontjainak számához. Ha az alhálózat nem rendelkezik elegendő ingyenes IP-címmel, a készlet részben lefoglalja a számítási csomópontokat, és átméretezéskor hiba lép fel. A "MicrosoftAzureBatch" szolgáltatásnévnek rendelkeznie kell a megadott virtuális hálózat "klasszikus virtuálisgép-közreműködő" Role-Based hozzáférés-vezérlési (RBAC) szerepkörével. A megadott alhálózatnak lehetővé kell tennie, hogy az Azure Batch szolgáltatásból érkező kommunikáció képes legyen feladatokat ütemezni a számítási csomópontokon. Ezt úgy ellenőrizheti, hogy a megadott virtuális hálózat rendelkezik-e társított hálózati biztonsági csoportokkal (NSG). Ha a megadott alhálózat számítási csomópontjaival való kommunikációt egy NSG megtagadja, akkor a Batch szolgáltatás használhatatlanná állítja a számítási csomópontok állapotát. Ha a megadott virtuális hálózat rendelkezik hálózati biztonsági csoportokkal (NSG), akkor néhány fenntartott rendszerportot engedélyezni kell a bejövő kommunikációhoz, beleértve a 29876-os és a 29877-as portokat is. Engedélyezze a kimenő kapcsolatokat az Azure Storage-hoz a 443-as porton. További részletekért lásd: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration
|
NetworkSecurityGroupRule
Tárgy
Egy bejövő végpontra alkalmazandó hálózati biztonsági csoportszabály.
| Name |
Típus |
Description |
|
access
|
NetworkSecurityGroupRuleAccess
|
A megadott IP-cím, alhálózati tartomány vagy címke esetében végrehajtandó művelet.
A megadott IP-cím, alhálózati tartomány vagy címke esetében végrehajtandó művelet.
|
|
priority
|
integer
(int32)
|
A szabály prioritása.
A készleten belüli prioritásoknak egyedinek kell lenniük, és prioritás szerinti sorrendben kell értékelni. Minél alacsonyabb a szám, annál magasabb a prioritás. A szabályokat például 150, 250 és 350 sorszámmal lehet megadni. A 150-es sorszámú szabály elsőbbséget élvez a 250-es sorrendű szabállyal szemben. Az engedélyezett prioritások 150 és 4096 között vannak. Ha a rendszer fenntartott vagy duplikált értékeket ad meg, a kérés a 400-ás HTTP-állapotkóddal meghiúsul.
|
|
sourceAddressPrefix
|
string
|
A szabálynak megfelelő forráscímelőtag vagy címke.
Az érvényes értékek egyetlen IP-cím (azaz 10.10.10.10.10), IP-alhálózat (azaz 192.168.1.0/24), alapértelmezett címke vagy * (minden cím esetén). Ha bármilyen más érték is meg van adva, a kérés a 400-ás HTTP-állapotkóddal meghiúsul.
|
|
sourcePortRanges
|
string[]
|
A szabálynak megfelelő forrásporttartományok.
Az érvényes értékek a "*" (minden 0- 65535-ös port esetén) vagy portok vagy porttartományok tömbjei (pl. 100-200). A portoknak 0 és 65535 közötti tartományban kell lennie, és a porttartományok vagy portok nem fedhetik egymást. Ha bármilyen más érték is meg van adva, a kérés a 400-ás HTTP-állapotkóddal meghiúsul. Az alapértelmezett érték a *.
|
NetworkSecurityGroupRuleAccess
Felsorolás
A megadott IP-cím, alhálózati tartomány vagy címke esetében végrehajtandó művelet.
| Érték |
Description |
|
Allow
|
Hozzáférés engedélyezése.
|
|
Deny
|
Hozzáférés megtagadása.
|
NFSMountConfiguration
Tárgy
NFS-fájlrendszerhez való csatlakozáshoz használt információk.
| Name |
Típus |
Description |
|
mountOptions
|
string
|
További parancssori beállítások a csatlakoztatási parancsnak való továbbításhoz.
Ezek a Windowsban a "net use" és a "mount" (csatlakoztatási) lehetőségek a Linuxban.
|
|
relativeMountPath
|
string
|
A relatív elérési út azon a számítási csomóponton, amelyen a fájlrendszer csatlakoztatva lesz
Minden fájlrendszer a Batch csatlakoztatási könyvtárához képest van csatlakoztatva, amely a AZ_BATCH_NODE_MOUNTS_DIR környezeti változón keresztül érhető el.
|
|
source
|
string
|
A csatlakoztatni kívánt fájlrendszer URI-ja.
A csatlakoztatni kívánt fájlrendszer URI-ja.
|
NodePlacementConfiguration
Tárgy
Node elhelyezés konfigurációja Batch poolokhoz.
| Name |
Típus |
Description |
|
policy
|
NodePlacementPolicyType
|
Node placement Policy típus a Batch pool-on.
A Batch Service által a csomópontok kiépítéséhez használt foglalási szabályzat. Ha nincs megadva, a Batch a regionális szabályzatot fogja használni.
|
NodePlacementPolicyType
Felsorolás
Az alapértelmezett érték regionális.
| Érték |
Description |
|
Regional
|
A készlet összes csomópontja ugyanabban a régióban lesz lefoglalva.
|
|
Zonal
|
A készlet csomópontjai a lehető legjobb munkamennyiség-kiegyensúlyozás mellett el lesznek osztva a különböző zónák között.
|
OSDisk
Tárgy
A virtuális gép operációsrendszer-lemezének beállításai.
| Name |
Típus |
Description |
|
caching
|
CachingType
|
A lemezen engedélyezendő gyorsítótárazás típusa.
A lemezen engedélyezendő gyorsítótárazás típusa.
|
|
diskSizeGB
|
integer
(int32)
|
A kezdeti lemezméret GB-ban az új operációsrendszer-lemez létrehozásakor.
A kezdeti lemezméret GB-ban az új operációsrendszer-lemez létrehozásakor.
|
|
ephemeralOSDiskSettings
|
DiffDiskSettings
|
Megadja a virtuális gép által használt operációsrendszer-lemez rövid élettartamú lemezbeállításait.
Megadja a virtuális gép által használt operációsrendszer-lemez rövid élettartamú lemezbeállításait.
|
|
managedDisk
|
ManagedDisk
|
A felügyelt lemez paraméterei.
A felügyelt lemez paraméterei.
|
|
writeAcceleratorEnabled
|
boolean
|
Megadja, hogy a writeAccelerator engedélyezve legyen vagy le legyen tiltva a lemezen.
Megadja, hogy a writeAccelerator engedélyezve legyen vagy le legyen tiltva a lemezen.
|
Pool
Tárgy
Készletre vonatkozó információkat tartalmaz.
| Name |
Típus |
Alapértelmezett érték |
Description |
|
etag
|
string
|
|
Az erőforrás ETagje, amely az egyidejűségi utasításokhoz használatos.
|
|
id
|
string
(arm-id)
|
|
Az erőforrás teljes erőforrás-azonosítója. Például: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
BatchPoolIdentity
|
|
A Batch-készlethez használt identitás típusa.
|
|
name
|
string
|
|
Az erőforrás neve
|
|
properties.allocationState
|
AllocationState
|
|
A készlet átméretezése.
A készlet átméretezése.
|
|
properties.allocationStateTransitionTime
|
string
(date-time)
|
|
A készlet aktuális foglalási állapotának megadásának időpontja.
A készlet aktuális foglalási állapotának megadásának időpontja.
|
|
properties.applicationPackages
|
ApplicationPackageReference[]
|
|
A készlet minden számítási csomópontján telepíteni kívánt alkalmazáscsomagok listája.
Az alkalmazáscsomag-hivatkozások módosítása hatással van a készlethez csatlakozó összes új számítási csomópontra, de nem érinti a készletben lévő számítási csomópontokat, amíg újra nem indítja vagy újra nem alakítja őket. Egy adott készleten legfeljebb 10 alkalmazáscsomag-hivatkozás található.
|
|
properties.autoScaleRun
|
AutoScaleRun
|
|
Az automatikus skálázási képlet legutóbbi végrehajtásának eredményei és hibái.
Ez a tulajdonság csak akkor van beállítva, ha a készlet automatikusan skálázódik, azaz automatikusScaleSettingst használ.
|
|
properties.creationTime
|
string
(date-time)
|
|
A készlet létrehozási ideje.
A készlet létrehozási ideje.
|
|
properties.currentDedicatedNodes
|
integer
(int32)
|
|
A készletben jelenleg található dedikált számítási csomópontok száma.
A készletben jelenleg található dedikált számítási csomópontok száma.
|
|
properties.currentLowPriorityNodes
|
integer
(int32)
|
|
A készletben jelenleg található kihasználatlan/alacsony prioritású számítási csomópontok száma.
A készletben jelenleg található kihasználatlan/alacsony prioritású számítási csomópontok száma.
|
|
properties.deploymentConfiguration
|
DeploymentConfiguration
|
|
Ez a tulajdonság azokat a virtuális gépeket ismerteti, amelyeken a készletcsomópontok üzembe lesznek helyezve.
Az üzembe helyezés konfigurációs tulajdonságai.
|
|
properties.displayName
|
string
|
|
A készlet megjelenítendő neve.
A megjelenítendő névnek nem kell egyedinek lennie, és legfeljebb 1024 hosszúságú Unicode-karaktereket tartalmazhat.
|
|
properties.interNodeCommunication
|
InterNodeCommunicationState
|
|
Lehetővé teszi-e a készlet a csomópontok közötti közvetlen kommunikációt.
Ez korlátozza, hogy mely csomópontok rendelhetők hozzá a készlethez. Ennek az értéknek az engedélyezése csökkentheti a készletben lefoglalni kívánt csomópontok számát. Ha nincs megadva, ez az érték alapértelmezés szerint "Letiltva" lesz.
|
|
properties.lastModified
|
string
(date-time)
|
|
A készlet utolsó módosított időpontja.
Ez az utolsó alkalom, amikor a készletszintű adatok, például a targetDedicatedNodes vagy az autoScaleSettings módosultak. Nem befolyásolja a csomópontszintű változásokat, például a számítási csomópontok változó állapotát.
|
|
properties.metadata
|
MetadataItem[]
|
|
A készlethez metaadatként társított név-érték párok listája.
A Batch szolgáltatás nem rendel semmilyen jelentést a metaadatokhoz; kizárólag a felhasználói kód használatára szolgál.
|
|
properties.mountConfiguration
|
MountConfiguration[]
|
|
A készlet minden csomópontjára csatlakoztatni kívánt fájlrendszerek listája.
Ez támogatja az Azure Filest, az NFS-t, a CIFS-t/SMB-t és a Blobfuse-t.
|
|
properties.networkConfiguration
|
NetworkConfiguration
|
|
A készlet hálózati konfigurációja.
A készlet hálózati konfigurációja.
|
|
properties.provisioningState
|
PoolProvisioningState
|
|
A készlet aktuális állapota.
A készlet aktuális állapota.
|
|
properties.provisioningStateTransitionTime
|
string
(date-time)
|
|
A készlet aktuális állapotának megadásának időpontja.
A készlet aktuális állapotának megadásának időpontja.
|
|
properties.resizeOperationStatus
|
ResizeOperationStatus
|
|
Az aktuális vagy az utolsó befejezett átméretezési művelet részleteit tartalmazza.
Az aktuális műveletet (ha a készlet AllocationState átméretezi) vagy a korábban befejezett műveletet (ha a AllocationState állandó).
|
|
properties.scaleSettings
|
ScaleSettings
|
|
A készletben lévő csomópontok számát konfiguráló beállítások.
Meghatározza a készlet kívánt méretét. Ez lehet "rögzített skálázás", ahol meg van adva a kért targetDedicatedNodes, vagy az "automatikus skálázás", amely egy rendszeresen újraértékelt képletet definiál. Ha ez a tulajdonság nincs megadva, a készlet rögzített skálával fog rendelkezni 0 targetDedicatedNodes értékekkel.
|
|
properties.startTask
|
StartTask
|
|
Az egyes számítási csomópontokon a készlethez való csatlakozáskor futtatandó feladat.
A PATCH (frissítési) műveletben ez a tulajdonság egy üres objektumra állítható be, hogy eltávolítsa a kezdő feladatot a készletből.
|
|
properties.taskSchedulingPolicy
|
TaskSchedulingPolicy
|
|
A tevékenységek elosztása a készlet számítási csomópontjai között.
Ha nincs megadva, az alapértelmezett oldalpár.
|
|
properties.taskSlotsPerNode
|
integer
(int32)
|
1
|
A készlet egyetlen számítási csomópontján egyidejű feladatok futtatásához használható feladathelyek száma.
Az alapértelmezett érték 1. A maximális érték a készlet VmSize-jének 4-szerese, vagy 256.
|
|
properties.upgradePolicy
|
UpgradePolicy
|
|
A készlet frissítési szabályzata.
Egy frissítési szabályzatot ír le – automatikus, manuális vagy működés közben.
|
|
properties.userAccounts
|
UserAccount[]
|
|
A készlet minden csomópontján létrehozandó felhasználói fiókok listája.
A készlet minden csomópontján létrehozandó felhasználói fiókok listája.
|
|
properties.vmSize
|
string
|
|
A virtuális gépek mérete a készletben. A készlet összes virtuális gépe azonos méretű.
Az elérhető virtuálisgép-méretekről további információt az Azure-beli virtuális gépek méretei (https://learn.microsoft.com/azure/virtual-machines/sizes/overview) című témakörben talál. A Batch az összes Azure-beli virtuálisgép-méretet támogatja, kivéve STANDARD_A0 és prémium szintű tárterülettel (STANDARD_GS, STANDARD_DS és STANDARD_DSV2 sorozattal).
|
|
systemData
|
systemData
|
|
A createdBy és a modifiedBy adatokat tartalmazó Azure Resource Manager-metaadatok.
|
|
tags
|
object
|
|
Az erőforrás címkéi.
|
|
type
|
string
|
|
Az erőforrás típusa. Pl. "Microsoft.Compute/virtualMachines" vagy "Microsoft.Storage/storageAccounts"
|
PoolEndpointConfiguration
Tárgy
A készlet végpontkonfigurációja.
| Name |
Típus |
Description |
|
inboundNatPools
|
InboundNatPool[]
|
Az egyes számítási csomópontok adott portjainak külső kezelésére használható bejövő NAT-készletek listája.
A Bejövő NAT-készletek maximális száma Batch-készletenként 5. Ha túllépi a bejövő NAT-készletek maximális számát, a kérés a 400-es HTTP-állapotkóddal meghiúsul. Ez nem adható meg, ha az IPAddressProvisioningType noPublicIPAddresses.
|
PoolIdentityType
Felsorolás
A Batch-készlethez használt identitás típusa.
| Érték |
Description |
|
UserAssigned
|
A Batch-készlethez felhasználó által hozzárendelt identitások tartoznak.
|
|
None
|
A Batch-készlethez nincs identitás társítva. A frissítési készletben None beállítása eltávolítja a meglévő identitásokat.
|
PoolProvisioningState
Felsorolás
A készlet aktuális állapota.
| Érték |
Description |
|
Succeeded
|
A készlet a számítási csomópontok rendelkezésre állásától függő feladatok futtatásához érhető el.
|
|
Deleting
|
A felhasználó kérte a készlet törlését, de a törlési művelet még nem fejeződött be.
|
ProxyAgentSettings
Tárgy
ProxyAgent-beállításokat ad meg a virtuális gép létrehozásakor.
| Name |
Típus |
Description |
|
enabled
|
boolean
|
Megadja, hogy engedélyezni kell-e a Metadata Security Protocol szolgáltatást a virtuális gépen vagy a virtuálisgép-méretezési csoporton. Az alapértelmezett érték hamis.
|
|
imds
|
HostEndpointSettings
|
Az IMDS-végpont beállításai.
|
|
wireServer
|
HostEndpointSettings
|
A WireServer-végpont beállításai.
|
PublicIPAddressConfiguration
Tárgy
A készlet hálózati konfigurációjának nyilvános IP-címkonfigurációja.
| Name |
Típus |
Description |
|
ipAddressIds
|
string[]
|
Azon nyilvános IP-címek listája, amelyeket a Batch szolgáltatás használni fog a számítási csomópontok kiépítésekor.
Az itt megadott IP-címek száma korlátozza a készlet maximális méretét – 100 dedikált csomópont vagy 100 kihasználatlan/alacsony prioritású csomópont foglalható le minden nyilvános IP-címhez. Egy 250 dedikált virtuális gépet igénylő készletnek például legalább 3 nyilvános IP-címet kell megadnia. A gyűjtemény minden eleme a következő formában jelenik meg: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}.
|
|
ipFamilies
|
IPFamily[]
|
A készlet számára elérhető IP-verziók megadásához használt IP-családok.
Az IP-családok az egy- vagy kettős veremkészletek meghatározására szolgálnak. Egyverem esetén a várt érték az IPv4. Kettős verem esetén a várt értékek az IPv4 és az IPv6.
|
|
ipTags
|
IPTag[]
|
IP-címkék, amelyeket a Batch által létrehozott új nyilvános IP-címekre alkalmaznak.
IP-címkék, amelyeket a Batch által létrehozott új nyilvános IP-címekre alkalmaznak.
|
|
provision
|
IPAddressProvisioningType
|
A Batch-készlet nyilvános IP-címeinek kiépítési típusa.
Az alapértelmezett érték a BatchManaged
|
ResizeError
Tárgy
Hiba történt egy készlet átméretezésekor.
| Name |
Típus |
Description |
|
code
|
string
|
A hiba azonosítója. A kódok invariánsak, és programozott módon használhatók.
|
|
details
|
ResizeError[]
|
További részletek a hibáról.
További részletek a hibáról.
|
|
message
|
string
|
A hibát leíró üzenet, amely alkalmas a felhasználói felületen való megjelenítésre.
|
ResizeOperationStatus
Tárgy
Az aktuális vagy az utolsó befejezett átméretezési művelet részletei.
| Name |
Típus |
Description |
|
errors
|
ResizeError[]
|
A készlet utolsó átméretezésének végrehajtása során előforduló hibák részletei.
Ez a tulajdonság csak akkor van beállítva, ha hiba történt az utolsó készlet átméretezésekor, és csak akkor, ha a készlet foglalási állapota állandó.
|
|
nodeDeallocationOption
|
ComputeNodeDeallocationOption
|
Meghatározza, hogy mi a teendő egy csomóponttal és annak futó feladatával, miután ki lett választva a felszabadításhoz.
Az alapértelmezett érték az újrakérés.
|
|
resizeTimeout
|
string
(duration)
|
A számítási csomópontok készlethez való lefoglalásának vagy a számítási csomópontok készletből való eltávolításának időtúllépése.
Az alapértelmezett érték 15 perc. A minimális érték 5 perc. Ha 5 percnél rövidebb értéket ad meg, a Batch szolgáltatás hibát ad vissza; ha közvetlenül a REST API-t hívja meg, a HTTP-állapotkód 400 (hibás kérés).
|
|
startTime
|
string
(date-time)
|
Az átméretezési művelet indításának időpontja.
Az átméretezési művelet indításának időpontja.
|
|
targetDedicatedNodes
|
integer
(int32)
|
A készletben lévő dedikált számítási csomópontok kívánt száma.
A készletben lévő dedikált számítási csomópontok kívánt száma.
|
|
targetLowPriorityNodes
|
integer
(int32)
|
A készletben található kihasználatlan/alacsony prioritású számítási csomópontok kívánt száma.
A készletben található kihasználatlan/alacsony prioritású számítási csomópontok kívánt száma.
|
ResourceFile
Tárgy
Egy számítási csomópontra letöltendő egyetlen vagy több fájl.
| Name |
Típus |
Description |
|
autoStorageContainerName
|
string
|
A tároló neve az automatikus tárfiókban.
Az autoStorageContainerName, storageContainerUrl és httpUrl tulajdonságok kölcsönösen kizárják egymást, és meg kell adni az egyiket.
|
|
blobPrefix
|
string
|
A blobok Azure Storage-tárolóból való letöltésekor használandó blobelőtag. Csak azok a blobok töltődnek le, amelyeknek a neve a megadott előtaggal kezdődik.
A tulajdonság csak az autoStorageContainerName vagy storageContainerUrl használatakor érvényes. Ez az előtag lehet részleges fájlnév vagy alkönyvtár. Ha nincs megadva előtag, a tárolóban lévő összes fájl le lesz töltve.
|
|
fileMode
|
string
|
A fájlengedélyezési mód attribútum oktális formátumban.
Ez a tulajdonság csak a Linux számítási csomópontokra letöltött fájlokra vonatkozik. A rendszer figyelmen kívül hagyja, ha az erőforrásfájlhoz van megadva, amely egy Windows-csomópontra lesz letöltve. Ha ez a tulajdonság nincs megadva Linux-csomóponthoz, akkor a rendszer egy alapértelmezett 0770-et alkalmaz a fájlra.
|
|
filePath
|
string
|
A számítási csomópont azon helye, ahová le szeretné tölteni a fájlt a feladat munkakönyvtárához képest.
Ha a httpUrl tulajdonság meg van adva, a filePath szükséges, és leírja a fájl letöltési útvonalát, beleértve a fájlnevet is. Ellenkező esetben, ha az autoStorageContainerName vagy storageContainerUrl tulajdonság meg van adva, a filePath nem kötelező, és az a könyvtár, amelybe letölti a fájlokat. Abban az esetben, ha a filePath könyvtárként van használva, a bemeneti adatokhoz már társított címtárstruktúra teljes egészében megmarad, és hozzá lesz fűzve a megadott filePath könyvtárhoz. A megadott relatív elérési út nem bontható ki a tevékenység munkakönyvtárából (például a ".." használatával).
|
|
httpUrl
|
string
|
A letölteni kívánt fájl URL-címe.
Az autoStorageContainerName, storageContainerUrl és httpUrl tulajdonságok kölcsönösen kizárják egymást, és meg kell adni az egyiket. Ha az URL-cím az Azure Blob Storage-ra mutat, akkor a számítási csomópontokról olvashatónak kell lennie. Az Azure Storage-beli blobok URL-címének lekérése három módon lehetséges: tartalmazzon egy megosztott hozzáférésű jogosultságkódot (SAS), amely olvasási engedélyeket ad a blobhoz, használjon olvasási engedéllyel rendelkező felügyelt identitást, vagy állítsa be a blob vagy a tároló ACL-jét a nyilvános hozzáférés engedélyezéséhez.
|
|
identityReference
|
ComputeNodeIdentityReference
|
A storageContainerUrl vagy a httpUrl által megadott Azure Blob Storage eléréséhez használt felhasználó által hozzárendelt identitásra mutató hivatkozás
A számítási csomópont által használt Batch-készlethez társított felhasználó által hozzárendelt identitásra mutató hivatkozás.
|
|
storageContainerUrl
|
string
|
A blobtároló URL-címe az Azure Blob Storage-ban.
Az autoStorageContainerName, storageContainerUrl és httpUrl tulajdonságok kölcsönösen kizárják egymást, és meg kell adni az egyiket. Ennek az URL-címnek olvashatónak és listázhatónak kell lennie a számítási csomópontokról. Az Azure Storage-tárolókhoz háromféleképpen lehet ilyen URL-címet lekérni: tartalmazzon egy olyan közös hozzáférésű jogosultságkódot (SAS), amely olvasási és listaengedélyeket ad a tárolóhoz, használjon egy felügyelt identitást olvasási és listaengedélyekkel, vagy állítsa be a tároló ACL-ét a nyilvános hozzáférés engedélyezéséhez.
|
RollingUpgradePolicy
Tárgy
A működés közbeni frissítés során használt konfigurációs paraméterek.
| Name |
Típus |
Description |
|
enableCrossZoneUpgrade
|
boolean
|
A frissítési kötegek létrehozásakor engedélyezze a VMSS számára, hogy figyelmen kívül hagyja az AZ-határokat. A köteg méretének meghatározásához vegye figyelembe az Update Domain és a maxBatchInstancePercent tartományt. Ha ez a mező nincs beállítva, az Azure Azure Batch nem állítja be az alapértelmezett értékét. A létrehozott VirtualMachineScaleSeten az enableCrossZoneUpgrade értékét a VirtualMachineScaleSet alapértelmezett konfigurációi határozzák meg. Ez a mező csak akkor állítható be igaz vagy hamis értékre, ha a NodePlacementConfigurationt Zonalként használja.
|
|
maxBatchInstancePercent
|
integer
(int32)
minimum: 5 maximum: 100
|
Az összes virtuálisgép-példány maximális százalékos aránya, amelyet a rendszer egyszerre frissít egy kötegben futó frissítéssel. Mivel ez a maximális, nem kifogástalan példányok az előző vagy jövőbeli kötegekben, a nagyobb megbízhatóság érdekében a köteg példányainak százalékos aránya csökkenhet. A mező értékének 5 és 100 közöttinek kell lennie, beleértve az értéket is. Ha a maxBatchInstancePercent és a maxUnhealthyInstancePercent is értékhez van rendelve, a maxBatchInstancePercent értéke nem lehet nagyobb, mint maxUnhealthyInstancePercent.
|
|
maxUnhealthyInstancePercent
|
integer
(int32)
minimum: 5 maximum: 100
|
A méretezési csoportban lévő összes virtuálisgép-példány maximális százalékos aránya, amely egyidejűleg nem kifogástalan lehet a frissítés eredményeként, vagy ha a virtuális gép állapota nem megfelelő állapotban található a működés közbeni frissítés megszakítása előtt. A köteg indítása előtt a rendszer ellenőrzi ezt a korlátozást. A mező értékének 5 és 100 közöttinek kell lennie, beleértve az értéket is. Ha a maxBatchInstancePercent és a maxUnhealthyInstancePercent is értékhez van rendelve, a maxBatchInstancePercent értéke nem lehet nagyobb, mint maxUnhealthyInstancePercent.
|
|
maxUnhealthyUpgradedInstancePercent
|
integer
(int32)
minimum: 0 maximum: 100
|
A frissített virtuálisgép-példányok maximális százalékos aránya, amely nem kifogástalan állapotban található. Ez az ellenőrzés az egyes kötegek frissítése után történik. Ha ezt a százalékos értéket valaha is túllépi, a működés közbeni frissítés leáll. A mező értékének 0 és 100 közöttinek kell lennie, beleértve az értéket is.
|
|
pauseTimeBetweenBatches
|
string
|
Az egy kötegben lévő összes virtuális gép frissítésének befejezése és a következő köteg indítása közötti várakozási idő. Az időtartamot ISO 8601 formátumban kell megadni.
|
|
prioritizeUnhealthyInstances
|
boolean
|
Frissítse a méretezési csoportban lévő összes nem kifogástalan példányt az kifogástalan állapotú példányok előtt.
|
|
rollbackFailedInstancesOnPolicyBreach
|
boolean
|
Sikertelen példányok visszaállítása az előző modellre, ha a működés közbeni frissítési szabályzatot megsértették.
|
ScaleSettings
Tárgy
A készlet méretezési beállításai
| Name |
Típus |
Description |
|
autoScale
|
AutoScaleSettings
|
A készlet automatikus méretezési beállításai.
Ez a tulajdonság és a rögzített skálázás kölcsönösen kizárja egymást, és meg kell adni az egyik tulajdonságot.
|
|
fixedScale
|
FixedScaleSettings
|
Kijavítottuk a készlet méretezési beállításait.
Ez a tulajdonság és az automatikus skálázás kölcsönösen kizárja egymást, és meg kell adni az egyik tulajdonságot.
|
SecurityEncryptionTypes
Felsorolás
A felügyelt lemez EncryptionType tulajdonságát adja meg. A menedzselt lemez titkosításához DiskWithVMGuestState van beállítva, a VMGuestState blob-hoz a VMGuestState blokkhoz, VMGuestStateOnly a VMGuestState tömb titkosításához, NonPersistedTPM-hez pedig a VMGuestState blob firmware állapotának hiányosságához.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használata esetén kötelező.
| Érték |
Description |
|
NonPersistedTPM
|
A felügyelt lemez EncryptionType értéke NonPersistedTPM, mert nem őrzi meg a belső vezérlőprogram állapotát a VMGuestState blobban.
|
|
VMGuestStateOnly
|
A felügyelt lemez EncryptionType értéke VMGuestStateOnly csak a VMGuestState blob titkosításához.
|
|
DiskWithVMGuestState
|
A felügyelt lemez EncryptionType értéke DiskWithVMGuestState a felügyelt lemez és a VMGuestState blob titkosításához. Adatlemezeken nem támogatott.
|
SecurityProfile
Tárgy
Megadja a virtuális gép vagy a virtuálisgép-méretezési csoport biztonsági profilbeállításait.
| Name |
Típus |
Description |
|
encryptionAtHost
|
boolean
|
Ezt a tulajdonságot a felhasználó használhatja a kérelemben a virtuális gép vagy virtuálisgép-méretezési csoport gazdagéptitkosításának engedélyezésére vagy letiltására. Ez lehetővé teszi az összes lemez titkosítását, beleértve magát a gazdagépen található Resource/Temp lemezt is.
|
|
proxyAgentSettings
|
ProxyAgentSettings
|
ProxyAgent-beállításokat ad meg a virtuális gép létrehozásakor.
|
|
securityType
|
SecurityTypes
|
A virtuális gép SecurityType tulajdonságát adja meg. Az UefiSettings engedélyezéséhez minden megadott értékre be kell állítani.
A virtuális gép SecurityType tulajdonságát adja meg. Az UefiSettings engedélyezéséhez minden megadott értékre be kell állítani.
|
|
uefiSettings
|
UefiSettings
|
Megadja a virtuális gép létrehozásakor használt biztonsági beállításokat, például a biztonságos rendszerindítást és a vTPM-et.
Megadja a virtuális gép létrehozásakor használt biztonsági beállításokat, például a biztonságos rendszerindítást és a vTPM-et.
|
SecurityTypes
Felsorolás
A virtuális gép SecurityType tulajdonságát adja meg. Az UefiSettings engedélyezéséhez minden megadott értékre be kell állítani.
| Érték |
Description |
|
trustedLaunch
|
A megbízható indítás védelmet nyújt a fejlett és állandó támadási technikák ellen.
|
|
confidentialVM
|
Az Azure bizalmas számítástechnikai ajánlatai bizalmas virtuális gépeket kínálnak a magas biztonsági és bizalmassági követelményekkel rendelkező bérlők számára. Ezek a virtuális gépek erős, hardverre kényszerített határt biztosítanak a biztonsági igények kielégítése érdekében. A kód módosítása nélkül használhat bizalmas virtuális gépeket a migrálásokhoz, a platform pedig védi a virtuális gép állapotát az olvasástól vagy a módosítástól.
|
ServiceArtifactReference
Tárgy
Megadja azt a szolgáltatásösszetevő-referencia-azonosítót, amellyel a méretezési csoport összes virtuális gépe ugyanazt a rendszerképverziót állíthatja be a "legújabb" rendszerképverzió használatakor.
| Name |
Típus |
Description |
|
id
|
string
|
A ServiceArtifactReference szolgáltatásösszetevő-referenciaazonosítója
A szolgáltatásösszetevő referencia-azonosítója /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/gallerys/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}
|
StartTask
Tárgy
Olyan feladat, amely akkor fut, amikor egy számítási csomópont csatlakozik egy készlethez az Azure Batch szolgáltatásban, vagy amikor a számítási csomópont újraindul vagy újraépül.
| Name |
Típus |
Alapértelmezett érték |
Description |
|
commandLine
|
string
|
|
A kezdő feladat parancssora.
A parancssor nem rendszerhéj alatt fut, ezért nem tudja kihasználni a rendszerhéj funkcióit, például a környezeti változók bővítését. Ha ki szeretné használni az ilyen funkciókat, a parancssorban meg kell hívnia a rendszerhéjat, például a Windowsban a "cmd /c MyCommand" vagy a "/bin/sh -c MyCommand" parancsmagot Linuxon. Kötelező, ha a startTask bármely más tulajdonsága meg van adva.
|
|
containerSettings
|
TaskContainerSettings
|
|
Annak a tárolónak a beállításai, amelyek alatt a kezdési feladat fut.
Ha ez meg van adva, a rendszer a AZ_BATCH_NODE_ROOT_DIR alatt rekurzívan az összes könyvtárat (a csomóponton található Azure Batch-címtárak gyökerét) leképezi a tárolóba, az összes tevékenységkörnyezeti változót a tárolóba rendeli, és a feladat parancssora a tárolóban lesz végrehajtva.
|
|
environmentSettings
|
EnvironmentSetting[]
|
|
Az indítási tevékenység környezeti változóbeállításainak listája.
Az indítási tevékenység környezeti változóbeállításainak listája.
|
|
maxTaskRetryCount
|
integer
(int32)
|
0
|
A tevékenység újrapróbálásának maximális száma.
A Batch szolgáltatás újrapróbálkoz egy feladatot, ha a kilépési kódja nem érvényes. Vegye figyelembe, hogy ez az érték kifejezetten az újrapróbálkozések számát szabályozza. A Batch szolgáltatás egyszer próbálja ki a feladatot, majd megpróbálkozhat ezzel a korláttal. Ha például a maximális újrapróbálkozás száma 3, a Batch legfeljebb 4 alkalommal próbálja meg a feladatot (egy kezdeti próbálkozás és 3 újrapróbálkozás). Ha az újrapróbálkozás maximális száma 0, a Batch szolgáltatás nem próbálkozik újra a feladattal. Ha a maximális újrapróbálkozási szám -1, a Batch szolgáltatás korlátozás nélkül újrapróbálkozza a feladatot. Az alapértelmezett érték 0
|
|
resourceFiles
|
ResourceFile[]
|
|
Azon fájlok listája, amelyeket a Batch szolgáltatás a parancssor futtatása előtt letölt a számítási csomópontra.
Azon fájlok listája, amelyeket a Batch szolgáltatás a parancssor futtatása előtt letölt a számítási csomópontra.
|
|
userIdentity
|
UserIdentity
|
|
Az a felhasználói identitás, amely alatt a kezdési feladat fut.
Ha nincs megadva, a tevékenység nem rendszergazdai felhasználóként fut, amely egyedi a feladathoz.
|
|
waitForSuccess
|
boolean
|
|
Annak eldöntése, hogy a Batch szolgáltatásnak várnia kell-e a kezdési tevékenység sikeres befejezésére (azaz a 0-s kilépési kóddal való kilépésre) a számítási csomóponton végzett tevékenységek ütemezése előtt.
Ha igaz, és a kezdési tevékenység meghiúsul egy számítási csomóponton, a Batch szolgáltatás újrapróbálkozásokat indít el a maximális újrapróbálkozások számának (maxTaskRetryCount) értékével. Ha a tevékenység az összes újrapróbálkozás után sem fejeződött be sikeresen, akkor a Batch szolgáltatás használhatatlanná teszi a számítási csomópontot, és nem ütemezi a tevékenységeket. Ez a feltétel a csomópont állapotán és az ütemezési hiba részletein keresztül észlelhető. Ha hamis, a Batch szolgáltatás nem várja meg a kezdési feladat befejezését. Ebben az esetben más tevékenységek is elkezdhetik a végrehajtást a számítási csomóponton, amíg a kezdő tevékenység még fut; és még ha az indítási feladat meghiúsul is, az új tevékenységek továbbra is ütemezve lesznek a csomóponton. Az alapértelmezett érték igaz.
|
StorageAccountType
Felsorolás
A tárfiók típusa adatlemezek vagy operációsrendszer-lemezek létrehozásához.
| Érték |
Description |
|
Standard_LRS
|
Az adatlemeznek/operációsrendszer-lemeznek szabványos helyileg redundáns tárolót kell használnia.
|
|
Premium_LRS
|
Az adatlemeznek/operációsrendszer-lemeznek prémium helyileg redundáns tárolást kell használnia.
|
|
StandardSSD_LRS
|
Az adatlemeznek/operációsrendszer-lemeznek szabványos, helyileg redundáns SSD-tárolót kell használnia.
|
systemData
Tárgy
Az erőforrás létrehozásával és utolsó módosításával kapcsolatos metaadatok.
| Name |
Típus |
Description |
|
createdAt
|
string
(date-time)
|
Az erőforrás-létrehozás időbélyege (UTC).
|
|
createdBy
|
string
|
Az erőforrást létrehozó identitás.
|
|
createdByType
|
createdByType
|
Az erőforrást létrehozó identitás típusa.
|
|
lastModifiedAt
|
string
(date-time)
|
Az erőforrás utolsó módosításának időbélyege (UTC)
|
|
lastModifiedBy
|
string
|
Az erőforrást legutóbb módosító identitás.
|
|
lastModifiedByType
|
createdByType
|
Az erőforrást legutóbb módosító identitás típusa.
|
TaskContainerSettings
Tárgy
A feladat tárolóbeállításai.
| Name |
Típus |
Description |
|
containerHostBatchBindMounts
|
ContainerHostBatchBindMountEntry[]
|
A tárolófeladathoz csatlakoztatni kívánt elérési utak.
Ha ez a tömb null értékű, vagy nincs jelen, a tárolófeladat a teljes ideiglenes lemezmeghajtót csatlakoztatja a Windowsban (vagy linuxos AZ_BATCH_NODE_ROOT_DIR). Ha ez a tömb üresként van beállítva, nem fog adatelérési utakat csatlakoztatni a tárolóhoz.
|
|
containerRunOptions
|
string
|
A tároló létrehozási parancsának további beállításai.
Ezeket a további lehetőségeket argumentumként adja meg a "docker create" parancs, a Batch szolgáltatás által szabályozottakon kívül.
|
|
imageName
|
string
|
A tároló létrehozásához használandó rendszerkép, amelyben a feladat futni fog.
Ez a teljes képhivatkozás, ahogyan a "docker pull" kifejezés is meg van adva. Ha a rendszer nem ad meg címkét a képnév részeként, a rendszer alapértelmezés szerint a "latest" címkét használja.
|
|
registry
|
ContainerRegistry
|
A tároló lemezképét tartalmazó privát beállításjegyzék.
Ez a beállítás kihagyható, ha már meg lett adva a készlet létrehozásakor.
|
|
workingDirectory
|
ContainerWorkingDirectory
|
A tárolótevékenység munkakönyvtárának helyét jelző jelző. Az alapértelmezett érték a "taskWorkingDirectory".
A tárolótevékenység munkakönyvtárának helyét jelző jelző. Az alapértelmezett érték a "taskWorkingDirectory".
|
TaskSchedulingPolicy
Tárgy
Meghatározza, hogy a tevékenységek hogyan legyenek elosztva a számítási csomópontok között.
| Name |
Típus |
Alapértelmezett érték |
Description |
|
jobDefaultOrder
|
JobDefaultOrder
|
|
Ha nincs megadva, az alapértelmezett érték a none.
A különböző feladatok azonos prioritású feladatok ütemezésének sorrendje.
|
|
nodeFillType
|
ComputeNodeFillType
|
Spread
|
Hogyan kell elosztani a feladatokat a számítási csomópontok között.
Hogyan kell elosztani a feladatokat a számítási csomópontok között.
|
UefiSettings
Tárgy
Megadja a virtuális gép létrehozásakor használt biztonsági beállításokat, például a biztonságos rendszerindítást és a vTPM-et.
| Name |
Típus |
Description |
|
secureBootEnabled
|
boolean
|
Megadja, hogy engedélyezni kell-e a biztonságos rendszerindítást a virtuális gépen.
|
|
vTpmEnabled
|
boolean
|
Megadja, hogy a virtuális gépen engedélyezve legyen-e a vTPM.
|
UpgradeMode
Felsorolás
Megadja a méretezési csoportban lévő virtuális gépekre való frissítés módját.
A lehetséges értékek a következők:
Manuális – A méretezési csoportban lévő virtuális gépek frissítéseinek alkalmazását szabályozhatja. Ezt a manualUpgrade művelet használatával teheti meg.
Automatikus – A méretezési csoportban lévő összes virtuális gép automatikusan frissül.
Gördülő – A méretezési csoport a frissítéseket kötegekben hajtja végre, köztük egy opcionális szünetidővel.
| Érték |
Description |
|
automatic
|
A méretezési csoportban lévő összes virtuális gép automatikusan frissül egyszerre.
|
|
manual
|
Ön szabályozza a méretezési csoportban lévő virtuális gépek frissítéseinek alkalmazását. Ezt a manualUpgrade művelet használatával teheti meg.
|
|
rolling
|
A méretezési csoport meglévő példányai a frissítendő kötegekben lesznek leállítva. A frissített köteg befejezése után a példányok újra megkezdik a forgalom felvételét, és megkezdődik a következő köteg. Ez mindaddig folytatódik, amíg az összes példány up-to-date értékre nem kerül.
|
UpgradePolicy
Tárgy
Egy frissítési szabályzatot ír le – automatikus, manuális vagy működés közben.
| Name |
Típus |
Description |
|
automaticOSUpgradePolicy
|
AutomaticOSUpgradePolicy
|
Az operációs rendszer automatikus frissítéséhez használt konfigurációs paraméterek.
Az operációs rendszer automatikus frissítéséhez használt konfigurációs paraméterek.
|
|
mode
|
UpgradeMode
|
Megadja a méretezési csoportban lévő virtuális gépekre való frissítés módját.
A lehetséges értékek a következők:
Manuális – A méretezési csoportban lévő virtuális gépek frissítéseinek alkalmazását szabályozhatja. Ezt a manualUpgrade művelet használatával teheti meg.
Automatikus – A méretezési csoportban lévő összes virtuális gép automatikusan frissül.
Gördülő – A méretezési csoport a frissítéseket kötegekben hajtja végre, köztük egy opcionális szünetidővel.
Megadja a méretezési csoportban lévő virtuális gépekre való frissítés módját.
A lehetséges értékek a következők:
Manuális – A méretezési csoportban lévő virtuális gépek frissítéseinek alkalmazását szabályozhatja. Ezt a manualUpgrade művelet használatával teheti meg.
Automatikus – A méretezési csoportban lévő összes virtuális gép automatikusan frissül.
Gördülő – A méretezési csoport a frissítéseket kötegekben hajtja végre, köztük egy opcionális szünetidővel.
|
|
rollingUpgradePolicy
|
RollingUpgradePolicy
|
A működés közbeni frissítés során használt konfigurációs paraméterek.
A működés közbeni frissítés során használt konfigurációs paraméterek.
|
UserAccount
Tárgy
A felhasználó Azure Batch-csomóponton való létrehozásához használt tulajdonságok.
| Name |
Típus |
Description |
|
elevationLevel
|
ElevationLevel
|
A felhasználó szintemelési szintje.
nonAdmin – Az automatikus felhasználó egy normál, emelt szintű hozzáféréssel nem rendelkező felhasználó. rendszergazda – Az automatikus felhasználó emelt szintű hozzáféréssel rendelkező felhasználó, és teljes rendszergazdai engedélyekkel rendelkezik. Az alapértelmezett érték nem Admin.
|
|
linuxUserConfiguration
|
LinuxUserConfiguration
|
A felhasználói fiók Linux-specifikus felhasználói konfigurációja.
Ezt a tulajdonságot a rendszer figyelmen kívül hagyja, ha egy Windows-készletben van megadva. Ha nincs megadva, a felhasználó az alapértelmezett beállításokkal jön létre.
|
|
name
|
string
|
A felhasználói fiók neve. A nevek legfeljebb 20 Unicode-karaktert tartalmazhatnak.
A felhasználói fiók neve. A nevek legfeljebb 20 Unicode-karaktert tartalmazhatnak.
|
|
password
|
string
(password)
|
A felhasználói fiók jelszava.
A felhasználói fiók jelszava.
|
|
windowsUserConfiguration
|
WindowsUserConfiguration
|
A felhasználói fiók Windows-specifikus felhasználói konfigurációja.
Ez a tulajdonság csak akkor adható meg, ha a felhasználó Windows-készletben van. Ha nincs megadva, és Windows-készleten, a rendszer az alapértelmezett beállításokkal hozza létre a felhasználót.
|
UserAssignedIdentities
Tárgy
A társított felhasználói identitások listája.
| Name |
Típus |
Description |
|
clientId
|
string
|
A felhasználó által hozzárendelt identitás ügyfélazonosítója.
|
|
principalId
|
string
|
A felhasználó által hozzárendelt identitás egyszerű azonosítója.
|
UserIdentity
Tárgy
Annak a felhasználói identitásnak a definíciója, amely alatt a feladat fut.
| Name |
Típus |
Description |
|
autoUser
|
AutoUserSpecification
|
Az az automatikus felhasználó, amely alatt a feladat fut.
A userName és az autoUser tulajdonságok kölcsönösen kizárják egymást; egyet kell megadnia, de mindkettőt nem.
|
|
userName
|
string
|
Annak a felhasználói identitásnak a neve, amely alatt a feladat fut.
A userName és az autoUser tulajdonságok kölcsönösen kizárják egymást; egyet kell megadnia, de mindkettőt nem.
|
VirtualMachineConfiguration
Tárgy
A számítási csomópontok konfigurációja egy készletben az Azure Virtual Machines-infrastruktúra alapján.
| Name |
Típus |
Description |
|
containerConfiguration
|
ContainerConfiguration
|
A készlet tárolókonfigurációja.
Ha meg van adva, a beállítás a készlet minden csomópontján történik, hogy a tevékenységek tárolókban fussanak. Az ezen a készleten futó összes normál tevékenységnek és feladatkezelői tevékenységnek meg kell adnia a containerSettings tulajdonságot, és az összes többi tevékenység megadhatja azt.
|
|
dataDisks
|
DataDisk[]
|
A készlet számítási csomópontjaihoz csatolt adatlemezek konfigurációja.
Ezt a tulajdonságot akkor kell megadni, ha a készlet számítási csomópontjaihoz üres adatlemezeket kell csatolni.
|
|
diskEncryptionConfiguration
|
DiskEncryptionConfiguration
|
A készlet lemeztitkosítási konfigurációja.
Ha meg van adva, a rendszer titkosítást végez a készlet minden csomópontján a csomópontok kiépítése során.
|
|
extensions
|
VMExtension[]
|
A készlet virtuálisgép-bővítménye.
Ha meg van adva, az ebben a konfigurációban említett bővítmények minden csomóponton telepítve lesznek.
|
|
imageReference
|
ImageReference
|
Hivatkozás az Azure Virtual Machines Marketplace-rendszerképére vagy a használni kívánt egyéni virtuálisgép-rendszerképre.
Hivatkozás egy Azure Virtual Machines Marketplace-rendszerképre vagy egy egyéni virtuális gép Azure Image-erőforrására. Az Összes imageReferences Azure Batch által ellenőrzött listájának lekéréséhez tekintse meg a "Támogatott csomópontügynök termékváltozatainak listázása" műveletet.
|
|
licenseType
|
string
|
Az operációs rendszer telepítésekor használandó helyszíni licenc típusa.
Ez csak a Windows operációs rendszert tartalmazó rendszerképekre vonatkozik, és csak akkor használható, ha érvényes helyszíni licencekkel rendelkezik az üzembe helyezett csomópontokhoz. Ha nincs megadva, a rendszer nem alkalmaz helyszíni licencelési kedvezményt. Az értékek a következők:
Windows_Server – A helyszíni licenc a Windows Serverhez készült.
Windows_Client – A helyszíni licenc Windows-ügyfélhez készült.
|
|
nodeAgentSkuId
|
string
|
A készlet számítási csomópontjaihoz kiépíteni kívánt Batch-csomópontügynök termékváltozata.
A Batch csomópontügynök egy olyan program, amely a készlet minden csomópontján fut, és biztosítja a parancs- és vezérlési felületet a csomópont és a Batch szolgáltatás között. A csomópontügynöknek, más néven termékváltozatoknak különböző implementációi vannak a különböző operációs rendszerekhez. Meg kell adnia egy csomópontügynök termékváltozatát, amely megfelel a kijelölt képhivatkozásnak. A támogatott csomópontügynök termékváltozatainak és az ellenőrzött képhivatkozások listájának lekéréséhez tekintse meg a "Támogatott csomópontügynök termékváltozatainak listázása" műveletet.
|
|
nodePlacementConfiguration
|
NodePlacementConfiguration
|
A készlet csomópontelhelyezési konfigurációja.
Ez a konfiguráció határozza meg a készlet csomópontjai fizikai lefoglalásának módját.
|
|
osDisk
|
OSDisk
|
A virtuális gép operációsrendszer-lemezének beállításai.
A rövid élettartamú OSDisk-beállítások konfigurációját tartalmazza.
|
|
securityProfile
|
SecurityProfile
|
Megadja a virtuális gép vagy a virtuálisgép-méretezési csoport biztonsági profilbeállításait.
Megadja a virtuális gép vagy a virtuálisgép-méretezési csoport biztonsági profilbeállításait.
|
|
serviceArtifactReference
|
ServiceArtifactReference
|
Megadja azt a szolgáltatásösszetevő-referencia-azonosítót, amellyel a méretezési csoport összes virtuális gépe ugyanazt a rendszerképverziót állíthatja be a "legújabb" rendszerképverzió használatakor.
A szolgáltatásösszetevő referencia-azonosítója /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/gallerys/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}
|
|
windowsConfiguration
|
WindowsConfiguration
|
Windows operációs rendszer beállításai a virtuális gépen.
Ezt a tulajdonságot nem szabad megadni, ha az imageReference linuxos operációsrendszer-lemezképet ad meg.
|
VMDiskSecurityProfile
Tárgy
Megadja a felügyelt lemez biztonsági profilbeállításait.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használatakor szükséges.
| Name |
Típus |
Description |
|
diskEncryptionSet
|
DiskEncryptionSetParameters
|
Megadja az ügyfél által felügyelt lemeztitkosítási csoport erőforrás-azonosítóját a felügyelt lemezhez, amelyet az ügyfél által titkosított ConfidentialVM OS Disk és VMGuest blob használ. Csak UserSubscription módban állítható be.
|
|
securityEncryptionType
|
SecurityEncryptionTypes
|
A felügyelt lemez EncryptionType tulajdonságát adja meg. A VMGuestStateOnly értékre van állítva csak a VMGuestState blob titkosításához, és a NemPersistedTPM értékre, ha nem tartja meg a belső vezérlőprogram állapotát a VMGuestState-blobban.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használata esetén kötelező.
A felügyelt lemez EncryptionType tulajdonságát adja meg. A VMGuestStateOnly értékre van állítva csak a VMGuestState blob titkosításához, és a NemPersistedTPM értékre, ha nem tartja meg a belső vezérlőprogram állapotát a VMGuestState-blobban.
Megjegyzés: Csak bizalmas virtuális gépekhez állítható be, és bizalmas virtuális gépek használata esetén kötelező.
|
VMExtension
Tárgy
A virtuálisgép-bővítmények konfigurációja.
| Name |
Típus |
Description |
|
autoUpgradeMinorVersion
|
boolean
|
Azt jelzi, hogy a bővítménynek egy újabb alverziót kell-e használnia, ha az üzembe helyezéskor elérhető. Az üzembe helyezés után azonban a bővítmény csak akkor frissíti az alverziókat, ha újra üzembe helyezi, még akkor sem, ha ez a tulajdonság igaz értékre van állítva.
|
|
enableAutomaticUpgrade
|
boolean
|
Azt jelzi, hogy a bővítményt automatikusan frissítenie kell-e a platformnak, ha a bővítmény újabb verziója érhető el.
|
|
name
|
string
|
A virtuálisgép-bővítmény neve.
A virtuálisgép-bővítmény neve.
|
|
protectedSettings
|
|
A bővítmény tartalmazhat védettSettings vagy protectedSettingsFromKeyVault beállítást, vagy egyáltalán nem tartalmaz védett beállításokat.
|
|
provisionAfterExtensions
|
string[]
|
A bővítménynevek gyűjteménye.
Olyan bővítménynevek gyűjteménye, amelyek után ezt a bővítményt ki kell építeni.
|
|
publisher
|
string
|
A bővítménykezelő közzétevőjének neve.
A bővítménykezelő közzétevőjének neve.
|
|
settings
|
|
A bővítmény JSON formátumú nyilvános beállításai.
A bővítmény JSON formátumú nyilvános beállításai.
|
|
type
|
string
|
A bővítmények típusa.
A bővítmények típusa.
|
|
typeHandlerVersion
|
string
|
A szkriptkezelő verziója.
A szkriptkezelő verziója.
|
WindowsConfiguration
Tárgy
A windowsos operációs rendszer virtuális gépre vonatkozó beállításai.
| Name |
Típus |
Description |
|
enableAutomaticUpdates
|
boolean
|
Azt jelzi, hogy engedélyezve vannak-e az automatikus frissítések a virtuális gépen.
Ha nincs megadva, az alapértelmezett érték igaz.
|
WindowsUserConfiguration
Tárgy
A felhasználói fiók Windows-csomóponton való létrehozásához használt tulajdonságok.
| Name |
Típus |
Description |
|
loginMode
|
LoginMode
|
Bejelentkezési mód a felhasználó számára
Megadja a felhasználó bejelentkezési módját. Az alapértelmezett érték az Interaktív.
|