Creating an Azure Batch Service Pool using an ADF pipeline

Vivek Nimmagadda 0 Reputation points

I want to automatically create an Azure Batch Service pool when an ADF pipeline is run.

I created a web activity inside the pipeline and passed the parameters under settings as follows:

URL:{Subscription ID}/resourceGroups/{Resource Group Name}/providers/Microsoft.Batch/batchAccounts/{Azure Batch Account Name}/pools?api-version=2023-05-01 Method: POST Body: { "id": "pool2", "vmSize": "standard_a1", "virtualMachineConfiguration": { "imageReference": { "publisher": "Canonical", "offer": "0001-com-ubuntu-server-focal", "sku": "20_04-lts", "version": "latest" }, "nodeAgentSKUId": "batch.node.ubuntu 20.04" }, "resizeTimeout": "PT15M", "targetDedicatedNodes": 5, "targetLowPriorityNodes": 0, "taskSlotsPerNode": 3, "taskSchedulingPolicy": { "nodeFillType": "spread" }, "enableAutoScale": false, "enableInterNodeCommunication": true, "metadata": [ { "name": "myproperty", "value": "myvalue" } ] } as per the following official documentation ( Authentication: None Resource: Headers: Content-Type --> application/json, Authorization --> Basic @{base64(concat('{Batch Account Name}', ':', '{Batch Account Primary Key}'))}

enter image description here

But I keep getting the following error:

[enter image description here


These are the following Authentication types that are currently being displayed under settings:

enter image description here

I also tried removing the Authorization header, but I am getting the following error:

[enter image description here


I even tried changing the Authentication to 'System Assigned Managed Identity'. However, ADF says that resource doesn't exist which is weird because the same works for GET and DELETE methods respectively.

[enter image description here


So not exactly sure how to provide the authorization header in the correct format or how to generate a refresh token for Azure Batch Account. Any help would be greatly appreciated. Please let me know if something is not clear.

It would have been helpful if the official documentation included an example to do the same.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,083 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 37,136 Reputation points Microsoft Employee


    Thank you for posting query in Microsoft Q&A Platform.

    To create batch pool, could you please consider using REST API documented in below link. Please note its a PUT request.

    Also, consider getting access token first and then use that access token in your API call.

    Kindly consider testing your API first with some third party tool such as Postman and then try same in web activity.

    Hope this helps. Please let me know how it goes. Thank you.