question

AdrianAlexa-6959 avatar image
0 Votes"
AdrianAlexa-6959 asked AdrianAlexa-6959 answered

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

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
· 1
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.

@AdrianAlexa-6959

Any update on the issue?

Just checking in if you got a chance to see my previous response.

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

0 Votes 0 ·
vipullag-MSFT avatar image
0 Votes"
vipullag-MSFT answered

@AdrianAlexa-6959

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.


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.

AdrianAlexa-6959 avatar image
1 Vote"
AdrianAlexa-6959 answered

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"
}
}
},

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.