Создает новую учетную запись пакетной службы с указанными параметрами. Существующие учетные записи нельзя обновить с помощью этого API и вместо этого следует обновить с помощью API обновления учетной записи пакетной службы.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}?api-version=2024-07-01
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
accountName
|
path |
True
|
string
minLength: 3 maxLength: 24 pattern: ^[a-z0-9]+$
|
Имя учетной записи пакетной службы, которая должна быть уникальной в пределах региона. Имена учетных записей пакетной службы должны иметь длину от 3 до 24 символов и должны использовать только цифры и строчные буквы. Это имя используется в составе DNS-имени, используемого для доступа к пакетной службе в регионе, в котором создается учетная запись. Например, http://accountname.region.batch.azure.com/.
|
resourceGroupName
|
path |
True
|
string
|
Имя группы ресурсов, содержащей учетную запись пакетной службы.
|
subscriptionId
|
path |
True
|
string
|
Идентификатор подписки Azure. Это строка с форматом GUID (например, 000000000-0000-0000-0000-0000-000000000000000000000)
|
api-version
|
query |
True
|
string
|
Версия API, используемая с HTTP-запросом.
|
Текст запроса
Имя |
Обязательно |
Тип |
Описание |
location
|
True
|
string
|
Регион, в котором создается учетная запись.
|
identity
|
|
BatchAccountIdentity
|
Удостоверение учетной записи пакетной службы.
|
properties.allowedAuthenticationModes
|
|
AuthenticationMode[]
|
Список разрешенных режимов проверки подлинности для учетной записи пакетной службы, которую можно использовать для проверки подлинности с помощью плоскости данных. Это не влияет на проверку подлинности с помощью плоскости управления.
|
properties.autoStorage
|
|
AutoStorageBaseProperties
|
Свойства, связанные с учетной записью автоматического хранения.
|
properties.encryption
|
|
EncryptionProperties
|
Конфигурация шифрования для учетной записи пакетной службы.
Настраивает шифрование данных клиента в учетной записи пакетной службы. По умолчанию учетные записи шифруются с помощью управляемого ключа Майкрософт. Для дополнительного управления вместо этого можно использовать управляемый клиентом ключ.
|
properties.keyVaultReference
|
|
KeyVaultReference
|
Ссылка на хранилище ключей Azure, связанное с учетной записью пакетной службы.
|
properties.networkProfile
|
|
NetworkProfile
|
Сетевой профиль для учетной записи пакетной службы, содержащей параметры сетевого правила для каждой конечной точки.
Сетевой профиль действует только при включении publicNetworkAccess.
|
properties.poolAllocationMode
|
|
PoolAllocationMode
|
Режим выделения, используемый для создания пулов в учетной записи пакетной службы.
Режим выделения пула также влияет на то, как клиенты могут проходить проверку подлинности в API пакетной службы. Если режим — BatchService, клиенты могут пройти проверку подлинности с помощью ключей доступа или идентификатора Microsoft Entra. Если режим — UserSubscription, клиенты должны использовать идентификатор Microsoft Entra. Значением по умолчанию является BatchService.
|
properties.publicNetworkAccess
|
|
PublicNetworkAccessType
|
Тип сетевого доступа для доступа к учетной записи пакетной службы Azure.
Если значение не указано, значение по умолчанию "включено".
|
tags
|
|
object
|
Указанные пользователем теги, связанные с учетной записью.
|
Ответы
Имя |
Тип |
Описание |
200 OK
|
BatchAccount
|
Операция прошла успешно. Ответ содержит сущность учетной записи пакетной службы.
|
202 Accepted
|
|
Операция будет выполнена асинхронно.
Заголовки
- Location: string
- Retry-After: integer
|
Other Status Codes
|
CloudError
|
Ответ на ошибку, описывающий причину сбоя операции.
|
Безопасность
azure_auth
Поток кода проверки подлинности Microsoft Entra OAuth 2.0
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
BatchAccountCreate_BYOS
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-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-07-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-07-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79d9ef3e065f2dcb6bd1db51e29c62a99dff5cb/specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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-07-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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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
Пример ответа
{
"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
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-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-07-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-07-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79d9ef3e065f2dcb6bd1db51e29c62a99dff5cb/specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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-07-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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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
Пример ответа
{
"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
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-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-07-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-07-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79d9ef3e065f2dcb6bd1db51e29c62a99dff5cb/specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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-07-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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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
Пример ответа
{
"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
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-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-07-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-07-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79d9ef3e065f2dcb6bd1db51e29c62a99dff5cb/specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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-07-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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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
Пример ответа
{
"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
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-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-07-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-07-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e79d9ef3e065f2dcb6bd1db51e29c62a99dff5cb/specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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-07-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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Batch;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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
Пример ответа
{
"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"
}
Определения
Имя |
Описание |
AuthenticationMode
|
Режим проверки подлинности для учетной записи пакетной службы.
|
AutoStorageAuthenticationMode
|
Режим проверки подлинности, используемый пакетной службой для управления учетной записью автоматического хранения.
|
AutoStorageBaseProperties
|
Свойства, связанные с учетной записью автоматического хранения.
|
AutoStorageProperties
|
Содержит сведения о учетной записи автоматического хранения, связанной с учетной записью пакетной службы.
|
BatchAccount
|
Содержит сведения о учетной записи пакетной службы Azure.
|
BatchAccountCreateParameters
|
Параметры, предоставленные операции create.
|
BatchAccountIdentity
|
Удостоверение учетной записи пакетной службы, если настроено. Это используется, когда пользователь указывает Microsoft.KeyVault в качестве конфигурации шифрования учетной записи пакетной службы или когда ManagedIdentity выбран в качестве режима проверки подлинности автоматического хранения.
|
CloudError
|
Ответ на ошибку из пакетной службы.
|
CloudErrorBody
|
Ответ на ошибку из пакетной службы.
|
ComputeNodeIdentityReference
|
Ссылка на назначенное пользователем удостоверение, связанное с пулом пакетной службы, который будет использовать вычислительный узел.
|
EncryptionProperties
|
Настраивает шифрование данных клиента в учетной записи пакетной службы. По умолчанию учетные записи шифруются с помощью управляемого ключа Майкрософт. Для дополнительного управления вместо этого можно использовать управляемый клиентом ключ.
|
EndpointAccessDefaultAction
|
Действие по умолчанию при отсутствии сопоставления IPRule.
|
EndpointAccessProfile
|
Профиль сетевого доступа для конечной точки пакетной службы.
|
IPRule
|
Правило фильтрации IP-адреса клиента.
|
IPRuleAction
|
Действие при сопоставлении IP-адреса клиента.
|
KeySource
|
Тип источника ключа.
|
KeyVaultProperties
|
Конфигурация KeyVault при использовании ключа шифрования Microsoft.KeyVault.
|
KeyVaultReference
|
Определяет хранилище ключей Azure, связанное с учетной записью пакетной службы.
|
NetworkProfile
|
Сетевой профиль для учетной записи пакетной службы, содержащей параметры сетевого правила для каждой конечной точки.
|
PoolAllocationMode
|
Режим выделения для создания пулов в учетной записи пакетной службы.
|
PrivateEndpoint
|
Частная конечная точка подключения частной конечной точки.
|
PrivateEndpointConnection
|
Содержит сведения о ресурсе приватного канала.
|
PrivateEndpointConnectionProvisioningState
|
Состояние подготовки подключения к частной конечной точке.
|
PrivateLinkServiceConnectionState
|
Состояние подключения службы приватного канала подключения частной конечной точки
|
PrivateLinkServiceConnectionStatus
|
Состояние подключения частной конечной точки пакетной службы
|
ProvisioningState
|
Подготовленное состояние ресурса
|
PublicNetworkAccessType
|
Тип сетевого доступа для работы с ресурсами в учетной записи пакетной службы.
|
ResourceIdentityType
|
Тип удостоверения, используемого для учетной записи пакетной службы.
|
UserAssignedIdentities
|
Список связанных удостоверений пользователей.
|
VirtualMachineFamilyCoreQuota
|
Семейство виртуальных машин и связанная с ней квота ядра для учетной записи пакетной службы.
|
AuthenticationMode
Перечисление
Режим проверки подлинности для учетной записи пакетной службы.
Значение |
Описание |
AAD
|
Режим проверки подлинности с помощью идентификатора Microsoft Entra.
|
SharedKey
|
Режим проверки подлинности с использованием общих ключей.
|
TaskAuthenticationToken
|
Режим проверки подлинности с помощью маркеров проверки подлинности задач.
|
AutoStorageAuthenticationMode
Перечисление
Режим проверки подлинности, используемый пакетной службой для управления учетной записью автоматического хранения.
Значение |
Описание |
BatchAccountManagedIdentity
|
Пакетная служба будет проходить проверку подлинности запросов к автоматическому хранилищу с помощью управляемого удостоверения, назначенного учетной записи пакетной службы.
|
StorageKeys
|
Пакетная служба будет проходить проверку подлинности запросов к автоматическому хранению с помощью ключей учетной записи хранения.
|
AutoStorageBaseProperties
Object
Свойства, связанные с учетной записью автоматического хранения.
Имя |
Тип |
Default value |
Описание |
authenticationMode
|
AutoStorageAuthenticationMode
|
StorageKeys
|
Режим проверки подлинности, используемый пакетной службой для управления учетной записью автоматического хранения.
|
nodeIdentityReference
|
ComputeNodeIdentityReference
|
|
Ссылка на назначенное пользователем удостоверение, которое вычислительные узлы будут использовать для доступа к автоматическому хранилищу.
Удостоверение, на которое ссылается здесь, должно быть назначено пулам, имеющим вычислительные узлы, которым требуется доступ к автоматическому хранилищу.
|
storageAccountId
|
string
(arm-id)
|
|
Идентификатор ресурса учетной записи хранения, используемой для учетной записи автоматического хранения.
|
AutoStorageProperties
Object
Содержит сведения о учетной записи автоматического хранения, связанной с учетной записью пакетной службы.
Имя |
Тип |
Default value |
Описание |
authenticationMode
|
AutoStorageAuthenticationMode
|
StorageKeys
|
Режим проверки подлинности, используемый пакетной службой для управления учетной записью автоматического хранения.
|
lastKeySync
|
string
(date-time)
|
|
Время в формате UTC, в течение которого ключи хранилища были в последний раз синхронизированы с учетной записью пакетной службы.
|
nodeIdentityReference
|
ComputeNodeIdentityReference
|
|
Ссылка на назначенное пользователем удостоверение, которое вычислительные узлы будут использовать для доступа к автоматическому хранилищу.
Удостоверение, на которое ссылается здесь, должно быть назначено пулам, имеющим вычислительные узлы, которым требуется доступ к автоматическому хранилищу.
|
storageAccountId
|
string
(arm-id)
|
|
Идентификатор ресурса учетной записи хранения, используемой для учетной записи автоматического хранения.
|
BatchAccount
Object
Содержит сведения о учетной записи пакетной службы Azure.
Имя |
Тип |
Default value |
Описание |
id
|
string
|
|
Идентификатор ресурса.
|
identity
|
BatchAccountIdentity
|
|
Удостоверение учетной записи пакетной службы.
|
location
|
string
|
|
Расположение ресурса.
|
name
|
string
|
|
Имя ресурса.
|
properties.accountEndpoint
|
string
|
|
Конечная точка учетной записи, используемая для взаимодействия со службой пакетной службы.
|
properties.activeJobAndJobScheduleQuota
|
integer
(int32)
|
|
Квота активного задания и расписания заданий для учетной записи пакетной службы.
|
properties.allowedAuthenticationModes
|
AuthenticationMode[]
|
|
Список разрешенных режимов проверки подлинности для учетной записи пакетной службы, которую можно использовать для проверки подлинности с помощью плоскости данных. Это не влияет на проверку подлинности с помощью плоскости управления.
|
properties.autoStorage
|
AutoStorageProperties
|
|
Свойства и состояние любой учетной записи автоматического хранения, связанной с учетной записью пакетной службы.
Содержит сведения о учетной записи автоматического хранения, связанной с учетной записью пакетной службы.
|
properties.dedicatedCoreQuota
|
integer
(int32)
|
|
Выделенная квота ядра для учетной записи пакетной службы.
Для учетных записей с пуломAllocationMode, установленного для UserSubscription, квота управляется в подписке, поэтому это значение не возвращается.
|
properties.dedicatedCoreQuotaPerVMFamily
|
VirtualMachineFamilyCoreQuota[]
|
|
Список выделенной квоты ядра для семейства виртуальных машин для учетной записи пакетной службы. Для учетных записей с пуломAllocationMode, установленного для UserSubscription, квота управляется в подписке, поэтому это значение не возвращается.
|
properties.dedicatedCoreQuotaPerVMFamilyEnforced
|
boolean
|
|
Значение, указывающее, применяются ли для этой учетной записи квоты ядра для семейства виртуальных машин.
Если этот флаг имеет значение true, выделенная квота ядра применяется как с помощью свойств dedicatedCoreQuotaPerVMFamily, так и dedicatedCoreQuota в учетной записи. Если этот флаг имеет значение false, выделенная квота ядра применяется только через свойство dedicatedCoreQuota в учетной записи и не учитывает семейство виртуальных машин.
|
properties.encryption
|
EncryptionProperties
|
|
Конфигурация шифрования для учетной записи пакетной службы.
Настраивает шифрование данных клиента в учетной записи пакетной службы. По умолчанию учетные записи шифруются с помощью управляемого ключа Майкрософт. Для дополнительного управления вместо этого можно использовать управляемый клиентом ключ.
|
properties.keyVaultReference
|
KeyVaultReference
|
|
Ссылка на хранилище ключей Azure, связанное с учетной записью пакетной службы.
Определяет хранилище ключей Azure, связанное с учетной записью пакетной службы.
|
properties.lowPriorityCoreQuota
|
integer
(int32)
|
|
Квота основного ядра с низким приоритетом для учетной записи пакетной службы.
Для учетных записей с пуломAllocationMode, установленного для UserSubscription, квота управляется в подписке, поэтому это значение не возвращается.
|
properties.networkProfile
|
NetworkProfile
|
|
Сетевой профиль для учетной записи пакетной службы, содержащей параметры сетевого правила для каждой конечной точки.
Сетевой профиль действует только при включении publicNetworkAccess.
|
properties.nodeManagementEndpoint
|
string
|
|
Конечная точка, используемая вычислительным узлом для подключения к службе управления узлами пакетной службы.
|
properties.poolAllocationMode
|
PoolAllocationMode
|
|
Режим выделения, используемый для создания пулов в учетной записи пакетной службы.
Режим выделения для создания пулов в учетной записи пакетной службы.
|
properties.poolQuota
|
integer
(int32)
|
|
Квота пула для учетной записи пакетной службы.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
Список подключений частной конечной точки, связанных с учетной записью пакетной службы
|
properties.provisioningState
|
ProvisioningState
|
|
Подготовленное состояние ресурса
|
properties.publicNetworkAccess
|
PublicNetworkAccessType
|
Enabled
|
Тип сетевого интерфейса для доступа к службе пакетной службы Azure и операциям учетной записи пакетной службы.
Если значение не указано, значение по умолчанию "включено".
|
tags
|
object
|
|
Теги ресурса.
|
type
|
string
|
|
Тип ресурса.
|
BatchAccountCreateParameters
Object
Параметры, предоставленные операции create.
Имя |
Тип |
Default value |
Описание |
identity
|
BatchAccountIdentity
|
|
Удостоверение учетной записи пакетной службы.
|
location
|
string
|
|
Регион, в котором создается учетная запись.
|
properties.allowedAuthenticationModes
|
AuthenticationMode[]
|
|
Список разрешенных режимов проверки подлинности для учетной записи пакетной службы, которую можно использовать для проверки подлинности с помощью плоскости данных. Это не влияет на проверку подлинности с помощью плоскости управления.
|
properties.autoStorage
|
AutoStorageBaseProperties
|
|
Свойства, связанные с учетной записью автоматического хранения.
|
properties.encryption
|
EncryptionProperties
|
|
Конфигурация шифрования для учетной записи пакетной службы.
Настраивает шифрование данных клиента в учетной записи пакетной службы. По умолчанию учетные записи шифруются с помощью управляемого ключа Майкрософт. Для дополнительного управления вместо этого можно использовать управляемый клиентом ключ.
|
properties.keyVaultReference
|
KeyVaultReference
|
|
Ссылка на хранилище ключей Azure, связанное с учетной записью пакетной службы.
|
properties.networkProfile
|
NetworkProfile
|
|
Сетевой профиль для учетной записи пакетной службы, содержащей параметры сетевого правила для каждой конечной точки.
Сетевой профиль действует только при включении publicNetworkAccess.
|
properties.poolAllocationMode
|
PoolAllocationMode
|
|
Режим выделения, используемый для создания пулов в учетной записи пакетной службы.
Режим выделения пула также влияет на то, как клиенты могут проходить проверку подлинности в API пакетной службы. Если режим — BatchService, клиенты могут пройти проверку подлинности с помощью ключей доступа или идентификатора Microsoft Entra. Если режим — UserSubscription, клиенты должны использовать идентификатор Microsoft Entra. Значением по умолчанию является BatchService.
|
properties.publicNetworkAccess
|
PublicNetworkAccessType
|
Enabled
|
Тип сетевого доступа для доступа к учетной записи пакетной службы Azure.
Если значение не указано, значение по умолчанию "включено".
|
tags
|
object
|
|
Указанные пользователем теги, связанные с учетной записью.
|
BatchAccountIdentity
Object
Удостоверение учетной записи пакетной службы, если настроено. Это используется, когда пользователь указывает Microsoft.KeyVault в качестве конфигурации шифрования учетной записи пакетной службы или когда ManagedIdentity
выбран в качестве режима проверки подлинности автоматического хранения.
Имя |
Тип |
Описание |
principalId
|
string
|
Идентификатор субъекта учетной записи пакетной службы. Это свойство будет предоставлено только для назначаемого системой удостоверения.
|
tenantId
|
string
|
Идентификатор клиента, связанный с учетной записью пакетной службы. Это свойство будет предоставлено только для назначаемого системой удостоверения.
|
type
|
ResourceIdentityType
|
Тип удостоверения, используемого для учетной записи пакетной службы.
|
userAssignedIdentities
|
<string,
UserAssignedIdentities>
|
Список удостоверений пользователей, связанных с учетной записью пакетной службы.
|
CloudError
Object
Ответ на ошибку из пакетной службы.
CloudErrorBody
Object
Ответ на ошибку из пакетной службы.
Имя |
Тип |
Описание |
code
|
string
|
Идентификатор ошибки. Коды являются инвариантными и предназначены для программного использования.
|
details
|
CloudErrorBody[]
|
Список дополнительных сведений об ошибке.
|
message
|
string
|
Сообщение, описывающее ошибку, предназначенное для отображения в пользовательском интерфейсе.
|
target
|
string
|
Целевой объект конкретной ошибки. Например, имя свойства в ошибке.
|
ComputeNodeIdentityReference
Object
Ссылка на назначенное пользователем удостоверение, связанное с пулом пакетной службы, который будет использовать вычислительный узел.
Имя |
Тип |
Описание |
resourceId
|
string
|
Идентификатор ресурса ARM назначенного пользователем удостоверения.
|
EncryptionProperties
Object
Настраивает шифрование данных клиента в учетной записи пакетной службы. По умолчанию учетные записи шифруются с помощью управляемого ключа Майкрософт. Для дополнительного управления вместо этого можно использовать управляемый клиентом ключ.
Имя |
Тип |
Описание |
keySource
|
KeySource
|
Тип источника ключа.
|
keyVaultProperties
|
KeyVaultProperties
|
Дополнительные сведения об использовании Microsoft.KeyVault
|
EndpointAccessDefaultAction
Перечисление
Действие по умолчанию при отсутствии сопоставления IPRule.
Значение |
Описание |
Allow
|
Разрешить клиентский доступ.
|
Deny
|
Запретить доступ к клиенту.
|
EndpointAccessProfile
Object
Профиль сетевого доступа для конечной точки пакетной службы.
Имя |
Тип |
Описание |
defaultAction
|
EndpointAccessDefaultAction
|
Действие по умолчанию при отсутствии сопоставления IPRule.
Действие по умолчанию для доступа к конечной точке. Применимо только при включении publicNetworkAccess.
|
ipRules
|
IPRule[]
|
Массив диапазонов IP-адресов для фильтрации IP-адреса клиента.
|
IPRule
Object
Правило фильтрации IP-адреса клиента.
Имя |
Тип |
Описание |
action
|
IPRuleAction
|
Действие при сопоставлении IP-адреса клиента.
|
value
|
string
|
Диапазон IP-адресов или IP-адресов для фильтрации
IPv4-адрес или диапазон адресов IPv4 в формате CIDR.
|
IPRuleAction
Перечисление
Действие при сопоставлении IP-адреса клиента.
Значение |
Описание |
Allow
|
Разрешить доступ для соответствующего IP-адреса клиента.
|
KeySource
Перечисление
Тип источника ключа.
Значение |
Описание |
Microsoft.Batch
|
Пакетная служба создает ключи шифрования, используемые для защиты данных учетной записи.
|
Microsoft.KeyVault
|
Ключи шифрования, используемые для защиты данных учетной записи, хранятся во внешнем хранилище ключей. Если это задано, удостоверение учетной записи пакетной службы должно иметь значение SystemAssigned , а допустимый идентификатор ключа также должен быть предоставлен в разделе keyVaultProperties.
|
KeyVaultProperties
Object
Конфигурация KeyVault при использовании ключа шифрования Microsoft.KeyVault.
KeyVaultReference
Object
Определяет хранилище ключей Azure, связанное с учетной записью пакетной службы.
Имя |
Тип |
Описание |
id
|
string
(arm-id)
|
Идентификатор ресурса хранилища ключей Azure, связанного с учетной записью пакетной службы.
|
url
|
string
|
URL-адрес хранилища ключей Azure, связанного с учетной записью пакетной службы.
|
NetworkProfile
Object
Сетевой профиль для учетной записи пакетной службы, содержащей параметры сетевого правила для каждой конечной точки.
Имя |
Тип |
Описание |
accountAccess
|
EndpointAccessProfile
|
Профиль сетевого доступа для конечной точки batchAccount (API плоскости данных пакетной службы).
|
nodeManagementAccess
|
EndpointAccessProfile
|
Профиль сетевого доступа для конечной точки nodeManagement (пакетная служба управляет вычислительными узлами для пулов пакетной службы).
|
PoolAllocationMode
Перечисление
Режим выделения для создания пулов в учетной записи пакетной службы.
Значение |
Описание |
BatchService
|
Пулы будут выделены в подписках, принадлежащих пакетной службе.
|
UserSubscription
|
Пулы будут выделены в подписке, принадлежащей пользователю.
|
PrivateEndpoint
Object
Частная конечная точка подключения частной конечной точки.
Имя |
Тип |
Описание |
id
|
string
|
Идентификатор ресурса ARM частной конечной точки. Это форма /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}.
|
PrivateEndpointConnection
Object
Содержит сведения о ресурсе приватного канала.
Имя |
Тип |
Описание |
etag
|
string
|
ETag ресурса, используемый для инструкций параллелизма.
|
id
|
string
|
Идентификатор ресурса.
|
name
|
string
|
Имя ресурса.
|
properties.groupIds
|
string[]
|
Идентификатор группы подключения к частной конечной точке.
Значение имеет один и только один идентификатор группы.
|
properties.privateEndpoint
|
PrivateEndpoint
|
Идентификатор ресурса ARM частной конечной точки.
Частная конечная точка подключения частной конечной точки.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Состояние подключения службы приватного канала для подключения частной конечной точки.
Состояние подключения службы приватного канала подключения частной конечной точки
|
properties.provisioningState
|
PrivateEndpointConnectionProvisioningState
|
Состояние подготовки подключения к частной конечной точке.
|
tags
|
object
|
Теги ресурса.
|
type
|
string
|
Тип ресурса.
|
PrivateEndpointConnectionProvisioningState
Перечисление
Состояние подготовки подключения к частной конечной точке.
Значение |
Описание |
Cancelled
|
Пользователь отменил создание подключения.
|
Creating
|
Соединение создается.
|
Deleting
|
Подключение удаляется.
|
Failed
|
Пользователь попросил обновить подключение и завершиться сбоем. Можно повторить операцию обновления.
|
Succeeded
|
Состояние подключения является окончательным и готово к использованию, если состояние утверждено.
|
Updating
|
Пользователь попросил обновить состояние подключения, но операция обновления еще не завершена. При подключении учетной записи пакетной службы вы не можете ссылать на это подключение.
|
PrivateLinkServiceConnectionState
Object
Состояние подключения службы приватного канала подключения частной конечной точки
Имя |
Тип |
Описание |
actionsRequired
|
string
|
Действие, необходимое для состояния частного подключения
|
description
|
string
|
Описание состояния частного подключения
|
status
|
PrivateLinkServiceConnectionStatus
|
Состояние подключения частной конечной точки учетной записи пакетной службы
|
PrivateLinkServiceConnectionStatus
Перечисление
Состояние подключения частной конечной точки пакетной службы
Значение |
Описание |
Approved
|
Подключение к частной конечной точке утверждено и может использоваться для доступа к учетной записи пакетной службы.
|
Disconnected
|
Подключение к частной конечной точке отключено и не может использоваться для доступа к учетной записи пакетной службы
|
Pending
|
Подключение к частной конечной точке ожидается и не может использоваться для доступа к учетной записи пакетной службы
|
Rejected
|
Подключение к частной конечной точке отклонено и не может использоваться для доступа к учетной записи пакетной службы
|
ProvisioningState
Перечисление
Подготовленное состояние ресурса
Значение |
Описание |
Cancelled
|
Последняя операция для учетной записи отменена.
|
Creating
|
Создается учетная запись.
|
Deleting
|
Учетная запись удаляется.
|
Failed
|
Последняя операция для учетной записи завершается ошибкой.
|
Invalid
|
Учетная запись находится в недопустимом состоянии.
|
Succeeded
|
Учетная запись создана и готова к использованию.
|
PublicNetworkAccessType
Перечисление
Тип сетевого доступа для работы с ресурсами в учетной записи пакетной службы.
Значение |
Описание |
Disabled
|
Отключает общедоступное подключение и включает частное подключение к пакетной службе Azure через ресурс частной конечной точки.
|
Enabled
|
Включает подключение к пакетной службе Azure через общедоступную службу DNS.
|
SecuredByPerimeter
|
Защищает подключение к пакетной службе Azure с помощью конфигурации NSP.
|
ResourceIdentityType
Перечисление
Тип удостоверения, используемого для учетной записи пакетной службы.
Значение |
Описание |
None
|
Учетная запись пакетной службы не связана с ней. Установка None в учетной записи обновления приведет к удалению существующих удостоверений.
|
SystemAssigned
|
У учетной записи пакетной службы есть удостоверение, назначаемое системой.
|
UserAssigned
|
У учетной записи пакетной службы есть удостоверения, назначаемые пользователем.
|
UserAssignedIdentities
Object
Список связанных удостоверений пользователей.
Имя |
Тип |
Описание |
clientId
|
string
|
Идентификатор клиента назначаемого пользователем удостоверения.
|
principalId
|
string
|
Идентификатор субъекта назначаемого пользователем удостоверения.
|
VirtualMachineFamilyCoreQuota
Object
Семейство виртуальных машин и связанная с ней квота ядра для учетной записи пакетной службы.
Имя |
Тип |
Описание |
coreQuota
|
integer
(int32)
|
Базовая квота для семейства виртуальных машин для учетной записи пакетной службы.
|
name
|
string
|
Имя семейства виртуальных машин.
|