VSTest unit-test's ping of a DNS server (8.8.8.8) fails when running within Azure Pipeline. The ping operation is a part of a few unit tests. When these unit tests ran on a local computer - everything works well. However, when the same unit tests are executed on Azure Pipeline CI - all the ping operations fail. What is strange all other Internet-based calls (like HTTP POSTs) are working fine locally and on the Azure Pipeline CI. Any ideas?
1 Answers
VSTest unit-test's ping of a DNS server (8.8.8.8) fails when running within Azure Pipeline
I am afraid you have to setup your private agent on your local machine.
As test, I could also ping of a DNS server (8.8.8.8) successfully on a local computer but failed on the hosted agent on Azure pipeline.
That because:
The ICMP protocol is not permitted through the Azure load balancer, you will notice that you are unable to ping an Azure VM from the internet, and from within the Azure VM, you are unable to ping internet locations.
Check the blog Use port pings instead of ICMP to test Azure VM connectivity for some more details.
Besides, we could also not through Windows Firewall allow ping on the Azure VM.
So, if you want to ping the DNS server, you need to create your private agent on you local machine:
Hope this helps.