1

I am trying to write a bash command line script that will create an azure batch task with an application package. The package is called "testpackage" and exists and is activated on the batch account. However, every time I create this task, I get the following error code: BlobAccessDenied.

This only occurs when I include the application-package-references option on the command line. I tried to follow the documentation here, which states the following:

--application-package-references

The space-separated list of IDs specifying the application packages to be installed. Space-separated application IDs with optional version in 'id[#version]' format.

I have tried --application-package-references "test", --application-package-references" test[1]", and --application-package-references test[1], all with no luck. Does anyone have an example of doing this properly?

Here is the complete script I am running:

#!/usr/bin/env bash

AZ_BATCH_KEY=myKey
AZ_BATCH_ACCOUNT=myBatchAccount
AZ_BATCH_ENDPOINT=myBatchEndpoint
AZ_BATCH_POOL_ID=myPoolId
AZ_BATCH_JOB_ID=myJobId
AZ_BATCH_TASK_ID=myTaskId
az batch task create \
    --task-id $AZ_BATCH_TASK_ID \
    --job-id $AZ_BATCH_JOB_ID \
    --command-line "/bin/sh -c \"echo HELLO WORLD\"" \
    --account-name $AZ_BATCH_ACCOUNT \
    --account-key $AZ_BATCH_KEY \
    --account-endpoint $AZ_BATCH_ENDPOINT \
    --application-package-references testpackage
Dan McGrath
  • 145
  • 10

1 Answers1

3

Ah the classic "write up a detailed SO question then immediately answer it yourself" conundrum.

All I needed was --application-package-references testpackage#1

Have a good day world.

Dan McGrath
  • 145
  • 10
  • I tried with Azure CLI ```az batch pool set --pool-id hello-pool --account-name hellobatch --application-package-references hello#1 --account-endpoint https://hellobatch.westus.batch.azure.com``` but I got error ```Parameter 'ApplicationPackageReference.application_id' can not be None.``` – hoangpx Apr 18 '19 at 16:10