# Unable to Ping Ansible Hosts in Inventory from Azure Cloudshell

**URL:** <https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [May 7, 2018, 5:36pm UTC](https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475 "2018-05-07T17:36:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlton\_Patterson1](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@Carlton\_Patterson1](https://forum.ansible.com/u/Carlton_Patterson1)\
**Post date:** [May 7, 2018, 5:36pm UTC](https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475/1 "2018-05-07T17:36:01Z")

</div>

Hello Community,

I have created a Centos host in Azure and added the hosts to my Ansible inventory, however whenever I attempt to ping the host with ansible, from Azure Cloud Shell I get the error shown in image.

[![](https://lh3.googleusercontent.com/-h_t40gjD_U8/WvCOCqJ5ssI/AAAAAAAALPI/7OoHMZYgGz8L2LtZJfIvRjthg89oh8ijgCLcBGAs/s320/ans1.png)](https://lh3.googleusercontent.com/-h_t40gjD_U8/WvCOCqJ5ssI/AAAAAAAALPI/7OoHMZYgGz8L2LtZJfIvRjthg89oh8ijgCLcBGAs/s1600/ans1.png)

However, I can connect to the same host with ssh:

[![](https://lh3.googleusercontent.com/-eWV70eR3QZ0/WvCOJwKiXnI/AAAAAAAALPM/Drw7oj3ZC9oLdFbmN5Psq8TKQ-9YXAd0gCLcBGAs/s320/ans2.png)](https://lh3.googleusercontent.com/-eWV70eR3QZ0/WvCOJwKiXnI/AAAAAAAALPM/Drw7oj3ZC9oLdFbmN5Psq8TKQ-9YXAd0gCLcBGAs/s1600/ans2.png)

I have been trying to get this to work for two days now.

Im running Ansible version 2.4.3

Any guide (I mean any guide) will be greatly appreciated.

Cheers

Carlton

---

<div class="post-metadata">

**Author:** ![raj\_lovely](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@raj\_lovely](https://forum.ansible.com/u/raj_lovely)\
**Post date:** [May 7, 2018, 7:40pm UTC](https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475/2 "2018-05-07T19:40:10Z")

</div>

HI Bro,

Let me know if this helps you, because the same was bugging me and i took backup of authorized\_keys file and removed it.

After that, I have ssh-copy-id user@remote\_host (copied the ssh keys), then tried to ping which worked for me.

Thanks,  
rajesh.

---

<div class="post-metadata">

**Author:** ![Carlton\_Patterson1](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@Carlton\_Patterson1](https://forum.ansible.com/u/Carlton_Patterson1)\
**Post date:** [May 7, 2018, 9:11pm UTC](https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475/3 "2018-05-07T21:11:06Z")

</div>

Hi Raj,

I’m new to this forum. I can’t actually see your answer?

---

<div class="post-metadata">

**Author:** ![Carlton\_Patterson1](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@Carlton\_Patterson1](https://forum.ansible.com/u/Carlton_Patterson1)\
**Post date:** [May 7, 2018, 10:01pm UTC](https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475/4 "2018-05-07T22:01:35Z")

</div>

Bro,

I tried your suggestion, but I still can’t ping with ansible… Do you have any other suggestions?

---

<div class="post-metadata">

**Author:** ![f.floimair.commend](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@f.floimair.commend](https://forum.ansible.com/u/f.floimair.commend)\
**Post date:** [May 9, 2018, 6:47am UTC](https://forum.ansible.com/t/unable-to-ping-ansible-hosts-in-inventory-from-azure-cloudshell/27475/5 "2018-05-09T06:47:05Z")

</div>

By default Azure VMs do not answer pings (Microsoft blocks that). So this is not ansible’s fault. Use something else to “ping” your VM instead.
