Létrehoz egy új Batch-fiókot a megadott paraméterekkel. A meglévő fiókok nem frissíthetők ezzel az API-val, és ehelyett a Batch-fiók API frissítésével kell frissíteni őket.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}?api-version=2024-02-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
accountName
|
path |
True
|
string
|
A Batch-fiók neve, amelynek egyedinek kell lennie a régióban. A Batch-fiókneveknek 3–24 karakter hosszúságúnak kell lenniük, és csak számokat és kisbetűket kell használniuk. Ez a név annak a DNS-névnek a részeként használatos, amely a Batch szolgáltatás elérésére szolgál abban a régióban, amelyben a fiókot létrehozták. Példa: http://accountname.region.batch.azure.com/.
Regex pattern: ^[a-z0-9]+$
|
resourceGroupName
|
path |
True
|
string
|
A Batch-fiókot tartalmazó erőforráscsoport neve.
|
subscriptionId
|
path |
True
|
string
|
Az Azure-előfizetés azonosítója. Ez egy GUID formátumú sztring (például 000000000-0000-0000-0000-0000000000000000)
|
api-version
|
query |
True
|
string
|
A HTTP-kéréshez használandó API-verzió.
|
Kérelem törzse
Name |
Kötelező |
Típus |
Description |
location
|
True
|
string
|
Az a régió, amelyben létre kívánja hozni a fiókot.
|
identity
|
|
BatchAccountIdentity
|
A Batch-fiók identitása.
|
properties.allowedAuthenticationModes
|
|
AuthenticationMode[]
|
Az adatsíkkal történő hitelesítéshez használható Batch-fiók engedélyezett hitelesítési módjainak listája. Ez nincs hatással a vezérlősíkon történő hitelesítésre.
|
properties.autoStorage
|
|
AutoStorageBaseProperties
|
Az automatikus tárfiókhoz kapcsolódó tulajdonságok.
|
properties.encryption
|
|
EncryptionProperties
|
A Batch-fiók titkosítási konfigurációja.
Konfigurálja az ügyféladatok Batch-fiókon belüli titkosítását. Alapértelmezés szerint a fiókok titkosítása Microsoft által felügyelt kulccsal történik. A további vezérlés érdekében az ügyfél által felügyelt kulcs használható helyette.
|
properties.keyVaultReference
|
|
KeyVaultReference
|
Hivatkozás a Batch-fiókhoz társított Azure Key Vaultra.
|
properties.networkProfile
|
|
NetworkProfile
|
A Batch-fiók hálózati profilja, amely az egyes végpontok hálózati szabálybeállítását tartalmazza.
A hálózati profil csak akkor lép érvénybe, ha a publicNetworkAccess engedélyezve van.
|
properties.poolAllocationMode
|
|
PoolAllocationMode
|
A Batch-fiókban történő készletlétrehozásához használandó lefoglalási mód.
A készletfoglalási mód azt is befolyásolja, hogy az ügyfelek hogyan hitelesíthetik magukat a Batch Service API-val. Ha a mód BatchService, az ügyfelek hívóbetűkkel vagy Microsoft Entra ID hitelesíthetik magukat. Ha a mód UserSubscription, az ügyfeleknek Microsoft Entra ID kell használniuk. Az alapértelmezett érték a BatchService.
|
properties.publicNetworkAccess
|
|
PublicNetworkAccessType
|
A Azure Batch fiók elérésére szolgáló hálózati hozzáférési típus.
Ha nincs megadva, az alapértelmezett érték "engedélyezve" lesz.
|
tags
|
|
object
|
A fiókhoz társított felhasználó által megadott címkék.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
BatchAccount
|
A művelet sikeres volt. A válasz tartalmazza a Batch-fiók entitást.
|
202 Accepted
|
|
A művelet aszinkron módon lesz végrehajtva.
Headers
- Location: string
- Retry-After: integer
|
Other Status Codes
|
CloudError
|
Hibaválasz, amely leírja, hogy a művelet miért hiúsult meg.
|
Biztonság
azure_auth
Microsoft Entra OAuth 2.0 hitelesítési kódfolyamata
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
felhasználói fiók megszemélyesítése
|
Példák
BatchAccountCreate_BYOS
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-02-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"poolAllocationMode": "UserSubscription",
"keyVaultReference": {
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
}
}
}
import com.azure.resourcemanager.batch.models.AutoStorageBaseProperties;
import com.azure.resourcemanager.batch.models.KeyVaultReference;
import com.azure.resourcemanager.batch.models.PoolAllocationMode;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for BatchAccount Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.json
*/
/**
* Sample code: BatchAccountCreate_BYOS.
*
* @param manager Entry point to BatchManager.
*/
public static void batchAccountCreateBYOS(com.azure.resourcemanager.batch.BatchManager manager) {
manager.batchAccounts().define("sampleacct").withRegion("japaneast")
.withExistingResourceGroup("default-azurebatch-japaneast")
.withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"))
.withPoolAllocationMode(PoolAllocationMode.USER_SUBSCRIPTION)
.withKeyVaultReference(new KeyVaultReference().withId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample")
.withUrl("http://sample.vault.azure.net/"))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python batch_account_create_byos.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="subid",
)
response = client.batch_account.begin_create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
parameters={
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"keyVaultReference": {
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/",
},
"poolAllocationMode": "UserSubscription",
},
},
).result()
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.json
func ExampleAccountClient_BeginCreate_batchAccountCreateByos() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{
Location: to.Ptr("japaneast"),
Properties: &armbatch.AccountCreateProperties{
AutoStorage: &armbatch.AutoStorageBaseProperties{
StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
},
KeyVaultReference: &armbatch.KeyVaultReference{
ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"),
URL: to.Ptr("http://sample.vault.azure.net/"),
},
PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeUserSubscription),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Account = armbatch.Account{
// Name: to.Ptr("sampleacct"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"),
// Location: to.Ptr("japaneast"),
// Identity: &armbatch.AccountIdentity{
// Type: to.Ptr(armbatch.ResourceIdentityTypeNone),
// },
// Properties: &armbatch.AccountProperties{
// AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"),
// ActiveJobAndJobScheduleQuota: to.Ptr[int32](20),
// AutoStorage: &armbatch.AutoStorageProperties{
// StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
// LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.987Z"); return t}()),
// },
// DedicatedCoreQuota: to.Ptr[int32](20),
// KeyVaultReference: &armbatch.KeyVaultReference{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"),
// URL: to.Ptr("http://sample.vault.azure.net/"),
// },
// LowPriorityCoreQuota: to.Ptr[int32](20),
// PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeUserSubscription),
// PoolQuota: to.Ptr[int32](20),
// ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled),
// },
// }
}
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 Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
*
* @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.json
*/
async function batchAccountCreateByos() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const parameters = {
autoStorage: {
storageAccountId:
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
},
keyVaultReference: {
id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
url: "http://sample.vault.azure.net/",
},
location: "japaneast",
poolAllocationMode: "UserSubscription",
};
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.batchAccountOperations.beginCreateAndWait(
resourceGroupName,
accountName,
parameters,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.json
// this example is just showing the usage of "BatchAccount_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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this BatchAccountResource
BatchAccountCollection collection = resourceGroupResource.GetBatchAccounts();
// invoke the operation
string accountName = "sampleacct";
BatchAccountCreateOrUpdateContent content = new BatchAccountCreateOrUpdateContent(new AzureLocation("japaneast"))
{
AutoStorage = new BatchAccountAutoStorageBaseConfiguration(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")),
PoolAllocationMode = BatchAccountPoolAllocationMode.UserSubscription,
KeyVaultReference = new BatchKeyVaultReference(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"), new Uri("http://sample.vault.azure.net/")),
};
ArmOperation<BatchAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, content);
BatchAccountResource 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
BatchAccountData 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
Sample Response
{
"name": "sampleacct",
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"provisioningState": "Succeeded",
"poolAllocationMode": "UserSubscription",
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolQuota": 20,
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
"lastKeySync": "2016-03-10T23:48:38.9878479Z"
},
"keyVaultReference": {
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
},
"publicNetworkAccess": "Enabled"
},
"identity": {
"type": "None"
},
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"type": "Microsoft.Batch/batchAccounts"
}
BatchAccountCreate_Default
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-02-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
}
}
import com.azure.resourcemanager.batch.models.AutoStorageBaseProperties;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for BatchAccount Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.json
*/
/**
* Sample code: BatchAccountCreate_Default.
*
* @param manager Entry point to BatchManager.
*/
public static void batchAccountCreateDefault(com.azure.resourcemanager.batch.BatchManager manager) {
manager.batchAccounts().define("sampleacct").withRegion("japaneast")
.withExistingResourceGroup("default-azurebatch-japaneast")
.withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python batch_account_create_default.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="subid",
)
response = client.batch_account.begin_create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
parameters={
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
},
},
).result()
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.json
func ExampleAccountClient_BeginCreate_batchAccountCreateDefault() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{
Location: to.Ptr("japaneast"),
Properties: &armbatch.AccountCreateProperties{
AutoStorage: &armbatch.AutoStorageBaseProperties{
StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Account = armbatch.Account{
// Name: to.Ptr("sampleacct"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"),
// Location: to.Ptr("japaneast"),
// Identity: &armbatch.AccountIdentity{
// Type: to.Ptr(armbatch.ResourceIdentityTypeNone),
// },
// Properties: &armbatch.AccountProperties{
// AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"),
// ActiveJobAndJobScheduleQuota: to.Ptr[int32](20),
// AutoStorage: &armbatch.AutoStorageProperties{
// StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
// LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.987Z"); return t}()),
// },
// DedicatedCoreQuota: to.Ptr[int32](20),
// LowPriorityCoreQuota: to.Ptr[int32](20),
// PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService),
// PoolQuota: to.Ptr[int32](20),
// ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled),
// },
// }
}
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 Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
*
* @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.json
*/
async function batchAccountCreateDefault() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const parameters = {
autoStorage: {
storageAccountId:
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
},
location: "japaneast",
};
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.batchAccountOperations.beginCreateAndWait(
resourceGroupName,
accountName,
parameters,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.json
// this example is just showing the usage of "BatchAccount_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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this BatchAccountResource
BatchAccountCollection collection = resourceGroupResource.GetBatchAccounts();
// invoke the operation
string accountName = "sampleacct";
BatchAccountCreateOrUpdateContent content = new BatchAccountCreateOrUpdateContent(new AzureLocation("japaneast"))
{
AutoStorage = new BatchAccountAutoStorageBaseConfiguration(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")),
};
ArmOperation<BatchAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, content);
BatchAccountResource 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
BatchAccountData 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
Sample Response
{
"name": "sampleacct",
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"provisioningState": "Succeeded",
"poolAllocationMode": "BatchService",
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolQuota": 20,
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
"lastKeySync": "2016-03-10T23:48:38.9878479Z"
},
"publicNetworkAccess": "Enabled"
},
"identity": {
"type": "None"
},
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"type": "Microsoft.Batch/batchAccounts"
}
BatchAccountCreate_SystemAssignedIdentity
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-02-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
},
"identity": {
"type": "SystemAssigned"
}
}
import com.azure.resourcemanager.batch.models.AutoStorageBaseProperties;
import com.azure.resourcemanager.batch.models.BatchAccountIdentity;
import com.azure.resourcemanager.batch.models.ResourceIdentityType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for BatchAccount Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/
* BatchAccountCreate_SystemAssignedIdentity.json
*/
/**
* Sample code: BatchAccountCreate_SystemAssignedIdentity.
*
* @param manager Entry point to BatchManager.
*/
public static void batchAccountCreateSystemAssignedIdentity(com.azure.resourcemanager.batch.BatchManager manager) {
manager.batchAccounts().define("sampleacct").withRegion("japaneast")
.withExistingResourceGroup("default-azurebatch-japaneast")
.withIdentity(new BatchAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
.withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python batch_account_create_system_assigned_identity.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="subid",
)
response = client.batch_account.begin_create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
parameters={
"identity": {"type": "SystemAssigned"},
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
},
},
).result()
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_SystemAssignedIdentity.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_SystemAssignedIdentity.json
func ExampleAccountClient_BeginCreate_batchAccountCreateSystemAssignedIdentity() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{
Identity: &armbatch.AccountIdentity{
Type: to.Ptr(armbatch.ResourceIdentityTypeSystemAssigned),
},
Location: to.Ptr("japaneast"),
Properties: &armbatch.AccountCreateProperties{
AutoStorage: &armbatch.AutoStorageBaseProperties{
StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Account = armbatch.Account{
// Name: to.Ptr("sampleacct"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"),
// Location: to.Ptr("japaneast"),
// Identity: &armbatch.AccountIdentity{
// Type: to.Ptr(armbatch.ResourceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("1a2e532b-9900-414c-8600-cfc6126628d7"),
// TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
// },
// Properties: &armbatch.AccountProperties{
// AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"),
// ActiveJobAndJobScheduleQuota: to.Ptr[int32](20),
// AutoStorage: &armbatch.AutoStorageProperties{
// StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
// LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.987Z"); return t}()),
// },
// DedicatedCoreQuota: to.Ptr[int32](20),
// LowPriorityCoreQuota: to.Ptr[int32](20),
// PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService),
// PoolQuota: to.Ptr[int32](20),
// ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled),
// },
// }
}
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 Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
*
* @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_SystemAssignedIdentity.json
*/
async function batchAccountCreateSystemAssignedIdentity() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const parameters = {
autoStorage: {
storageAccountId:
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
},
identity: { type: "SystemAssigned" },
location: "japaneast",
};
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.batchAccountOperations.beginCreateAndWait(
resourceGroupName,
accountName,
parameters,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_SystemAssignedIdentity.json
// this example is just showing the usage of "BatchAccount_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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this BatchAccountResource
BatchAccountCollection collection = resourceGroupResource.GetBatchAccounts();
// invoke the operation
string accountName = "sampleacct";
BatchAccountCreateOrUpdateContent content = new BatchAccountCreateOrUpdateContent(new AzureLocation("japaneast"))
{
Identity = new ManagedServiceIdentity("SystemAssigned"),
AutoStorage = new BatchAccountAutoStorageBaseConfiguration(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")),
};
ArmOperation<BatchAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, content);
BatchAccountResource 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
BatchAccountData 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
Sample Response
{
"name": "sampleacct",
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"provisioningState": "Succeeded",
"poolAllocationMode": "BatchService",
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolQuota": 20,
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
"lastKeySync": "2016-03-10T23:48:38.9878479Z"
},
"publicNetworkAccess": "Enabled"
},
"identity": {
"principalId": "1a2e532b-9900-414c-8600-cfc6126628d7",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd",
"type": "SystemAssigned"
},
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"type": "Microsoft.Batch/batchAccounts"
}
BatchAccountCreate_UserAssignedIdentity
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-02-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
}
}
}
import com.azure.resourcemanager.batch.models.AutoStorageBaseProperties;
import com.azure.resourcemanager.batch.models.BatchAccountIdentity;
import com.azure.resourcemanager.batch.models.ResourceIdentityType;
import com.azure.resourcemanager.batch.models.UserAssignedIdentities;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for BatchAccount Create.
*/
public final class Main {
/*
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/
* BatchAccountCreate_UserAssignedIdentity.json
*/
/**
* Sample code: BatchAccountCreate_UserAssignedIdentity.
*
* @param manager Entry point to BatchManager.
*/
public static void batchAccountCreateUserAssignedIdentity(com.azure.resourcemanager.batch.BatchManager manager) {
manager.batchAccounts().define("sampleacct").withRegion("japaneast")
.withExistingResourceGroup("default-azurebatch-japaneast")
.withIdentity(new BatchAccountIdentity().withType(ResourceIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(mapOf(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1",
new UserAssignedIdentities())))
.withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python batch_account_create_user_assigned_identity.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="subid",
)
response = client.batch_account.begin_create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
},
},
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
},
},
).result()
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_UserAssignedIdentity.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_UserAssignedIdentity.json
func ExampleAccountClient_BeginCreate_batchAccountCreateUserAssignedIdentity() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{
Identity: &armbatch.AccountIdentity{
Type: to.Ptr(armbatch.ResourceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
},
},
Location: to.Ptr("japaneast"),
Properties: &armbatch.AccountCreateProperties{
AutoStorage: &armbatch.AutoStorageBaseProperties{
StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Account = armbatch.Account{
// Name: to.Ptr("sampleacct"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"),
// Location: to.Ptr("japaneast"),
// Identity: &armbatch.AccountIdentity{
// Type: to.Ptr(armbatch.ResourceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{
// "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armbatch.UserAssignedIdentities{
// ClientID: to.Ptr("clientId1"),
// PrincipalID: to.Ptr("principalId1"),
// },
// },
// },
// Properties: &armbatch.AccountProperties{
// AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"),
// ActiveJobAndJobScheduleQuota: to.Ptr[int32](20),
// AutoStorage: &armbatch.AutoStorageProperties{
// StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
// LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.987Z"); return t}()),
// },
// DedicatedCoreQuota: to.Ptr[int32](20),
// LowPriorityCoreQuota: to.Ptr[int32](20),
// PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService),
// PoolQuota: to.Ptr[int32](20),
// ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled),
// },
// }
}
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 Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
*
* @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_UserAssignedIdentity.json
*/
async function batchAccountCreateUserAssignedIdentity() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const parameters = {
autoStorage: {
storageAccountId:
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1":
{},
},
},
location: "japaneast",
};
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.batchAccountOperations.beginCreateAndWait(
resourceGroupName,
accountName,
parameters,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_UserAssignedIdentity.json
// this example is just showing the usage of "BatchAccount_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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this BatchAccountResource
BatchAccountCollection collection = resourceGroupResource.GetBatchAccounts();
// invoke the operation
string accountName = "sampleacct";
BatchAccountCreateOrUpdateContent content = new BatchAccountCreateOrUpdateContent(new AzureLocation("japaneast"))
{
Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
[new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(),
},
},
AutoStorage = new BatchAccountAutoStorageBaseConfiguration(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")),
};
ArmOperation<BatchAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, content);
BatchAccountResource 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
BatchAccountData 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
Sample Response
{
"name": "sampleacct",
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"provisioningState": "Succeeded",
"poolAllocationMode": "BatchService",
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolQuota": 20,
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
"lastKeySync": "2016-03-10T23:48:38.9878479Z"
},
"publicNetworkAccess": "Enabled"
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
"principalId": "principalId1",
"clientId": "clientId1"
}
}
},
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"type": "Microsoft.Batch/batchAccounts"
}
PrivateBatchAccountCreate
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-02-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"keyVaultReference": {
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
},
"publicNetworkAccess": "Disabled"
}
}
import com.azure.resourcemanager.batch.models.AutoStorageBaseProperties;
import com.azure.resourcemanager.batch.models.KeyVaultReference;
import com.azure.resourcemanager.batch.models.PublicNetworkAccessType;
import java.util.HashMap;
import java.util.Map;
/**
* Samples for BatchAccount Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.json
*/
/**
* Sample code: PrivateBatchAccountCreate.
*
* @param manager Entry point to BatchManager.
*/
public static void privateBatchAccountCreate(com.azure.resourcemanager.batch.BatchManager manager) {
manager.batchAccounts().define("sampleacct").withRegion("japaneast")
.withExistingResourceGroup("default-azurebatch-japaneast")
.withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"))
.withKeyVaultReference(new KeyVaultReference().withId(
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample")
.withUrl("http://sample.vault.azure.net/"))
.withPublicNetworkAccess(PublicNetworkAccessType.DISABLED).create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python private_batch_account_create.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="subid",
)
response = client.batch_account.begin_create(
resource_group_name="default-azurebatch-japaneast",
account_name="sampleacct",
parameters={
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"keyVaultReference": {
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/",
},
"publicNetworkAccess": "Disabled",
},
},
).result()
print(response)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.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/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.json
func ExampleAccountClient_BeginCreate_privateBatchAccountCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{
Location: to.Ptr("japaneast"),
Properties: &armbatch.AccountCreateProperties{
AutoStorage: &armbatch.AutoStorageBaseProperties{
StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
},
KeyVaultReference: &armbatch.KeyVaultReference{
ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"),
URL: to.Ptr("http://sample.vault.azure.net/"),
},
PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeDisabled),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Account = armbatch.Account{
// Name: to.Ptr("sampleacct"),
// Type: to.Ptr("Microsoft.Batch/batchAccounts"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"),
// Location: to.Ptr("japaneast"),
// Identity: &armbatch.AccountIdentity{
// Type: to.Ptr(armbatch.ResourceIdentityTypeNone),
// },
// Properties: &armbatch.AccountProperties{
// AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"),
// ActiveJobAndJobScheduleQuota: to.Ptr[int32](20),
// AutoStorage: &armbatch.AutoStorageProperties{
// StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"),
// LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.987Z"); return t}()),
// },
// DedicatedCoreQuota: to.Ptr[int32](20),
// KeyVaultReference: &armbatch.KeyVaultReference{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"),
// URL: to.Ptr("http://sample.vault.azure.net/"),
// },
// LowPriorityCoreQuota: to.Ptr[int32](20),
// PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeUserSubscription),
// PoolQuota: to.Ptr[int32](20),
// ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded),
// PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeDisabled),
// },
// }
}
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 Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
*
* @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.json
*/
async function privateBatchAccountCreate() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast";
const accountName = "sampleacct";
const parameters = {
autoStorage: {
storageAccountId:
"/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
},
keyVaultReference: {
id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
url: "http://sample.vault.azure.net/",
},
location: "japaneast",
publicNetworkAccess: "Disabled",
};
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const result = await client.batchAccountOperations.beginCreateAndWait(
resourceGroupName,
accountName,
parameters,
);
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 System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.json
// this example is just showing the usage of "BatchAccount_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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "default-azurebatch-japaneast";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this BatchAccountResource
BatchAccountCollection collection = resourceGroupResource.GetBatchAccounts();
// invoke the operation
string accountName = "sampleacct";
BatchAccountCreateOrUpdateContent content = new BatchAccountCreateOrUpdateContent(new AzureLocation("japaneast"))
{
AutoStorage = new BatchAccountAutoStorageBaseConfiguration(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")),
KeyVaultReference = new BatchKeyVaultReference(new ResourceIdentifier("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"), new Uri("http://sample.vault.azure.net/")),
PublicNetworkAccess = BatchPublicNetworkAccess.Disabled,
};
ArmOperation<BatchAccountResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, content);
BatchAccountResource 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
BatchAccountData 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
Sample Response
{
"name": "sampleacct",
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"provisioningState": "Succeeded",
"poolAllocationMode": "UserSubscription",
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolQuota": 20,
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage",
"lastKeySync": "2016-03-10T23:48:38.9878479Z"
},
"keyVaultReference": {
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
},
"publicNetworkAccess": "Disabled"
},
"identity": {
"type": "None"
},
"id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"type": "Microsoft.Batch/batchAccounts"
}
Definíciók
AuthenticationMode
A Batch-fiók hitelesítési módja.
Name |
Típus |
Description |
AAD
|
string
|
A hitelesítési mód az Microsoft Entra ID használatával.
|
SharedKey
|
string
|
A hitelesítési mód megosztott kulcsokat használ.
|
TaskAuthenticationToken
|
string
|
A hitelesítési mód feladat-hitelesítési jogkivonatokkal.
|
AutoStorageAuthenticationMode
A Batch szolgáltatás által az automatikus tárfiók kezelésére használt hitelesítési mód.
Name |
Típus |
Description |
BatchAccountManagedIdentity
|
string
|
A Batch szolgáltatás hitelesíti az automatikus tárolásra irányuló kéréseket a Batch-fiókhoz rendelt felügyelt identitással.
|
StorageKeys
|
string
|
A Batch szolgáltatás a tárfiókkulcsok használatával hitelesíti az automatikus tárolásra irányuló kéréseket.
|
AutoStorageBaseProperties
Az automatikus tárfiókhoz kapcsolódó tulajdonságok.
Name |
Típus |
Alapértelmezett érték |
Description |
authenticationMode
|
AutoStorageAuthenticationMode
|
StorageKeys
|
A Batch szolgáltatás által az automatikus tárfiók kezelésére használt hitelesítési mód.
|
nodeIdentityReference
|
ComputeNodeIdentityReference
|
|
A felhasználó által hozzárendelt identitásra mutató hivatkozás, amelyet a számítási csomópontok az automatikus tárolás eléréséhez használnak.
Az itt hivatkozott identitást olyan készletekhez kell hozzárendelni, amelyek olyan számítási csomópontokkal rendelkeznek, amelyeknek hozzá kell férniük az automatikus tároláshoz.
|
storageAccountId
|
string
|
|
Az automatikus tárfiókhoz használandó tárfiók erőforrás-azonosítója.
|
AutoStorageProperties
Információkat tartalmaz a Batch-fiókhoz társított automatikus tárfiókról.
Name |
Típus |
Alapértelmezett érték |
Description |
authenticationMode
|
AutoStorageAuthenticationMode
|
StorageKeys
|
A Batch szolgáltatás által az automatikus tárfiók kezelésére használt hitelesítési mód.
|
lastKeySync
|
string
|
|
A tárkulcsok Batch-fiókkal való utolsó szinkronizálásának UTC-időpontja.
|
nodeIdentityReference
|
ComputeNodeIdentityReference
|
|
A felhasználó által hozzárendelt identitásra mutató hivatkozás, amelyet a számítási csomópontok az automatikus tárolás eléréséhez használnak.
Az itt hivatkozott identitást olyan készletekhez kell hozzárendelni, amelyek olyan számítási csomópontokkal rendelkeznek, amelyeknek hozzá kell férniük az automatikus tároláshoz.
|
storageAccountId
|
string
|
|
Az automatikus tárfiókhoz használandó tárfiók erőforrás-azonosítója.
|
BatchAccount
Egy Azure Batch-fiók adatait tartalmazza.
Name |
Típus |
Alapértelmezett érték |
Description |
id
|
string
|
|
Az erőforrás azonosítója.
|
identity
|
BatchAccountIdentity
|
|
A Batch-fiók identitása.
|
location
|
string
|
|
Az erőforrás helye.
|
name
|
string
|
|
Az erőforrás neve.
|
properties.accountEndpoint
|
string
|
|
A Batch szolgáltatással való interakcióhoz használt fiókvégpont.
|
properties.activeJobAndJobScheduleQuota
|
integer
|
|
A Batch-fiók aktív feladat- és feladatütemezési kvótája.
|
properties.allowedAuthenticationModes
|
AuthenticationMode[]
|
|
Az adatsíkkal történő hitelesítéshez használható Batch-fiók engedélyezett hitelesítési módjainak listája. Ez nincs hatással a vezérlősíkon történő hitelesítésre.
|
properties.autoStorage
|
AutoStorageProperties
|
|
A Batch-fiókhoz társított automatikus tárfiókok tulajdonságai és állapota.
Információkat tartalmaz a Batch-fiókhoz társított automatikus tárfiókról.
|
properties.dedicatedCoreQuota
|
integer
|
|
A Batch-fiók dedikált magkvótája.
A PoolAllocationMode userSubscription értékre beállított fiókok esetében a kvóta kezelése az előfizetésen történik, így a rendszer nem adja vissza ezt az értéket.
|
properties.dedicatedCoreQuotaPerVMFamily
|
VirtualMachineFamilyCoreQuota[]
|
|
A Batch-fiókhoz tartozó virtuálisgép-családonkénti dedikált magkvóta listája. A PoolAllocationMode userSubscription értékre beállított fiókok esetében a kvóta kezelése az előfizetésen történik, így a rendszer nem adja vissza ezt az értéket.
|
properties.dedicatedCoreQuotaPerVMFamilyEnforced
|
boolean
|
|
Egy érték, amely azt jelzi, hogy a virtuálisgép-családonkénti magkvóták kikényszerítve vannak-e ehhez a fiókhoz
Ha ez a jelző igaz, a dedikált magkvóta a fiók dedicatedCoreQuotaPerVMFamily és dedicatedCoreQuota tulajdonságaival is kikényszeríthető. Ha ez a jelző hamis, a dedikált magkvótát csak a fiók dedicatedCoreQuota tulajdonságán keresztül kényszeríti ki a rendszer, és nem veszi figyelembe a virtuálisgép-családot.
|
properties.encryption
|
EncryptionProperties
|
|
A Batch-fiók titkosítási konfigurációja.
Konfigurálja az ügyféladatok Batch-fiókon belüli titkosítását. Alapértelmezés szerint a fiókok titkosítása Microsoft által felügyelt kulccsal történik. A további vezérlés érdekében az ügyfél által felügyelt kulcs használható helyette.
|
properties.keyVaultReference
|
KeyVaultReference
|
|
Hivatkozás a Batch-fiókhoz társított Azure Key Vaultra.
Azonosítja a Batch-fiókhoz társított Azure Key Vaultot.
|
properties.lowPriorityCoreQuota
|
integer
|
|
A Batch-fiók kihasználatlan/alacsony prioritású magkvótája.
A PoolAllocationMode userSubscription értékre beállított fiókok esetében a kvóta kezelése az előfizetésen történik, így a rendszer nem adja vissza ezt az értéket.
|
properties.networkProfile
|
NetworkProfile
|
|
A Batch-fiók hálózati profilja, amely az egyes végpontok hálózati szabálybeállítását tartalmazza.
A hálózati profil csak akkor lép érvénybe, ha a publicNetworkAccess engedélyezve van.
|
properties.nodeManagementEndpoint
|
string
|
|
A számítási csomópont által a Batch-csomópont felügyeleti szolgáltatáshoz való csatlakozáshoz használt végpont.
|
properties.poolAllocationMode
|
PoolAllocationMode
|
|
A Batch-fiókban történő készletlétrehozásához használandó lefoglalási mód.
A készletek Batch-fiókban való létrehozására szolgáló foglalási mód.
|
properties.poolQuota
|
integer
|
|
A Batch-fiók készletkvótája.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
A Batch-fiókhoz társított privát végponti kapcsolatok listája
|
properties.provisioningState
|
ProvisioningState
|
|
Az erőforrás kiépített állapota
|
properties.publicNetworkAccess
|
PublicNetworkAccessType
|
Enabled
|
A hálózati adapter típusa Azure Batch szolgáltatás- és Batch-fiókműveletek eléréséhez.
Ha nincs megadva, az alapértelmezett érték "engedélyezve" lesz.
|
tags
|
object
|
|
Az erőforrás címkéi.
|
type
|
string
|
|
Az erőforrás típusa.
|
BatchAccountCreateParameters
A Létrehozás művelethez megadott paraméterek.
Name |
Típus |
Alapértelmezett érték |
Description |
identity
|
BatchAccountIdentity
|
|
A Batch-fiók identitása.
|
location
|
string
|
|
Az a régió, amelyben létre kívánja hozni a fiókot.
|
properties.allowedAuthenticationModes
|
AuthenticationMode[]
|
|
Az adatsíkkal történő hitelesítéshez használható Batch-fiók engedélyezett hitelesítési módjainak listája. Ez nincs hatással a vezérlősíkon történő hitelesítésre.
|
properties.autoStorage
|
AutoStorageBaseProperties
|
|
Az automatikus tárfiókhoz kapcsolódó tulajdonságok.
|
properties.encryption
|
EncryptionProperties
|
|
A Batch-fiók titkosítási konfigurációja.
Konfigurálja az ügyféladatok Batch-fiókon belüli titkosítását. Alapértelmezés szerint a fiókok titkosítása Microsoft által felügyelt kulccsal történik. A további vezérlés érdekében az ügyfél által felügyelt kulcs használható helyette.
|
properties.keyVaultReference
|
KeyVaultReference
|
|
Hivatkozás a Batch-fiókhoz társított Azure Key Vaultra.
|
properties.networkProfile
|
NetworkProfile
|
|
A Batch-fiók hálózati profilja, amely az egyes végpontok hálózati szabálybeállítását tartalmazza.
A hálózati profil csak akkor lép érvénybe, ha a publicNetworkAccess engedélyezve van.
|
properties.poolAllocationMode
|
PoolAllocationMode
|
|
A Batch-fiókban történő készletlétrehozásához használandó lefoglalási mód.
A készletfoglalási mód azt is befolyásolja, hogy az ügyfelek hogyan hitelesíthetik magukat a Batch Service API-val. Ha a mód BatchService, az ügyfelek hívóbetűkkel vagy Microsoft Entra ID hitelesíthetik magukat. Ha a mód UserSubscription, az ügyfeleknek Microsoft Entra ID kell használniuk. Az alapértelmezett érték a BatchService.
|
properties.publicNetworkAccess
|
PublicNetworkAccessType
|
Enabled
|
A Azure Batch fiók elérésére szolgáló hálózati hozzáférési típus.
Ha nincs megadva, az alapértelmezett érték "engedélyezve" lesz.
|
tags
|
object
|
|
A fiókhoz társított felhasználó által megadott címkék.
|
BatchAccountIdentity
A Batch-fiók identitása, ha konfigurálva van. Ez akkor használatos, ha a felhasználó a "Microsoft.KeyVault" értéket adja meg Batch-fiók titkosítási konfigurációjaként, vagy ha ManagedIdentity
az automatikus tárolási hitelesítési mód van kiválasztva.
Name |
Típus |
Description |
principalId
|
string
|
A Batch-fiók egyszerű azonosítója. Ez a tulajdonság csak a rendszer által hozzárendelt identitáshoz lesz megadva.
|
tenantId
|
string
|
A Batch-fiókhoz társított bérlőazonosító. Ez a tulajdonság csak a rendszer által hozzárendelt identitáshoz lesz megadva.
|
type
|
ResourceIdentityType
|
A Batch-fiókhoz használt identitás típusa.
|
userAssignedIdentities
|
object
|
A Batch-fiókhoz társított felhasználói identitások listája.
|
CloudError
Hibaválasz a Batch szolgáltatástól.
Name |
Típus |
Description |
error
|
CloudErrorBody
|
A hibaválasz törzse.
|
CloudErrorBody
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 hibával kapcsolatos további részletek 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 hibás tulajdonság neve.
|
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.
Name |
Típus |
Description |
resourceId
|
string
|
A felhasználó által hozzárendelt identitás ARM-erőforrás-azonosítója.
|
EncryptionProperties
Konfigurálja az ügyféladatok Batch-fiókon belüli titkosítását. Alapértelmezés szerint a fiókok titkosítása Microsoft által felügyelt kulccsal történik. A további vezérlés érdekében az ügyfél által felügyelt kulcs használható helyette.
Name |
Típus |
Description |
keySource
|
KeySource
|
A kulcsforrás típusa.
|
keyVaultProperties
|
KeyVaultProperties
|
További részletek a Microsoft.KeyVault használatakor
|
EndpointAccessDefaultAction
Az alapértelmezett művelet, ha nincs ipRule-megfeleltetve.
Name |
Típus |
Description |
Allow
|
string
|
Ügyfélhozzáférés engedélyezése.
|
Deny
|
string
|
Ügyfélhozzáférés megtagadása.
|
EndpointAccessProfile
Hálózati hozzáférési profil a Batch-végponthoz.
Name |
Típus |
Description |
defaultAction
|
EndpointAccessDefaultAction
|
Az alapértelmezett művelet, ha nincs ipRule-megfeleltetve.
A végponthoz való hozzáférés alapértelmezett művelete. Csak akkor alkalmazható, ha a publicNetworkAccess engedélyezve van.
|
ipRules
|
IPRule[]
|
Ip-címtartományok tömbje az ügyfél IP-címének szűréséhez.
|
IPRule
Az ügyfél IP-címének szűrésére vonatkozó szabály.
Name |
Típus |
Description |
action
|
IPRuleAction
|
Művelet az ügyfél IP-címének egyeztetésekor.
|
value
|
string
|
A szűrni kívánt IP-cím vagy IP-címtartomány
IPv4-cím vagy CIDR formátumú IPv4-címtartomány.
|
IPRuleAction
Művelet az ügyfél IP-címének egyeztetésekor.
Name |
Típus |
Description |
Allow
|
string
|
Hozzáférés engedélyezése a egyeztetett ügyfél IP-címéhez.
|
KeySource
A kulcsforrás típusa.
Name |
Típus |
Description |
Microsoft.Batch
|
string
|
A Batch létrehozza és kezeli a fiókadatok védelméhez használt titkosítási kulcsokat.
|
Microsoft.KeyVault
|
string
|
A fiókadatok védelméhez használt titkosítási kulcsok egy külső kulcstartóban vannak tárolva. Ha ez be van állítva, akkor a Batch-fiók identitását értékre SystemAssigned kell állítani, és érvényes kulcsazonosítót is meg kell adni a keyVaultProperties alatt.
|
KeyVaultProperties
KeyVault-konfiguráció a Microsoft.KeyVault titkosítási KeySource-jának használatakor.
KeyVaultReference
Azonosítja a Batch-fiókhoz társított Azure Key Vaultot.
Name |
Típus |
Description |
id
|
string
|
A Batch-fiókhoz társított Azure Key Vault erőforrás-azonosítója.
|
url
|
string
|
A Batch-fiókhoz társított Azure Key Vault URL-címe.
|
NetworkProfile
A Batch-fiók hálózati profilja, amely az egyes végpontok hálózati szabálybeállítását tartalmazza.
Name |
Típus |
Description |
accountAccess
|
EndpointAccessProfile
|
Hálózati hozzáférési profil a batchAccount végponthoz (Batch-fiók adatsík API-ja).
|
nodeManagementAccess
|
EndpointAccessProfile
|
Hálózati hozzáférési profil a nodeManagement végponthoz (Batch-szolgáltatás számítási csomópontokat kezel a Batch-készletekhez).
|
PoolAllocationMode
A készletek Batch-fiókban való létrehozására szolgáló foglalási mód.
Name |
Típus |
Description |
BatchService
|
string
|
A készletek a Batch szolgáltatás tulajdonában lévő előfizetésekben lesznek lefoglalva.
|
UserSubscription
|
string
|
A készletek a felhasználó tulajdonában lévő előfizetésben lesznek lefoglalva.
|
PrivateEndpoint
A privát végponti kapcsolat privát végpontja.
Name |
Típus |
Description |
id
|
string
|
A privát végpont ARM-erőforrás-azonosítója. Ez az űrlap /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}.
|
PrivateEndpointConnection
Egy privát kapcsolati erőforrással kapcsolatos információkat tartalmaz.
Name |
Típus |
Description |
etag
|
string
|
Az erőforrás ETagje, amely az egyidejűségi utasításokhoz használatos.
|
id
|
string
|
Az erőforrás azonosítója.
|
name
|
string
|
Az erőforrás neve.
|
properties.groupIds
|
string[]
|
A privát végponti kapcsolat csoportazonosítója.
Az érték egy és csak egy csoportazonosítóval rendelkezik.
|
properties.privateEndpoint
|
PrivateEndpoint
|
A privát végpont ARM-erőforrás-azonosítója.
A privát végponti kapcsolat privát végpontja.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
A privát végponti kapcsolat privát kapcsolati kapcsolati állapota.
A privát végponti kapcsolat privát kapcsolati szolgáltatás kapcsolati állapota
|
properties.provisioningState
|
PrivateEndpointConnectionProvisioningState
|
A privát végponti kapcsolat kiépítési állapota.
|
type
|
string
|
Az erőforrás típusa.
|
PrivateEndpointConnectionProvisioningState
A privát végponti kapcsolat kiépítési állapota.
Name |
Típus |
Description |
Cancelled
|
string
|
A felhasználó megszakította a kapcsolat létrehozását.
|
Creating
|
string
|
A kapcsolat létre van hozva.
|
Deleting
|
string
|
A kapcsolat törölve van.
|
Failed
|
string
|
A felhasználó kérte a kapcsolat frissítését, és sikertelen volt. Újrapróbálkozhat a frissítési művelettel.
|
Succeeded
|
string
|
A kapcsolat állapota végleges, és használatra kész, ha az Állapot jóváhagyva.
|
Updating
|
string
|
A felhasználó kérte a kapcsolat állapotának frissítését, de a frissítési művelet még nem fejeződött be. Előfordulhat, hogy a Batch-fiók csatlakoztatásakor nem hivatkozik a kapcsolatra.
|
PrivateLinkServiceConnectionState
A privát végponti kapcsolat privát kapcsolati szolgáltatás kapcsolati állapota
Name |
Típus |
Description |
actionsRequired
|
string
|
A privát kapcsolat állapotára vonatkozó művelet szükséges
|
description
|
string
|
A privát kapcsolat állapotának leírása
|
status
|
PrivateLinkServiceConnectionStatus
|
A Batch-fiók privát végponti kapcsolatának állapota
|
PrivateLinkServiceConnectionStatus
A Batch privát végpontkapcsolat állapota
Name |
Típus |
Description |
Approved
|
string
|
A privát végponti kapcsolat jóvá van hagyva, és a Batch-fiók elérésére használható
|
Disconnected
|
string
|
A privát végpont kapcsolata megszakadt, és nem használható a Batch-fiók elérésére
|
Pending
|
string
|
A privát végponti kapcsolat függőben van, és nem használható a Batch-fiók elérésére
|
Rejected
|
string
|
A privát végponti kapcsolat elutasítva, és nem használható a Batch-fiók elérésére
|
ProvisioningState
Az erőforrás kiépített állapota
Name |
Típus |
Description |
Cancelled
|
string
|
A fiók utolsó művelete megszakadt.
|
Creating
|
string
|
A fiók létrehozása folyamatban van.
|
Deleting
|
string
|
A fiók törlése folyamatban van.
|
Failed
|
string
|
A fiók utolsó művelete sikertelen.
|
Invalid
|
string
|
A fiók érvénytelen állapotban van.
|
Succeeded
|
string
|
A fiók létrejött, és használatra kész.
|
PublicNetworkAccessType
A Batch-fiók erőforrásain való üzemeltetés hálózati hozzáférési típusa.
Name |
Típus |
Description |
Disabled
|
string
|
Letiltja a nyilvános kapcsolatot, és privát végponti erőforráson keresztül engedélyezi Azure Batch Szolgáltatás privát kapcsolatát.
|
Enabled
|
string
|
Lehetővé teszi a Azure Batch nyilvános DNS-kapcsolaton keresztüli kapcsolódást.
|
ResourceIdentityType
A Batch-fiókhoz használt identitás típusa.
Name |
Típus |
Description |
None
|
string
|
A Batch-fiókhoz nincs identitás társítva. A None frissítési fiók beállítása eltávolítja a meglévő identitásokat.
|
SystemAssigned
|
string
|
A Batch-fiókhoz tartozik egy rendszer által hozzárendelt identitás.
|
UserAssigned
|
string
|
A Batch-fiókhoz felhasználó által hozzárendelt identitások tartoznak.
|
UserAssignedIdentities
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él-azonosítója.
|
principalId
|
string
|
A felhasználó által hozzárendelt identitás egyszerű azonosítója.
|
VirtualMachineFamilyCoreQuota
Egy virtuálisgép-család és a hozzá tartozó magkvóta a Batch-fiókhoz.
Name |
Típus |
Description |
coreQuota
|
integer
|
A Batch-fiók virtuálisgép-családjának magkvótája.
|
name
|
string
|
A virtuális gép családneve.
|