Failing to pull images from ACR

I am having an issue pulling my container images from a private registry in Azure. I have created a secret in my project, and I have referenced that secret in my deployment yaml. The error I get is

rpc error: code = Unknown desc = Error response from daemon: Get https://MyRegistry.azurecr.io/v2/portal/manifests/latest: unauthorized: authentication required

I can log into docker using the username/password stored in the secret, so I am a bit confused as to where to look or what to do.

Any ideas?

I have the same problem on Rancher 2.5.7 with a service principal. I think there was previously a different way to pull such images in the Infrastructure menu and it used client ID and secret instead. I don’t see that under the Resources > Secrets > Private Registry