I have a development vm setup in a private network area in Azure. Now I'm trying to connect to it via SSH and it's failing for a certain reason. I'm sure that I uploaded the correct public key to the azure VM and that the username is also correct.

vagrant@7XZRVZ2:~/.ssh/dev-vm$ ssh -vvvv -i /home/vagrant/.ssh/dev-vm/id_rsa [email protected]
OpenSSH_8.4p1 Debian-5+deb11u1, OpenSSL 1.1.1n 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 10.242.14.6 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/vagrant/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/vagrant/.ssh/known_hosts2'
debug2: ssh_connect_direct
debug1: Connecting to 10.242.14.6 [10.242.14.6] port 22.
debug1: Connection established.
debug1: identity file /home/vagrant/.ssh/dev-vm/id_rsa type 0
debug1: identity file /home/vagrant/.ssh/dev-vm/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4p1 Debian-5+deb11u1
kex_exchange_identification: Connection closed by remote host
Connection closed by 10.242.14.6 port 22
It succeeds up to Local version string..., but then after 5 or 10s there is a kex_exchange_identification: Connection closed by remote host error
which I do not understand. I searched for this error but not find a solution for my problem.
I checked the sshd logs in /var/log/auth.log on the Azure VM, in case of connection from client it just tells:
Mar 20 09:28:32 azureuser sshd[15871]: Connection from 10.236.122.24 port 31852 on 10.242.14.6 port 22 rdomain ""
I have setup a FW rule for Port 22 through the intranet network, is there probably another port I need to add?