I've converted an rsa key to pem using the following command
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
However when I try uploading this key to my ubuntu server hosted on Azure I get an error
The certificate is in an invalid format. X.509 standard format in a .cer or .pem file is supported.
What is the correct way of converting an rsa key to pem format?