Tworzy nowe konto usługi Batch z określonymi parametrami. Nie można zaktualizować istniejących kont przy użyciu tego interfejsu API i zamiast tego należy je zaktualizować przy użyciu interfejsu API aktualizacji konta usługi Batch.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}?api-version=2024-07-01
Parametry URI
| Nazwa |
W |
Wymagane |
Typ |
Opis |
|
accountName
|
path |
True
|
string
minLength: 3 maxLength: 24 pattern: ^[a-zA-Z0-9]+$
|
Nazwa konta usługi Batch, które musi być unikatowe w obrębie regionu. Nazwy kont usługi Batch muszą mieć długość od 3 do 24 znaków i muszą używać tylko cyfr i małych liter. Ta nazwa jest używana jako część nazwy DNS używanej do uzyskiwania dostępu do usługi Batch w regionie, w którym jest tworzone konto. Na przykład: http://accountname.region.batch.azure.com/.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nazwa grupy zasobów. Nazwa jest niewrażliwa na wielkość liter.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Identyfikator subskrypcji docelowej. Wartość musi być identyfikatorem UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Wersja interfejsu API do użycia dla tej operacji.
|
Ciało żądania
| Nazwa |
Wymagane |
Typ |
Opis |
|
location
|
True
|
string
|
Region, w którym ma zostać utworzone konto.
|
|
identity
|
|
BatchAccountIdentity
|
Tożsamość konta usługi Batch.
|
|
properties.allowedAuthenticationModes
|
|
AuthenticationMode[]
|
Lista dozwolonych trybów uwierzytelniania dla konta usługi Batch, których można użyć do uwierzytelniania za pomocą płaszczyzny danych. Nie ma to wpływu na uwierzytelnianie za pomocą płaszczyzny sterowania.
|
|
properties.autoStorage
|
|
AutoStorageBaseProperties
|
Właściwości związane z kontem automatycznego magazynu.
|
|
properties.encryption
|
|
EncryptionProperties
|
Konfiguracja szyfrowania dla konta usługi Batch.
Konfiguruje sposób szyfrowania danych klienta wewnątrz konta usługi Batch. Domyślnie konta są szyfrowane przy użyciu klucza zarządzanego przez firmę Microsoft. Aby uzyskać dodatkową kontrolę, można zamiast tego użyć klucza zarządzanego przez klienta.
|
|
properties.keyVaultReference
|
|
KeyVaultReference
|
Odwołanie do magazynu kluczy platformy Azure skojarzonego z kontem usługi Batch.
|
|
properties.networkProfile
|
|
NetworkProfile
|
Profil sieciowy dla konta usługi Batch, który zawiera ustawienia reguły sieciowej dla każdego punktu końcowego.
Profil sieciowy ma zastosowanie tylko wtedy, gdy funkcja publicNetworkAccess jest włączona.
|
|
properties.poolAllocationMode
|
|
PoolAllocationMode
|
Tryb alokacji używany do tworzenia pul na koncie usługi Batch.
Tryb alokacji puli wpływa również na sposób uwierzytelniania klientów w interfejsie API usługi Batch. Jeśli tryb to BatchService, klienci mogą uwierzytelniać się przy użyciu kluczy dostępu lub identyfikatora Entra firmy Microsoft. Jeśli tryb to UserSubscription, klienci muszą używać identyfikatora Entra firmy Microsoft. Wartość domyślna to BatchService.
|
|
properties.publicNetworkAccess
|
|
PublicNetworkAccessType
|
Typ dostępu do sieci na potrzeby uzyskiwania dostępu do konta usługi Azure Batch.
Typ dostępu do sieci dla operacji na zasobach na koncie usługi Batch.
|
|
tags
|
|
object
|
Tagi określone przez użytkownika skojarzone z kontem.
|
Odpowiedzi
| Nazwa |
Typ |
Opis |
|
200 OK
|
BatchAccount
|
Aktualizacja zasobu 'BatchAccount' zakończyła się sukcesem
|
|
202 Accepted
|
|
Zaakceptowano operację zasobu.
Nagłówki
- Location: string
- Retry-After: integer
|
|
Other Status Codes
|
CloudError
|
Nieoczekiwana odpowiedź na błąd.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 w usłudze Azure Active Directory.
Typ:
oauth2
Flow:
implicit
URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresów
| Nazwa |
Opis |
|
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
BatchAccountCreate_BYOS
Przykładowa prośba
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"keyVaultReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
},
"poolAllocationMode": "UserSubscription"
}
}
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
Przykładowa odpowiedź
{
"name": "sampleacct",
"type": "Microsoft.Batch/batchAccounts",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"identity": {
"type": "None"
},
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"lastKeySync": "2016-03-10T23:48:38.9878479Z",
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"dedicatedCoreQuota": 20,
"keyVaultReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
},
"lowPriorityCoreQuota": 20,
"poolAllocationMode": "UserSubscription",
"poolQuota": 20,
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
}
}
BatchAccountCreate_Default
Przykładowa prośba
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/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
Przykładowa odpowiedź
{
"name": "sampleacct",
"type": "Microsoft.Batch/batchAccounts",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"identity": {
"type": "None"
},
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"lastKeySync": "2016-03-10T23:48:38.9878479Z",
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolAllocationMode": "BatchService",
"poolQuota": 20,
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
}
}
BatchAccountCreate_SystemAssignedIdentity
Przykładowa prośba
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-01
{
"identity": {
"type": "SystemAssigned"
},
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
}
}
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
Przykładowa odpowiedź
{
"name": "sampleacct",
"type": "Microsoft.Batch/batchAccounts",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"identity": {
"type": "SystemAssigned",
"principalId": "1a2e532b-9900-414c-8600-cfc6126628d7",
"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd"
},
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"lastKeySync": "2016-03-10T23:48:38.9878479Z",
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolAllocationMode": "BatchService",
"poolQuota": 20,
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
}
}
BatchAccountCreate_UserAssignedIdentity
Przykładowa prośba
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-01
{
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
}
},
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
}
}
}
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
Przykładowa odpowiedź
{
"name": "sampleacct",
"type": "Microsoft.Batch/batchAccounts",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
"clientId": "clientId1",
"principalId": "principalId1"
}
}
},
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"lastKeySync": "2016-03-10T23:48:38.9878479Z",
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"dedicatedCoreQuota": 20,
"lowPriorityCoreQuota": 20,
"poolAllocationMode": "BatchService",
"poolQuota": 20,
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled"
}
}
PrivateBatchAccountCreate
Przykładowa prośba
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct?api-version=2024-07-01
{
"location": "japaneast",
"properties": {
"autoStorage": {
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"keyVaultReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/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
Przykładowa odpowiedź
{
"name": "sampleacct",
"type": "Microsoft.Batch/batchAccounts",
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct",
"identity": {
"type": "None"
},
"location": "japaneast",
"properties": {
"accountEndpoint": "sampleacct.japaneast.batch.azure.com",
"activeJobAndJobScheduleQuota": 20,
"autoStorage": {
"lastKeySync": "2016-03-10T23:48:38.9878479Z",
"storageAccountId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
},
"dedicatedCoreQuota": 20,
"keyVaultReference": {
"id": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
"url": "http://sample.vault.azure.net/"
},
"lowPriorityCoreQuota": 20,
"poolAllocationMode": "UserSubscription",
"poolQuota": 20,
"provisioningState": "Succeeded",
"publicNetworkAccess": "Disabled"
}
}
Definicje
AuthenticationMode
Wyliczenie
Tryb uwierzytelniania dla konta usługi Batch.
| Wartość |
Opis |
|
SharedKey
|
Tryb uwierzytelniania przy użyciu kluczy udostępnionych.
|
|
AAD
|
Tryb uwierzytelniania przy użyciu identyfikatora Entra firmy Microsoft.
|
|
TaskAuthenticationToken
|
Tryb uwierzytelniania przy użyciu tokenów uwierzytelniania zadań.
|
AutoStorageAuthenticationMode
Wyliczenie
Tryb uwierzytelniania używany przez usługę Batch do zarządzania kontem automatycznego magazynu.
| Wartość |
Opis |
|
StorageKeys
|
Usługa Batch będzie uwierzytelniać żądania do automatycznego magazynu przy użyciu kluczy konta magazynu.
|
|
BatchAccountManagedIdentity
|
Usługa Batch uwierzytelni żądania do automatycznego magazynu przy użyciu tożsamości zarządzanej przypisanej do konta usługi Batch.
|
AutoStorageBaseProperties
Sprzeciwiać się
Właściwości związane z kontem automatycznego magazynu.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
authenticationMode
|
AutoStorageAuthenticationMode
|
StorageKeys
|
Tryb uwierzytelniania używany przez usługę Batch do zarządzania kontem automatycznego magazynu.
|
|
nodeIdentityReference
|
ComputeNodeIdentityReference
|
|
Odwołanie do tożsamości przypisanej przez użytkownika, której węzły obliczeniowe będą używać do uzyskiwania dostępu do automatycznego magazynu.
Tożsamość, do której odwołuje się tutaj, musi być przypisana do pul, które mają węzły obliczeniowe wymagające dostępu do automatycznego magazynu.
|
|
storageAccountId
|
string
(arm-id)
|
|
Identyfikator zasobu konta magazynu, który ma być używany dla konta magazynu automatycznego.
|
AutoStorageProperties
Sprzeciwiać się
Zawiera informacje o koncie automatycznego magazynu skojarzonego z kontem usługi Batch.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
authenticationMode
|
AutoStorageAuthenticationMode
|
StorageKeys
|
Tryb uwierzytelniania używany przez usługę Batch do zarządzania kontem automatycznego magazynu.
|
|
lastKeySync
|
string
(date-time)
|
|
Godzina UTC, o której klucze magazynu zostały ostatnio zsynchronizowane z kontem usługi Batch.
|
|
nodeIdentityReference
|
ComputeNodeIdentityReference
|
|
Odwołanie do tożsamości przypisanej przez użytkownika, której węzły obliczeniowe będą używać do uzyskiwania dostępu do automatycznego magazynu.
Tożsamość, do której odwołuje się tutaj, musi być przypisana do pul, które mają węzły obliczeniowe wymagające dostępu do automatycznego magazynu.
|
|
storageAccountId
|
string
(arm-id)
|
|
Identyfikator zasobu konta magazynu, który ma być używany dla konta magazynu automatycznego.
|
BatchAccount
Sprzeciwiać się
Zawiera informacje o koncie usługi Azure Batch.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
id
|
string
(arm-id)
|
|
W pełni kwalifikowany identyfikator zasobu dla zasobu. Np. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
identity
|
BatchAccountIdentity
|
|
Tożsamość konta usługi Batch.
|
|
location
|
string
|
|
Lokalizacja geograficzna, w której znajduje się zasób
|
|
name
|
string
|
|
Nazwa zasobu
|
|
properties.accountEndpoint
|
string
|
|
Punkt końcowy konta używany do interakcji z usługą Batch.
|
|
properties.activeJobAndJobScheduleQuota
|
integer
(int32)
|
|
Aktywny limit przydziału zadania i harmonogramu zadań dla konta usługi Batch.
|
|
properties.allowedAuthenticationModes
|
AuthenticationMode[]
|
|
Lista dozwolonych trybów uwierzytelniania dla konta usługi Batch, których można użyć do uwierzytelniania za pomocą płaszczyzny danych. Nie ma to wpływu na uwierzytelnianie za pomocą płaszczyzny sterowania.
|
|
properties.autoStorage
|
AutoStorageProperties
|
|
Właściwości i stan dowolnego konta automatycznego magazynu skojarzonego z kontem usługi Batch.
Zawiera informacje o koncie automatycznego magazynu skojarzonego z kontem usługi Batch.
|
|
properties.dedicatedCoreQuota
|
integer
(int32)
|
|
Dedykowany limit przydziału rdzeni dla konta usługi Batch.
W przypadku kont z wartością PoolAllocationMode ustawioną na UserSubscription limit przydziału jest zarządzany w ramach subskrypcji, więc ta wartość nie jest zwracana.
|
|
properties.dedicatedCoreQuotaPerVMFamily
|
VirtualMachineFamilyCoreQuota[]
|
|
Lista dedykowanych przydziałów rdzeni dla rodziny maszyn wirtualnych dla konta usługi Batch. W przypadku kont z wartością PoolAllocationMode ustawioną na UserSubscription limit przydziału jest zarządzany w ramach subskrypcji, więc ta wartość nie jest zwracana.
|
|
properties.dedicatedCoreQuotaPerVMFamilyEnforced
|
boolean
|
|
Wartość wskazująca, czy limity przydziału rdzeni dla rodziny maszyn wirtualnych są wymuszane dla tego konta
Jeśli ta flaga ma wartość true, dedykowany limit przydziału rdzeni jest wymuszany za pośrednictwem właściwości dedicatedCoreQuotaPerVMFamily i dedicatedCoreQuota na koncie. Jeśli ta flaga ma wartość false, dedykowany limit przydziału rdzeni jest wymuszany tylko za pośrednictwem właściwości dedicatedCoreQuota na koncie i nie uwzględnia rodziny maszyn wirtualnych.
|
|
properties.encryption
|
EncryptionProperties
|
|
Konfiguracja szyfrowania dla konta usługi Batch.
Konfiguruje sposób szyfrowania danych klienta wewnątrz konta usługi Batch. Domyślnie konta są szyfrowane przy użyciu klucza zarządzanego przez firmę Microsoft. Aby uzyskać dodatkową kontrolę, można zamiast tego użyć klucza zarządzanego przez klienta.
|
|
properties.keyVaultReference
|
KeyVaultReference
|
|
Odwołanie do magazynu kluczy platformy Azure skojarzonego z kontem usługi Batch.
Identyfikuje magazyn kluczy platformy Azure skojarzony z kontem usługi Batch.
|
|
properties.lowPriorityCoreQuota
|
integer
(int32)
|
|
Limit przydziału rdzeni typu spot/low-priority dla konta usługi Batch.
W przypadku kont z wartością PoolAllocationMode ustawioną na UserSubscription limit przydziału jest zarządzany w ramach subskrypcji, więc ta wartość nie jest zwracana.
|
|
properties.networkProfile
|
NetworkProfile
|
|
Profil sieciowy dla konta usługi Batch, który zawiera ustawienia reguły sieciowej dla każdego punktu końcowego.
Profil sieciowy ma zastosowanie tylko wtedy, gdy funkcja publicNetworkAccess jest włączona.
|
|
properties.nodeManagementEndpoint
|
string
|
|
Punkt końcowy używany przez węzeł obliczeniowy do nawiązywania połączenia z usługą zarządzania węzłami usługi Batch.
|
|
properties.poolAllocationMode
|
PoolAllocationMode
|
|
Tryb alokacji używany do tworzenia pul na koncie usługi Batch.
Tryb alokacji do tworzenia pul na koncie usługi Batch.
|
|
properties.poolQuota
|
integer
(int32)
|
|
Limit przydziału puli dla konta usługi Batch.
|
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
|
Lista połączeń prywatnych punktów końcowych skojarzonych z kontem usługi Batch
|
|
properties.provisioningState
|
ProvisioningState
|
|
Stan aprowizacji zasobu
|
|
properties.publicNetworkAccess
|
PublicNetworkAccessType
|
Enabled
|
Typ interfejsu sieciowego na potrzeby uzyskiwania dostępu do usługi Azure Batch i operacji konta usługi Batch.
Typ dostępu do sieci dla operacji na zasobach na koncie usługi Batch.
|
|
systemData
|
systemData
|
|
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
|
|
tags
|
object
|
|
Tagi zasobów.
|
|
type
|
string
|
|
Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"
|
BatchAccountCreateParameters
Sprzeciwiać się
Parametry dostarczone do operacji Tworzenia.
| Nazwa |
Typ |
Wartość domyślna |
Opis |
|
identity
|
BatchAccountIdentity
|
|
Tożsamość konta usługi Batch.
|
|
location
|
string
|
|
Region, w którym ma zostać utworzone konto.
|
|
properties.allowedAuthenticationModes
|
AuthenticationMode[]
|
|
Lista dozwolonych trybów uwierzytelniania dla konta usługi Batch, których można użyć do uwierzytelniania za pomocą płaszczyzny danych. Nie ma to wpływu na uwierzytelnianie za pomocą płaszczyzny sterowania.
|
|
properties.autoStorage
|
AutoStorageBaseProperties
|
|
Właściwości związane z kontem automatycznego magazynu.
|
|
properties.encryption
|
EncryptionProperties
|
|
Konfiguracja szyfrowania dla konta usługi Batch.
Konfiguruje sposób szyfrowania danych klienta wewnątrz konta usługi Batch. Domyślnie konta są szyfrowane przy użyciu klucza zarządzanego przez firmę Microsoft. Aby uzyskać dodatkową kontrolę, można zamiast tego użyć klucza zarządzanego przez klienta.
|
|
properties.keyVaultReference
|
KeyVaultReference
|
|
Odwołanie do magazynu kluczy platformy Azure skojarzonego z kontem usługi Batch.
|
|
properties.networkProfile
|
NetworkProfile
|
|
Profil sieciowy dla konta usługi Batch, który zawiera ustawienia reguły sieciowej dla każdego punktu końcowego.
Profil sieciowy ma zastosowanie tylko wtedy, gdy funkcja publicNetworkAccess jest włączona.
|
|
properties.poolAllocationMode
|
PoolAllocationMode
|
|
Tryb alokacji używany do tworzenia pul na koncie usługi Batch.
Tryb alokacji puli wpływa również na sposób uwierzytelniania klientów w interfejsie API usługi Batch. Jeśli tryb to BatchService, klienci mogą uwierzytelniać się przy użyciu kluczy dostępu lub identyfikatora Entra firmy Microsoft. Jeśli tryb to UserSubscription, klienci muszą używać identyfikatora Entra firmy Microsoft. Wartość domyślna to BatchService.
|
|
properties.publicNetworkAccess
|
PublicNetworkAccessType
|
Enabled
|
Typ dostępu do sieci na potrzeby uzyskiwania dostępu do konta usługi Azure Batch.
Typ dostępu do sieci dla operacji na zasobach na koncie usługi Batch.
|
|
tags
|
object
|
|
Tagi określone przez użytkownika skojarzone z kontem.
|
BatchAccountIdentity
Sprzeciwiać się
Tożsamość konta usługi Batch, jeśli jest skonfigurowana. Jest to używane, gdy użytkownik określa wartość "Microsoft.KeyVault" jako konfigurację szyfrowania konta usługi Batch lub po wybraniu ManagedIdentity jako trybu uwierzytelniania automatycznego magazynu.
| Nazwa |
Typ |
Opis |
|
principalId
|
string
|
Identyfikator podmiotu zabezpieczeń konta usługi Batch. Ta właściwość zostanie udostępniona tylko dla tożsamości przypisanej przez system.
|
|
tenantId
|
string
|
Identyfikator dzierżawy skojarzony z kontem usługi Batch. Ta właściwość zostanie udostępniona tylko dla tożsamości przypisanej przez system.
|
|
type
|
ResourceIdentityType
|
Typ tożsamości używany dla konta usługi Batch.
|
|
userAssignedIdentities
|
<string,
UserAssignedIdentities>
|
Lista tożsamości użytkowników skojarzonych z kontem usługi Batch.
|
CloudError
Sprzeciwiać się
Odpowiedź na błąd z usługi Batch.
CloudErrorBody
Sprzeciwiać się
Odpowiedź na błąd z usługi Batch.
| Nazwa |
Typ |
Opis |
|
code
|
string
|
Identyfikator błędu. Kody są niezmienne i mają być używane programowo.
|
|
details
|
CloudErrorBody[]
|
Lista dodatkowych szczegółów dotyczących błędu.
|
|
message
|
string
|
Komunikat opisujący błąd, który ma być odpowiedni do wyświetlania w interfejsie użytkownika.
|
|
target
|
string
|
Element docelowy określonego błędu. Na przykład nazwa właściwości w błędzie.
|
ComputeNodeIdentityReference
Sprzeciwiać się
Odwołanie do tożsamości przypisanej przez użytkownika skojarzonej z pulą usługi Batch, która będzie używana przez węzeł obliczeniowy.
| Nazwa |
Typ |
Opis |
|
resourceId
|
string
|
Identyfikator zasobu usługi ARM tożsamości przypisanej przez użytkownika.
|
createdByType
Wyliczenie
Typ tożsamości, która utworzyła zasób.
| Wartość |
Opis |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
EncryptionProperties
Sprzeciwiać się
Konfiguruje sposób szyfrowania danych klienta wewnątrz konta usługi Batch. Domyślnie konta są szyfrowane przy użyciu klucza zarządzanego przez firmę Microsoft. Aby uzyskać dodatkową kontrolę, można zamiast tego użyć klucza zarządzanego przez klienta.
| Nazwa |
Typ |
Opis |
|
keySource
|
KeySource
|
Typ źródła klucza.
|
|
keyVaultProperties
|
KeyVaultProperties
|
Dodatkowe szczegóły dotyczące korzystania z usługi Microsoft.KeyVault
|
EndpointAccessDefaultAction
Wyliczenie
Domyślna akcja dostępu do punktu końcowego. Ma zastosowanie tylko wtedy, gdy funkcja publicNetworkAccess jest włączona.
| Wartość |
Opis |
|
Allow
|
Zezwalaj na dostęp klienta.
|
|
Deny
|
Odmowa dostępu klienta.
|
EndpointAccessProfile
Sprzeciwiać się
Profil dostępu do sieci dla punktu końcowego usługi Batch.
| Nazwa |
Typ |
Opis |
|
defaultAction
|
EndpointAccessDefaultAction
|
Domyślna akcja, gdy nie ma pasowanego adresu IPRule.
Domyślna akcja dostępu do punktu końcowego. Ma zastosowanie tylko wtedy, gdy funkcja publicNetworkAccess jest włączona.
|
|
ipRules
|
IPRule[]
|
Tablica zakresów adresów IP do filtrowania adresu IP klienta.
|
IPRule
Sprzeciwiać się
Reguła filtrowania adresu IP klienta.
| Nazwa |
Typ |
Opis |
|
action
|
IPRuleAction
|
Akcja w przypadku dopasowania adresu IP klienta.
|
|
value
|
string
|
Adres IP lub zakres adresów IP do filtrowania
Adres IPv4 lub zakres adresów IPv4 w formacie CIDR.
|
IPRuleAction
Wyliczenie
Akcja po dopasowaniu adresu IP klienta.
| Wartość |
Opis |
|
Allow
|
Zezwalaj na dostęp do dopasowanego adresu IP klienta.
|
KeySource
Wyliczenie
Typ źródła klucza.
| Wartość |
Opis |
|
Microsoft.Batch
|
Usługa Batch tworzy klucze szyfrowania używane do ochrony danych konta i zarządza nimi.
|
|
Microsoft.KeyVault
|
Klucze szyfrowania używane do ochrony danych konta są przechowywane w zewnętrznym magazynie kluczy. Jeśli ta wartość jest ustawiona, tożsamość konta usługi Batch musi być ustawiona na SystemAssigned, a prawidłowy identyfikator klucza musi być również podany w obszarze keyVaultProperties.
|
KeyVaultProperties
Sprzeciwiać się
Konfiguracja usługi KeyVault podczas korzystania z szyfrowania KeySource usługi Microsoft.KeyVault.
| Nazwa |
Typ |
Opis |
|
keyIdentifier
|
string
|
Pełna ścieżka do wpisu tajnego z wersją lub bez tej wersji. Przykład https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. lub https://mykeyvault.vault.azure.net/keys/testkey. Aby można było używać następujących wymagań wstępnych, należy spełnić następujące wymagania wstępne:
Konto usługi Batch ma tożsamość przypisaną przez system Tożsamość konta została udzielona: Klucz/Get, Klucz/Odpakuj i Klucz/Zawijanie uprawnień KeyVault ma włączoną ochronę przed usuwaniem nietrwałym i przeczyszczaniem
|
KeyVaultReference
Sprzeciwiać się
Identyfikuje magazyn kluczy platformy Azure skojarzony z kontem usługi Batch.
| Nazwa |
Typ |
Opis |
|
id
|
string
(arm-id)
|
Identyfikator zasobu magazynu kluczy platformy Azure skojarzony z kontem usługi Batch.
|
|
url
|
string
|
Adres URL magazynu kluczy platformy Azure skojarzony z kontem usługi Batch.
|
NetworkProfile
Sprzeciwiać się
Profil sieciowy dla konta usługi Batch, który zawiera ustawienia reguły sieciowej dla każdego punktu końcowego.
| Nazwa |
Typ |
Opis |
|
accountAccess
|
EndpointAccessProfile
|
Profil dostępu do sieci dla punktu końcowego batchAccount (interfejs API płaszczyzny danych konta usługi Batch).
|
|
nodeManagementAccess
|
EndpointAccessProfile
|
Profil dostępu do sieci dla punktu końcowego nodeManagement (usługa Batch zarządzająca węzłami obliczeniowymi dla pul usługi Batch).
|
PoolAllocationMode
Wyliczenie
Tryb alokacji do tworzenia pul na koncie usługi Batch.
| Wartość |
Opis |
|
BatchService
|
Pule zostaną przydzielone w subskrypcjach należących do usługi Batch.
|
|
UserSubscription
|
Pule zostaną przydzielone w subskrypcji należącej do użytkownika.
|
PrivateEndpoint
Sprzeciwiać się
Prywatny punkt końcowy połączenia prywatnego punktu końcowego.
| Nazwa |
Typ |
Opis |
|
id
|
string
|
Identyfikator zasobu usługi ARM prywatnego punktu końcowego. Jest to formularz /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}.
|
PrivateEndpointConnection
Sprzeciwiać się
Zawiera informacje o zasobie łącza prywatnego.
| Nazwa |
Typ |
Opis |
|
etag
|
string
|
Element ETag zasobu używany na potrzeby instrukcji współbieżności.
|
|
id
|
string
(arm-id)
|
W pełni kwalifikowany identyfikator zasobu dla zasobu. Np. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
Nazwa zasobu
|
|
properties.groupIds
|
string[]
|
Identyfikator grupy połączenia prywatnego punktu końcowego.
Wartość ma jeden i tylko jeden identyfikator grupy.
|
|
properties.privateEndpoint
|
PrivateEndpoint
|
Identyfikator zasobu usługi ARM prywatnego punktu końcowego.
Prywatny punkt końcowy połączenia prywatnego punktu końcowego.
|
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Stan połączenia usługi łącza prywatnego połączenia z prywatnym punktem końcowym.
|
|
properties.provisioningState
|
PrivateEndpointConnectionProvisioningState
|
Stan aprowizacji połączenia prywatnego punktu końcowego.
|
|
systemData
|
systemData
|
Metadane usługi Azure Resource Manager zawierające informacje „createdBy” i „modifiedBy”.
|
|
tags
|
object
|
Tagi zasobu.
|
|
type
|
string
|
Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"
|
PrivateEndpointConnectionProvisioningState
Wyliczenie
Stan aprowizacji połączenia prywatnego punktu końcowego.
| Wartość |
Opis |
|
Creating
|
Połączenie jest tworzone.
|
|
Updating
|
Użytkownik zażądał zaktualizowania stanu połączenia, ale operacja aktualizacji nie została jeszcze ukończona. Nie można odwoływać się do połączenia podczas nawiązywania połączenia z kontem usługi Batch.
|
|
Deleting
|
Połączenie jest usuwane.
|
|
Succeeded
|
Stan połączenia jest końcowy i jest gotowy do użycia, jeśli stan to Zatwierdzone.
|
|
Failed
|
Użytkownik zażądał, aby połączenie zostało zaktualizowane i nie powiodło się. Możesz ponowić próbę wykonania operacji aktualizacji.
|
|
Cancelled
|
Użytkownik anulował tworzenie połączenia.
|
PrivateLinkServiceConnectionState
Sprzeciwiać się
Stan połączenia usługi łącza prywatnego połączenia z prywatnym punktem końcowym
| Nazwa |
Typ |
Opis |
|
actionsRequired
|
string
|
Akcja wymagana w stanie połączenia prywatnego
|
|
description
|
string
|
Opis stanu połączenia prywatnego
|
|
status
|
PrivateLinkServiceConnectionStatus
|
Stan połączenia prywatnego punktu końcowego usługi Batch
|
PrivateLinkServiceConnectionStatus
Wyliczenie
Stan połączenia prywatnego punktu końcowego usługi Batch
| Wartość |
Opis |
|
Approved
|
Połączenie prywatnego punktu końcowego jest zatwierdzone i może służyć do uzyskiwania dostępu do konta usługi Batch
|
|
Pending
|
Trwa oczekiwanie na połączenie prywatnego punktu końcowego i nie można go użyć do uzyskania dostępu do konta usługi Batch
|
|
Rejected
|
Połączenie prywatnego punktu końcowego jest odrzucane i nie można go użyć do uzyskiwania dostępu do konta usługi Batch
|
|
Disconnected
|
Połączenie prywatnego punktu końcowego jest rozłączone i nie można go użyć do uzyskiwania dostępu do konta usługi Batch
|
ProvisioningState
Wyliczenie
Stan aprowizacji zasobu
| Wartość |
Opis |
|
Invalid
|
Konto jest w nieprawidłowym stanie.
|
|
Creating
|
Konto jest tworzone.
|
|
Deleting
|
Konto jest usuwane.
|
|
Succeeded
|
Konto zostało utworzone i jest gotowe do użycia.
|
|
Failed
|
Ostatnia operacja dla konta nie powiodła się.
|
|
Cancelled
|
Ostatnia operacja dla konta została anulowana.
|
PublicNetworkAccessType
Wyliczenie
Typ interfejsu sieciowego na potrzeby uzyskiwania dostępu do usługi Azure Batch i operacji konta usługi Batch.
| Wartość |
Opis |
|
Enabled
|
Umożliwia łączność z usługą Azure Batch za pośrednictwem publicznej usługi DNS.
|
|
Disabled
|
Wyłącza łączność publiczną i umożliwia prywatną łączność z usługą Azure Batch za pośrednictwem zasobu prywatnego punktu końcowego.
|
|
SecuredByPerimeter
|
Zabezpiecza łączność z usługą Azure Batch za pośrednictwem konfiguracji NSP.
|
ResourceIdentityType
Wyliczenie
Typ tożsamości używany dla konta usługi Batch.
| Wartość |
Opis |
|
SystemAssigned
|
Konto usługi Batch ma przypisaną przez system tożsamość.
|
|
UserAssigned
|
Konto usługi Batch ma przypisane przez użytkownika tożsamości.
|
|
None
|
Konto usługi Batch nie ma skojarzonej tożsamości. Ustawienie None na koncie aktualizacji spowoduje usunięcie istniejących tożsamości.
|
systemData
Sprzeciwiać się
Metadane dotyczące tworzenia i ostatniej modyfikacji zasobu.
| Nazwa |
Typ |
Opis |
|
createdAt
|
string
(date-time)
|
Sygnatura czasowa tworzenia zasobu (UTC).
|
|
createdBy
|
string
|
Tożsamość, która utworzyła zasób.
|
|
createdByType
|
createdByType
|
Typ tożsamości, która utworzyła zasób.
|
|
lastModifiedAt
|
string
(date-time)
|
Znacznik czasu ostatniej modyfikacji zasobu (UTC)
|
|
lastModifiedBy
|
string
|
Tożsamość, która ostatnio zmodyfikowała zasób.
|
|
lastModifiedByType
|
createdByType
|
Typ tożsamości, która ostatnio zmodyfikowała zasób.
|
UserAssignedIdentities
Sprzeciwiać się
Lista skojarzonych tożsamości użytkowników.
| Nazwa |
Typ |
Opis |
|
clientId
|
string
|
Identyfikator klienta tożsamości przypisanej przez użytkownika.
|
|
principalId
|
string
|
Identyfikator podmiotu zabezpieczeń tożsamości przypisanej przez użytkownika.
|
VirtualMachineFamilyCoreQuota
Sprzeciwiać się
Rodzina maszyn wirtualnych i skojarzony z nim limit przydziału rdzeni dla konta usługi Batch.
| Nazwa |
Typ |
Opis |
|
coreQuota
|
integer
(int32)
|
Limit przydziału rdzeni dla rodziny maszyn wirtualnych dla konta usługi Batch.
|
|
name
|
string
|
Nazwa rodziny maszyn wirtualnych.
|