We can typically use a DefaultAzureCredential object in SecretClient constructor to use managed identities to access a KeyVault.
I was looking for something similar where I can use the DefaultAzureCredential or some other mechanism through which I can instantiate an instance of BatchClient without having to provide a BatchAccountKey.
How to use User managed identity to access Azure BatchClient programatically?
506 views Asked by user2634574 At
1
You can use the Defaultazurecredential with user-assigned managed identity in Azure batch using C#.
Here for a workaround, You can use the below code to list the pools in the Azure batch account using a user-assigned managed identity.
In my batch account, I have two pools:
Code:
Output: