You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,53 +20,67 @@ You can lower maintenance overhead in your Azure Batch applications by using the
20
20
21
21
## Create and delete Batch accounts
22
22
23
-
One of the primary features of the Batch Management API is to create and delete [Batch accounts](accounts.md) in an Azure region. To do so, use [BatchManagementClient.Account.CreateAsync](/dotnet/api/microsoft.azure.management.batch.batchaccountoperationsextensions.createasync) and [DeleteAsync](/dotnet/api/microsoft.azure.management.batch.batchaccountoperationsextensions.deleteasync), or their synchronous counterparts.
23
+
One of the primary features of the Batch Management API is to create and delete [Batch accounts](accounts.md) in an Azure region. To do so, use [BatchAccountCollection.CreateOrUpdate](/dotnet/api/azure.resourcemanager.batch.batchaccountcollection.createorupdate) and [Delete](/dotnet/api/azure.resourcemanager.batch.batchaccountresource.delete), or their asynchronous counterparts.
24
24
25
-
The following code snippet creates an account, obtains the newly created account from the Batch service, and then deletes it. In this snippet and the others in this article, `batchManagementClient` is a fully initialized instance of [BatchManagementClient](/dotnet/api/microsoft.azure.management.batch.batchmanagementclient).
25
+
The following code snippet creates an account, obtains the newly created account from the Batch service, and then deletes it.
> Applications that use the Batch Management .NET library and its BatchManagementClient class require service administrator or coadministrator access to the subscription that owns the Batch account to be managed. For more information, see the Microsoft Entra ID section and the [AccountManagement](https://github.com/Azure-Samples/azure-batch-samples/tree/master/CSharp/AccountManagement) code sample.
50
+
> Applications that use the Batch Management .NET library require service administrator or coadministrator access to the subscription that owns the Batch account to be managed. For more information, see the Microsoft Entra ID section and the [AccountManagement](https://github.com/Azure-Samples/azure-batch-samples/tree/master/CSharp/AccountManagement) code sample.
44
51
45
52
## Retrieve and regenerate account keys
46
53
47
-
Obtain primary and secondary account keys from any Batch account within your subscription by using [GetKeysAsync](/dotnet/api/microsoft.azure.management.batch.batchaccountoperationsextensions.getkeysasync). You can regenerate those keys by using [RegenerateKeyAsync](/dotnet/api/microsoft.azure.management.batch.batchaccountoperationsextensions.regeneratekeyasync).
54
+
Obtain primary and secondary account keys from any Batch account within your subscription by using [GetKeys](/dotnet/api/azure.resourcemanager.batch.batchaccountresource.getkeys). You can regenerate those keys by using [RegenerateKey](/dotnet/api/microsoft.azure.management.batch.batchaccountoperationsextensions.regeneratekey).
> You can create a streamlined connection workflow for your management applications. First, obtain an account key for the Batch account you wish to manage with [GetKeysAsync](/dotnet/api/microsoft.azure.management.batch.batchaccountoperationsextensions.getkeysasync). Then, use this key when initializing the Batch .NET library's [BatchSharedKeyCredentials](/dotnet/api/microsoft.azure.batch.auth.batchsharedkeycredentials) class, which is used when initializing [BatchClient](/dotnet/api/microsoft.azure.batch.batchclient).
83
+
> You can create a streamlined connection workflow for your management applications. First, obtain an account key for the Batch account you wish to manage with [GetKeys](/dotnet/api/azure.resourcemanager.batch.batchaccountresource.getkeys). Then, use this key when initializing the Batch .NET library's [BatchSharedKeyCredentials](/dotnet/api/microsoft.azure.batch.auth.batchsharedkeycredentials) class, which is used when initializing [BatchClient](/dotnet/api/microsoft.azure.batch.batchclient).
70
84
71
85
## Check Azure subscription and Batch account quotas
72
86
@@ -76,28 +90,30 @@ Azure subscriptions and the individual Azure services like Batch all have defaul
76
90
77
91
Before creating a Batch account in a region, you can check your Azure subscription to see whether you are able to add an account in that region.
78
92
79
-
In the code snippet below, we first use **ListAsync** to get a collection of all Batch accounts that are within a subscription. Once we've obtained this collection, we determine how many accounts are in the target region. Then we use **GetQuotasAsync** to obtain the Batch account quota and determine how many accounts (if any) can be created in that region.
93
+
In the code snippet below, we first use **GetBatchAccounts** to get a collection of all Batch accounts that are within a subscription. Once we've obtained this collection, we determine how many accounts are in the target region. Then we use **GetBatchQuotas** to obtain the Batch account quota and determine how many accounts (if any) can be created in that region.
Console.WriteLine("Account quota for {0} region: {1}", region, batchLocationQuota.AccountQuota);
97
113
98
114
// Determine how many accounts can be created in the target region
99
115
Console.WriteLine("Accounts in {0}: {1}", region, accountsInRegion);
100
-
Console.WriteLine("You can create {0} accounts in the {1} region.", quotaResponse.AccountQuota-accountsInRegion, region);
116
+
Console.WriteLine("You can create {0} accounts in the {1} region.", batchLocationQuota.AccountQuota-accountsInRegion, region);
101
117
```
102
118
103
119
In the snippet above, `creds` is an instance of **TokenCredentials**. To see an example of creating this object, see the [AccountManagement](https://github.com/Azure-Samples/azure-batch-samples/tree/master/CSharp/AccountManagement) code sample on GitHub.
@@ -107,15 +123,22 @@ In the snippet above, `creds` is an instance of **TokenCredentials**. To see an
107
123
Before increasing compute resources in your Batch solution, you can check to ensure the resources you want to allocate won't exceed the account's quotas. In the code snippet below, we print the quota information for the Batch account named `mybatchaccount`. In your own application, you could use such information to determine whether the account can handle the additional resources to be created.
Console.WriteLine("Active job and job schedule quota: {0}", batchAccount.Data.ActiveJobAndJobScheduleQuota);
119
142
```
120
143
121
144
> [!IMPORTANT]
@@ -152,4 +175,4 @@ To run the sample application successfully, you must first register it with your
152
175
## Next steps
153
176
154
177
- Learn about the [Batch service workflow and primary resources](batch-service-workflow-features.md) such as pools, nodes, jobs, and tasks.
155
-
- Learn the basics of developing a Batch-enabled application using the [Batch .NET client library](quick-run-dotnet.md) or [Python](quick-run-python.md). These quickstarts guide you through a sample application that uses the Batch service to execute a workload on multiple compute nodes, using Azure Storage for workload file staging and retrieval.git pus
178
+
- Learn the basics of developing a Batch-enabled application using the [Batch .NET client library](quick-run-dotnet.md) or [Python](quick-run-python.md). These quickstarts guide you through a sample application that uses the Batch service to execute a workload on multiple compute nodes, using Azure Storage for workload file staging and retrieval.
0 commit comments