Good day
The test connection seems success with azure portal, but unable to SSH to machine from my local system.
It is not very detailed information, but my first guess based on this information is that you simply did not open the firewall to SSH to your IP
(1) Please go to the virtual machine configuration in the portal
(2) Select the Virtual machine with the problem
(3) On the left menu select: Networking
(4) Confirm that the right inbound port rule is open and your IP is configure in the rule, or add new rule if needed, using the button:
If this does not solve your case, then please provide more information and screenshot of your VM configurations