When you create a virtual machine with access to ssh in Microsoft Azure, you can download the public key (user of the system will be implemented from the entrance to the virtual machine). But Azure requires to provide a key in format CER or PEM, while ssh-keygen creates a default key in native format. How to convert?
The solution is simple::
# openssl req -x509 -key ~/.ssh/id_rsa -nodes -days 36500 -newkey rsa:2048 -out myCert.pem
Where is: ~ / .ssh / id_rsa – the private key in a standard format for ssh, pub_cert.pem – public in PEM format
Additional Information: Using SSH to Linux on Azure