Managed identities are used for managing Azure resources, they can't be used as credentials to sign in to systems like winRM.
Maybe look at using KeyVault to store your credentials?
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/winrm