I'm not able to get named pipes working within a single VM or across 2 VMs within Azure.
Availability set is not an option.

So, if the VM name is testVM.cloudapp.net, the named pipe is failing with username or password is incorrect. If we use testVM instead of FQDN, the named pipe is working fine.

There is no virtual network, we have the firewall correctly setup(even turned it off).

Adding a lmhosts file with the internal ipaddress mapped to testVM.cloudapp.net did not solve this.
Accessing \testVM.cloudapp.net asks for authentication and fails. But \testVM works.
How do I setup this to make it work. Once this works, I want to expand this to multiple VMs.

If you are wanting to share files, it may be better to write to Azure blob storage and have your 2nd VM read from that. Web services are not normally very good at big chunks of data (>2MB typically)

*I would guess that they would not put them on the same physical machine, as that would be a single point of failure and a larger instance would be a better choice in that case.

Update

If you are using the WCF NamedPipes binding (NetNamedPipesBinding) you can only use that on a single machine.

You can use windows named pipes across machine boundaries, as it fall back to tcp.
(If you are using WCF then you should choose a tcp based binding when going across machine boundaries)
Further details here.