azure-batch-samples icon indicating copy to clipboard operation
azure-batch-samples copied to clipboard

How to upload applicationPackage to be installed on each node of the pool

Open jGuru opened this issue 5 years ago • 2 comments

The Java SDK only has methods to create logical application package reference on the portal but do not have any method to upload .zip file for the application. i.e. I wanted to create a new batch account with .zip file in my local. How can I do that?

Thanks

jGuru avatar Nov 05 '19 22:11 jGuru

Using Java you can create application packages with azure-mgmt-batch

            BatchAccount batchAccount = azure.batchAccounts().define(batchAccountName)
                    .withRegion(region)
                    .withNewResourceGroup(rgName)
                    .defineNewApplication(applicationName)
                        .defineNewApplicationPackage(applicationPackageName)
                        .withAllowUpdates(true)
                        .withDisplayName(applicationDisplayName)
                        .attach()
                    .withNewStorageAccount(storageAccountName)
                    .create();

Once it is created you can do a get operation on the ApplicationPackage to get the storage url to upload your bits to (with the storage SDK).

Then you need to call activate on the ApplicationPackage

bgklein avatar Nov 06 '19 19:11 bgklein

Thanks for your response. I have created the batch account already with the above-given code. I will explore the Storage SDK then will get back to you.

jGuru avatar Nov 09 '19 20:11 jGuru