Adding SSH Keys to Windows Azure Adding SSH Keys to Windows Azure azure azure

Adding SSH Keys to Windows Azure


Better late then never, and it could be usefull for others :

A Web App already have a ssh key, to get it :https://[web-site-name].scm.azurewebsites.net/api/sshkey?ensurePublicKey=1

You can then add this key to you git repo deploy key.


I've never set that up in Azure but some general rules of thumb for handling SSH keys:

  • The private key in $HOME/.ssh/ must have file mode 600 (RW only for the owner)
  • You need both, the public and the private key in this folder, usually named id_rsa and id_rsa.pub but you can change the filename to whatever you like
  • You have to convert the private key generated by puttykeygen to a OpenSSH2 compatible format, see How to convert SSH keypairs generated using PuttyGen
  • known_hosts stores the public keys of the servers you've already connected to. That's useful to make sure that you are really connecting to the same server again. more detailed information on this topic

HTH


So if you like me had multiple private submodules on the same github account as the app service is deployed at you can give your service access to all your modules by moving the deployment key.

After this the service can access private repos on all accounts with the key.