How do you set a userIdentiy when we create pools on azure batch account?

Adrian Alexa 6 Reputation points
2021-06-16T09:34:34.757+00:00

I just cannot create a pool on an azure batch account specifying the useridentity. I want to do this via JSON format.

This is the code I use

{
"properties": {
"displayName": "CoraxDevBatchPool5",
"vmSize": "standard_d1_v2",
"deploymentConfiguration": {
"cloudServiceConfiguration": {
"osFamily": "6",
"osVersion": "*"
}
},
"currentDedicatedNodes": 1,
"currentLowPriorityNodes": 1,
"scaleSettings": {
"fixedScale": {
"targetDedicatedNodes": 1,
"targetLowPriorityNodes": 1,
"resizeTimeout": "PT15M"
}
},
"networkConfiguration": {
"publicIPAddressConfiguration": {
"provision": "BatchManaged"
}
},
"applicationPackages": [
{
"id": "/subscriptions/abcddddd/resourceGroups/globaldevrg/providers/Microsoft.Batch/batchAccounts/coraxdevbatch/applications/BatchDataTransferTrigger",
"version": "dev.16"
}
],
"taskSlotsPerNode": 4,
"taskSchedulingPolicy": {
"nodeFillType": "Pack"
}
},
"identity": {
"principalId": "df4b3e45-615e-aaaa-8651-0fc51ca3266b"
"clientId": "3c1f9b36-b8b5-4131-aaaa-75ab779872b3",
"type": "UserAssigned",
"userAssignedIdentities": { "/subscriptions/40db49dd-aaaa-4b23-96f3-69b1cd019b3f/resourceGroups/globalDevRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/DevBatchAccountToKeyVault": {}
}
}
}

I've tried also without specifying the principalId and clientId params.

I am receiving this error without saying anything specific:

Error code InternalServerError Message Encountered internal server error. Diagnostic information: timestamp '20210616T065455Z', subscription id '40db49dd-73b9-4b23-96f3-69b1cd019b3f', tracking id '041109bf-06e0-440d-9349-6cb029228446', request correlation id '041109bf-06e0-440d-9349-6cb029228446'.

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
306 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Adrian Alexa 6 Reputation points
    2021-07-01T11:25:18.6+00:00

    Hi, meanwhile I've discovered the issue

    this part was missing from json (got rid of cloudServiceConfiguration):

    "deploymentConfiguration": {
    "virtualMachineConfiguration": {
    "imageReference": {
    "publisher": "microsoftwindowsserver",
    "offer": "windowsserver",
    "sku": "2019-datacenter-core-smalldisk",
    "version": "latest"
    },
    "nodeAgentSKUId": "batch.node.windows amd64",
    "windowsConfiguration": {
    "enableAutomaticUpdates": false
    },
    "nodePlacementConfiguration": {
    "policy": "Regional"
    }
    }
    },

    1 person found this answer helpful.
    0 comments No comments

  2. vipullag-MSFT 24,216 Reputation points Microsoft Employee
    2021-06-18T14:38:40.74+00:00

    @Adrian Alexa

    Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

    The identity section should look something like below:

    107104-batch-user-identity.jpg

    Hope this helps.

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.

    0 comments No comments