@@ -7,26 +7,36 @@ platforms: java
7
7
When run, this sample will:
8
8
9
9
- Create an Azure Batch pool with a single dedicated node
10
- - Wait for the nodes to be ready
10
+ - Wait for the node to be ready
11
11
- Create a storage container and upload a resource file to it
12
12
- Submit a job with 5 tasks associated with the resource file
13
13
- Wait for all tasks to finish
14
14
- Delete the job, the pool and the storage container
15
15
16
- ## Running this Sample
17
- To run this sample:
16
+ ## Prerequisites
18
17
19
- Set the following environment variables:
20
- - ` AZURE_BATCH_ACCOUNT ` -- The Batch account name.
21
- - ` AZURE_BATCH_ACCESS_KEY ` -- The Batch account key.
22
- - ` AZURE_BATCH_ENDPOINT ` -- The Batch account endpoint.
23
- - ` STORAGE_ACCOUNT_NAME ` -- The storage account to hold resource files.
24
- - ` STORAGE_ACCOUNT_KEY ` -- The storage account key.
18
+ - Configure both an Azure Batch account and an Azure Storage account in the same region.
25
19
26
- Clone repo and compile the code:
20
+ - Set the following environment variables:
21
+ - ` AZURE_RESOURCE_GROUP_NAME ` -- The resource group of the Batch account.
22
+ - ` AZURE_BATCH_ACCOUNT_NAME ` -- The name of the Batch account.
23
+ - ` AZURE_BLOB_SERVICE_URL ` -- The blob service URL of the Storage account.
27
24
28
- git clone https://github.com/Azure/azure-batch-samples.git
25
+ - Ensure you have the [ Azure CLI] ( https://learn.microsoft.com/cli/azure/ ) installed and run the following commands,
26
+ replacing ` <subscription_id> ` with your Azure subscription ID. When running the ` az login ` command, make sure
27
+ you are authenticating as a user with appropriate permissions to both the Batch account and Storage account.
28
+ ``` shell
29
+ az login
30
+ az account set -s < subscription_id>
31
+ ```
29
32
30
- cd azure-batch-samples/Java/PoolAndResourceFile
33
+ ** Note:** The sample code uses [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-java/wiki/Azure-Identity-Examples#authenticating-with-defaultazurecredential),
34
+ which supports a wide variety of authentication methods, not just the Azure CLI. Any of these other methods should work
35
+ as long as the user or service principal has the appropriate permissions.
31
36
32
- mvn clean compile exec:java
37
+ # # Running the sample
38
+ Run the following command from the same directory as this README to compile and run the sample:
39
+
40
+ ` ` ` shell
41
+ mvn clean compile exec:java
42
+ ` ` `
0 commit comments