# Connecting to Azure Win Servers

**URL:** <https://forum.ansible.com/t/connecting-to-azure-win-servers/20793>\
**Category:** Ansible Project\
**Tags:** azure, windows\
**Created:** [March 7, 2016, 2:35pm UTC](https://forum.ansible.com/t/connecting-to-azure-win-servers/20793 "2016-03-07T14:35:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Matthews](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Mark\_Matthews](https://forum.ansible.com/u/Mark_Matthews)\
**Post date:** [March 7, 2016, 2:35pm UTC](https://forum.ansible.com/t/connecting-to-azure-win-servers/20793/1 "2016-03-07T14:35:07Z")

</div>

Hi

I have setup some Windows servers is Azure, and now want to run some playbooks to those servers.

I am getting the following error though (see attached).

10.85.50.8 | FAILED! =\> {

“failed”: true,

“msg”: “ERROR! ssl: 500 WinRMTransport. [Errno 104] Connection reset by peer”

}

- I have disabled Windows firewall on all those servers, and I have also run the ‘ansible.ps1’ file to enable everything on a Windows server.

- I have also allowed all incoming traffic on the Azure network

Is there something that Ansible Needs to be done in order to access servers in Azure?

If I run the win\_ping command directly from the Ansible server, I get the following error:

10.85.50.9 | UNREACHABLE! =\> {

“changed”: false,

“msg”: “ERROR! SSH encountered an unknown error. The output was:\nOpenSSH\_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 56: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/root/.ansible/cp/ansible-ssh-10.85.50.9-22-root" does not exist\r\ndebug2: ssh\_connect: needpriv 0\r\ndebug1: Connecting to 10.85.50.9 [10.85.50.9] port 22.\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug1: connect to address 10.85.50.9 port 22: Connection timed out\r\nssh: connect to host 10.85.50.9 port 22: Connection timed out\r\n”,

“unreachable”: true

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 7, 2016, 2:58pm UTC](https://forum.ansible.com/t/connecting-to-azure-win-servers/20793/2 "2016-03-07T14:58:50Z")

</div>

Hmm, looks like it is trying to make an SSH connection, rather than a WinRM connection Port 22 is the giveaway there - should be 5985 or 5986 for winrm.

I suggest checking your inventory/group vars to make sure you have ansible\_connection: winrm

set in your inventory or group vars for this host.

Hope this helps,

Jon
