You can not use the public key
created in Azure as Use Existing Public Key
. Public Key
Created in Azure in only for User existing key stored in Azure
.
For using the Use Existing Public Key
You need to create a Public Key in your local machine or you can create using azureCLI as well.
The following command creates an SSH key pair using RSA encryption and a bit length of 4096:
ssh-keygen -m PEM -t rsa -b 4096

Using the above command you will have two key one is private
(id_rsa) and another is public
(id_rsa.pub).Use the Public One you can get the key at this location cd /home/rahul/.ssh/
Refere this Microsoft Document.