@Brian Bertrand Apologies for the delay in response and all the inconvenience caused because of the issue.
To assign managed identities to pools you need to use the management client instead of the normal batch service client, this is so that requests are routed through ARM which supported managed identity. Here is some untested sample code in Python but should work with minimal tweaks:
from azure.identity import DefaultAzureCredential
import azure.mgmt.batch
import azure.mgmt.batch.modelsclient = azure.mgmt.batch.BatchManagement(credential=DefaultAzureCredential(), subscription_id="test")
sample_identity = azure.mgmt.batch.models.BatchPoolIdentity(
type=azure.mgmt.batch.models.PoolIdentityType.USER_ASSIGNED,
user_assigned_identities={
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identientityName": None
}
)
params = azure.mgmt.batch.models.Pool(identity=sample_identity)client.pool.create("resource", "account", "poolName", params)
Hope it helps!!!
Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.