Membuat akun Batch baru dengan parameter yang ditentukan. Akun yang ada tidak dapat diperbarui dengan API ini dan sebagai gantinya harus diperbarui dengan API Perbarui Akun Batch.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}?api-version=2024-07-01
Parameter URI
Nama
Dalam
Diperlukan
Jenis
Deskripsi
accountName
path
True
string
minLength: 3 maxLength: 24 pattern: ^[a-z0-9]+$
Nama untuk akun Batch yang harus unik dalam wilayah tersebut. Panjang nama akun batch harus antara 3 dan 24 karakter dan hanya boleh menggunakan angka dan huruf kecil. Nama ini digunakan sebagai bagian dari nama DNS yang digunakan untuk mengakses layanan Batch di wilayah tempat akun dibuat. Misalnya: http://accountname.region.batch.azure.com/.
resourceGroupName
path
True
string
Nama grup sumber daya yang berisi akun Batch.
subscriptionId
path
True
string
ID langganan Azure. Ini adalah string berformat GUID (misalnya 00000000-0000-0000-0000-0000000000000)
api-version
query
True
string
Versi API yang akan digunakan dengan permintaan HTTP.
Daftar mode autentikasi yang diizinkan untuk akun Batch yang dapat digunakan untuk mengautentikasi dengan bidang data. Ini tidak memengaruhi autentikasi dengan sarana kontrol.
Konfigurasi enkripsi untuk akun Batch.
Mengonfigurasi cara data pelanggan dienkripsi di dalam akun Batch. Secara default, akun dienkripsi menggunakan kunci terkelola Microsoft. Untuk kontrol tambahan, kunci yang dikelola pelanggan dapat digunakan sebagai gantinya.
Profil jaringan untuk akun Batch, yang berisi pengaturan aturan jaringan untuk setiap titik akhir.
Profil jaringan hanya berlaku ketika publicNetworkAccess diaktifkan.
Mode alokasi yang digunakan untuk membuat kumpulan di akun Batch.
Mode alokasi kumpulan juga memengaruhi bagaimana klien dapat mengautentikasi ke API Layanan Batch. Jika modenya adalah BatchService, klien dapat mengautentikasi menggunakan kunci akses atau ID Microsoft Entra. Jika modenya adalah UserSubscription, klien harus menggunakan ID Microsoft Entra. Defaultnya adalah BatchService.
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()
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);
}
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}");
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()
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);
}
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}");
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()
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);
}
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}");
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()
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);
}
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}");
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()
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);
}
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}");
Identitas akun Batch, jika dikonfigurasi. Ini digunakan ketika pengguna menentukan 'Microsoft.KeyVault' sebagai konfigurasi enkripsi akun Batch mereka atau ketika ManagedIdentity dipilih sebagai mode autentikasi penyimpanan otomatis.
Mengonfigurasi cara data pelanggan dienkripsi di dalam akun Batch. Secara default, akun dienkripsi menggunakan kunci terkelola Microsoft. Untuk kontrol tambahan, kunci yang dikelola pelanggan dapat digunakan sebagai gantinya.
Referensi ke identitas yang ditetapkan pengguna yang akan digunakan simpul komputasi untuk mengakses penyimpanan otomatis.
Identitas yang direferensikan di sini harus ditetapkan ke kumpulan yang memiliki simpul komputasi yang memerlukan akses ke penyimpanan otomatis.
storageAccountId
string
(arm-id)
ID sumber daya akun penyimpanan yang akan digunakan untuk akun penyimpanan otomatis.
AutoStorageProperties
Objek
Berisi informasi tentang akun penyimpanan otomatis yang terkait dengan akun Batch.
Referensi ke identitas yang ditetapkan pengguna yang akan digunakan simpul komputasi untuk mengakses penyimpanan otomatis.
Identitas yang direferensikan di sini harus ditetapkan ke kumpulan yang memiliki simpul komputasi yang memerlukan akses ke penyimpanan otomatis.
storageAccountId
string
(arm-id)
ID sumber daya akun penyimpanan yang akan digunakan untuk akun penyimpanan otomatis.
Daftar mode autentikasi yang diizinkan untuk akun Batch yang dapat digunakan untuk mengautentikasi dengan bidang data. Ini tidak memengaruhi autentikasi dengan sarana kontrol.
Properti dan status akun penyimpanan otomatis apa pun yang terkait dengan akun Batch.
Berisi informasi tentang akun penyimpanan otomatis yang terkait dengan akun Batch.
properties.dedicatedCoreQuota
integer
(int32)
Kuota inti khusus untuk akun Batch.
Untuk akun dengan PoolAllocationMode yang diatur ke UserSubscription, kuota dikelola pada langganan sehingga nilai ini tidak dikembalikan.
Daftar kuota inti khusus per keluarga Komputer Virtual untuk akun Batch. Untuk akun dengan PoolAllocationMode yang diatur ke UserSubscription, kuota dikelola pada langganan sehingga nilai ini tidak dikembalikan.
properties.dedicatedCoreQuotaPerVMFamilyEnforced
boolean
Nilai yang menunjukkan apakah kuota inti per keluarga Komputer Virtual diberlakukan untuk akun ini
Jika bendera ini benar, kuota inti khusus diberlakukan melalui properti dedicatedCoreQuotaPerVMFamily dan dedicatedCoreQuota pada akun. Jika bendera ini salah, kuota inti khusus hanya diberlakukan melalui properti dedicatedCoreQuota pada akun dan tidak mempertimbangkan keluarga Komputer Virtual.
Konfigurasi enkripsi untuk akun Batch.
Mengonfigurasi cara data pelanggan dienkripsi di dalam akun Batch. Secara default, akun dienkripsi menggunakan kunci terkelola Microsoft. Untuk kontrol tambahan, kunci yang dikelola pelanggan dapat digunakan sebagai gantinya.
Referensi ke brankas kunci Azure yang terkait dengan akun Batch.
Mengidentifikasi brankas kunci Azure yang terkait dengan akun Batch.
properties.lowPriorityCoreQuota
integer
(int32)
Kuota inti Spot/berprioritas rendah untuk akun Batch.
Untuk akun dengan PoolAllocationMode yang diatur ke UserSubscription, kuota dikelola pada langganan sehingga nilai ini tidak dikembalikan.
Profil jaringan untuk akun Batch, yang berisi pengaturan aturan jaringan untuk setiap titik akhir.
Profil jaringan hanya berlaku ketika publicNetworkAccess diaktifkan.
properties.nodeManagementEndpoint
string
Titik akhir yang digunakan oleh simpul komputasi untuk menyambungkan ke layanan manajemen simpul Batch.
Daftar mode autentikasi yang diizinkan untuk akun Batch yang dapat digunakan untuk mengautentikasi dengan bidang data. Ini tidak memengaruhi autentikasi dengan sarana kontrol.
Konfigurasi enkripsi untuk akun Batch.
Mengonfigurasi cara data pelanggan dienkripsi di dalam akun Batch. Secara default, akun dienkripsi menggunakan kunci terkelola Microsoft. Untuk kontrol tambahan, kunci yang dikelola pelanggan dapat digunakan sebagai gantinya.
Profil jaringan untuk akun Batch, yang berisi pengaturan aturan jaringan untuk setiap titik akhir.
Profil jaringan hanya berlaku ketika publicNetworkAccess diaktifkan.
Mode alokasi yang digunakan untuk membuat kumpulan di akun Batch.
Mode alokasi kumpulan juga memengaruhi bagaimana klien dapat mengautentikasi ke API Layanan Batch. Jika modenya adalah BatchService, klien dapat mengautentikasi menggunakan kunci akses atau ID Microsoft Entra. Jika modenya adalah UserSubscription, klien harus menggunakan ID Microsoft Entra. Defaultnya adalah BatchService.
Jenis akses jaringan untuk mengakses akun Azure Batch.
Jika tidak ditentukan, nilai defaultnya adalah 'diaktifkan'.
tags
object
Tag yang ditentukan pengguna yang terkait dengan akun.
BatchAccountIdentity
Objek
Identitas akun Batch, jika dikonfigurasi. Ini digunakan ketika pengguna menentukan 'Microsoft.KeyVault' sebagai konfigurasi enkripsi akun Batch mereka atau ketika ManagedIdentity dipilih sebagai mode autentikasi penyimpanan otomatis.
Nama
Jenis
Deskripsi
principalId
string
Id utama akun Batch. Properti ini hanya akan disediakan untuk identitas yang ditetapkan sistem.
tenantId
string
Id penyewa yang terkait dengan akun Batch. Properti ini hanya akan disediakan untuk identitas yang ditetapkan sistem.
Pesan yang menjelaskan kesalahan, dimaksudkan agar cocok untuk ditampilkan di antarmuka pengguna.
target
string
Target kesalahan tertentu. Misalnya, nama properti dalam kesalahan.
ComputeNodeIdentityReference
Objek
Referensi ke identitas yang ditetapkan pengguna yang terkait dengan kumpulan Batch yang akan digunakan simpul komputasi.
Nama
Jenis
Deskripsi
resourceId
string
Id sumber daya ARM dari identitas yang ditetapkan pengguna.
EncryptionProperties
Objek
Mengonfigurasi cara data pelanggan dienkripsi di dalam akun Batch. Secara default, akun dienkripsi menggunakan kunci terkelola Microsoft. Untuk kontrol tambahan, kunci yang dikelola pelanggan dapat digunakan sebagai gantinya.
Tindakan default ketika tidak ada IPRule yang cocok.
Tindakan default untuk akses titik akhir. Ini hanya berlaku ketika publicNetworkAccess diaktifkan.
Alamat IP atau rentang alamat IP untuk difilter
Alamat IPv4, atau rentang alamat IPv4 dalam format CIDR.
IPRuleAction
Enumeration
Tindakan saat alamat IP klien cocok.
Nilai
Deskripsi
Allow
Izinkan akses untuk alamat IP klien yang cocok.
KeySource
Enumeration
Jenis sumber kunci.
Nilai
Deskripsi
Microsoft.Batch
Batch membuat dan mengelola kunci enkripsi yang digunakan untuk melindungi data akun.
Microsoft.KeyVault
Kunci enkripsi yang digunakan untuk melindungi data akun disimpan dalam brankas kunci eksternal. Jika ini diatur, identitas Akun Batch harus diatur ke SystemAssigned dan Pengidentifikasi Kunci yang valid juga harus disediakan di bawah keyVaultProperties.
KeyVaultProperties
Objek
Konfigurasi KeyVault saat menggunakan KeySource enkripsi Microsoft.KeyVault.
Akun Batch memiliki identitas yang Ditetapkan Sistem Identitas akun telah diberikan izin Kunci/Dapatkan, Kunci/Buka Bungkus dan Kunci/Bungkus KeyVault mengaktifkan penghapusan sementara dan perlindungan penghapusan menyeluruh
KeyVaultReference
Objek
Mengidentifikasi brankas kunci Azure yang terkait dengan akun Batch.
Nama
Jenis
Deskripsi
id
string
(arm-id)
ID sumber daya brankas kunci Azure yang terkait dengan akun Batch.
url
string
URL brankas kunci Azure yang terkait dengan akun Batch.
NetworkProfile
Objek
Profil jaringan untuk akun Batch, yang berisi pengaturan aturan jaringan untuk setiap titik akhir.
Profil akses jaringan untuk titik akhir nodeManagement (layanan Batch mengelola simpul komputasi untuk kumpulan Batch).
PoolAllocationMode
Enumeration
Mode alokasi untuk membuat kumpulan di akun Batch.
Nilai
Deskripsi
BatchService
Kumpulan akan dialokasikan dalam langganan yang dimiliki oleh layanan Batch.
UserSubscription
Kumpulan akan dialokasikan dalam langganan yang dimiliki oleh pengguna.
PrivateEndpoint
Objek
Titik akhir privat koneksi titik akhir privat.
Nama
Jenis
Deskripsi
id
string
Pengidentifikasi sumber daya ARM dari titik akhir privat. Ini adalah formulir /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}.
PrivateEndpointConnection
Objek
Berisi informasi tentang sumber daya tautan privat.
Nama
Jenis
Deskripsi
etag
string
ETag sumber daya, digunakan untuk pernyataan konkurensi.
id
string
ID sumber daya.
name
string
Nama sumber daya.
properties.groupIds
string[]
Id grup koneksi titik akhir privat.
Nilai memiliki satu dan hanya satu id grup.
Pengguna meminta agar koneksi diperbarui dan gagal. Anda dapat mencoba kembali operasi pembaruan.
Succeeded
Status koneksi bersifat final dan siap digunakan jika Status Disetujui.
Updating
Pengguna telah meminta agar status koneksi diperbarui, tetapi operasi pembaruan belum selesai. Anda mungkin tidak mereferensikan koneksi saat menyambungkan akun Batch.
PrivateLinkServiceConnectionState
Objek
Status koneksi layanan tautan privat dari koneksi titik akhir privat
Nama
Jenis
Deskripsi
actionsRequired
string
Tindakan yang diperlukan pada status koneksi privat