Connect Azure Windows terraform with ansible provisioner

I am trying to create windows vm on azure using terraform then connect it to ansible directly I followed a lot approaches to auto connect to the vm using winrm http and https but every time I get connectivity issue, can you advise me with the best approach