We are trying to authenticate DefaultAzureCredential using azure user-assigned managed identities with python SDK. The approach we see is to specify the client id as below, following the python SDK guidance.
DefaultAzureCredential(managed_identity_client_id=123456)
We are wondering if there's another way to authenticate the managed identity with DefaultAzureCredential? Right now we hard-coded these client ids in the config which is not very robust when we recreate the MI. Is there a way we can use resourceId of the managed identity or fetching the managed identity client id from its subscription id and name in python SDK?
Any help is greatly appreciated! Thank you :)