kudu: Deploy from Gitlab fails with 'Host key verification failed'
I am attempting to deploy to an Azure app service from Gitlab (https://christianliebel.com/2016/05/auto-deploying-to-azure-app-services-from-gitlab/) but ran into a problem. The deployment fails
Host key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n\r\nD:\Program Files (x86)\Git\cmd\git.exe fetch origin --progress
I’ve deleted the deployment configuration in the App service a few times and recreated to make sure the SSL URL for the Gitlab repository is correct. I’ve also tried adding my key into the Gitlab deployment keys but it wont let me as its already there, so I know the key is definitely correct.
Searching around on the web suggests to remove the host from the known hosts file, but as this is on azure there is no known_hosts in the /ssh folder (Kudu->Console->D:\home.ssh) so I’m not sure what else to try. I’ve followed this guide on other Azure websites and never had a problem, its just on this one thats causing the issue.
Thanks
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 29 (12 by maintainers)
The following helped me in a similar situation:
Correction, the command to try is
ssh -T git@gitlab.com
.When trying that after setting up my deploy key in GitLab, I get this:
If I then remove the deploy key from the GitLab repo, I get:
Lost as to why this is now working, but here’s the winning sequence
Generated another key from /api/sshkey?ensurePublicKey=1
Set the ssh-rsa key for deployment in gitlab with a new name and then confirmed ssh successfully returns the welcome message from the PS console
Revisited the App Deployment > Deployment Options panel, did a Redeploy from the existing Deployment Details followed by a sync and we’re off
Thanks David
Thanks! your hack worked for me