I have the following scenario.
2 vnets (same location/location, but different resource groups)
vnetA: Address space 10.1.0.0/16 Gateway subnet 10.1.1.0/24 VM 10.1.0.5
vnetB: Address space 10.0.0.0/16 Gateway subnet 10.0.2.0/24 VM 10.0.1.7
They are both peered through vnet to vnet gateways, but machines cannot ping each other. Could anyone please guide to documentation or give advice to this please?
You should check the Network Security Groups rules associated to the VNet's Subnets or to the VM's NICs. Unfortunately there is no a specific rule for ICMP protocol, but TCP and UDP only. You have to come up with a rule that suites your needs with the 'any'
protocol (i.e. '*').
Instead of using ICMP, when you want to test network connectivity I would suggest to use some TCP protocol based tool like Test-NetConnection and create proper rules in the NSG to let the network traffic pass.