@Sowmya Kailasamurthy Please find the similar issue in SO forum if it might help to solve your issue,https://stackoverflow.com/questions/67367181/managedidentitycredential-authentication-unavailable-no-managed-identity-endpoi
and troubleshoot identity issues.
https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/TROUBLESHOOTING.md
Regards
Geetha