question

Soni-9294 avatar image
0 Votes"
Soni-9294 asked Soni-9294 commented

Invoking REST API from Azure Batch

Hello Team,

I have some REST Web API(have authentication in place) exposed on Azure I would like to invoke these API's from Azure Batch so that these calls are authenticated.

Regards,
Soni

azure-batch
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Soni-9294 , Thank you for your question.

Although a little more clarity into the authentication you mentioned would have been nice, can you please check if the following works for you?

Follow the steps in this quickstart guide > At the create tasks step modify the arguments to the --command-line option to something like "/bin/bash -c 'curl ...'" with -X, -H, -d options to curl as necessary.

If you are using Windows compute nodes, you can pass "powershell -command 'Invoke-RestMethod ...'" with appropriate parameters as described here to the --command-line option. For more information on how to call REST API from curl please refer to this article.

You can try of the following ways other than Azure CLI to define the task which calls the REST API with your preferred method of invocation:

Hope this helps!

0 Votes 0 ·

@srbose-msft - Sorry for not providing much insights into it.

We have REST WEB API hosted on Azure(with AAD authentication in place). If I have to call the REST API from Azure Batch Tasks, I guess I need to pass some access token so API can authenticate the call from batch service. Need inputs on how to implement, please note we are using BATCH .NET SDK(not Batch management library)

0 Votes 0 ·

@srbose-msft - Any update

0 Votes 0 ·

@srbose-msft - Any update please

0 Votes 0 ·

@srbose-msft - update we have

0 Votes 0 ·

0 Answers