I configured the /etc/containerd/config.toml
added:
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors."XXX.azurecr.io"]
      endpoint = ["https://XXX.azurecr.io"]than restarted - service containerd restart
and created a secret on the same namespace
But I still get
 Warning  Failed     10s   kubelet            Failed to pull image "XXX.azurecr.io/ansible-tower-38/ansible-tower-rhel7": rpc error: code = Unknown desc = failed to pull and unpack image "XXX.azurecr.io/ansible-tower-38/ansible-tower-rhel7:latest": failed to resolve reference "XXX.azurecr.io/ansible-tower-38/ansible-tower-rhel7:latest": failed to authorize: failed to fetch oauth token: unexpected status: 401 Unauthorized