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: https://management.azure.com/subscriptions/{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 (https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP) Authentication: None Resource: https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add? Headers: Content-Type --> application/json, Authorization --> Basic @{base64(concat('{Batch Account Name}', ':', '{Batch Account Primary Key}'))}
![enter image description here](https://learn-attachment.microsoft.com/api/attachments/a8a37495-7d53-4532-9cb7-d70f2c78c71d?platform=QnA)
But I keep getting the following error:
[![enter image description here](https://i.stack.imgur.com/wqTJh.png)
](https://i.stack.imgur.com/wqTJh.png)
These are the following Authentication types that are currently being displayed under settings:
![enter image description here](https://learn-attachment.microsoft.com/api/attachments/e7f36da3-cf51-43e0-b920-abc63ce94255?platform=QnA)
I also tried removing the Authorization header, but I am getting the following error:
[![enter image description here](https://i.stack.imgur.com/0EICe.png)
](https://i.stack.imgur.com/0EICe.png)
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](https://i.stack.imgur.com/UlmOI.png)
](https://i.stack.imgur.com/UlmOI.png)
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.