'Could not add public key error in Azure Devops

I am getting a generic "Could not add public key" error in Azure Devops when attempting to add an SSH public key. This is the first key I've tried to add on a new server and no others are in use. I have tried following the Keygen examples in the Devops documentation and the GitHub documentation, both of which use the git cli. I tried with PuttyGen as well, but there is a formatting error and messing with it further didn't appear to be a good use of time given the instructions state to use the git cli.

I have tried keys with and without passphrases for the ppk. I have tried removing whitespace and the new line in the public key phrase at the end as well. Encoding of the string is UTF8. Examination of the characters in the string only shows spaces and a line feed at the end.

These are typical keygen git commands I've tried.

ssh-keygen -C testComment

ssh-keygen -t rsa -b 4096

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source