您的位置:首页 > 运维架构 > Linux

【Azure 应用服务】App Service For Linux 环境中,如何从App Service中获取GitHub私有库(Private Repos)的Deploy Key(RSA key)呢?

2022-03-26 17:18 1206 查看

问题描述

为App Service For Linux配置CI/CD,源代码在GitHub私有库中,在发布时候报错 Cannot find SourceControlToken with name Bitbucket. 这样的情况如何来解决呢?在参考了文章

得知需要在GitHub/Bitbucket/GitLab中配置Deploy Key。 那么我们如何来获取这个Key呢?

问题解答

第一步: 在App Service门户的Deployment Center页面获取用户名和密码

 

第二步: 组合获取 SSH Key 的请求URL 

https://<$用户名>:<密码>@<站点名>.scm.chinacloudsites.cn/api/sshkey?ensurePublicKey=1
  • <$用户名> : 使用第一步中的UserName代替,注意,只需要 \ 后面的部分,需要包含$符号
  • <密码> :第一步截图中的Password内容
  • <站点名> :当前Web App的名称

 

第三步: 通过Postman或者curl 获取到 ssh-rsa Key

curl https://$xxxxx:qr3kuR7ygxxxxxxxxxcDt@xxxxxxx.scm.chinacloudsites.cn/api/sshkey?ensurePublicKey=1

 

 

附录一: 如何在App Service for Linux中查看 .ssh 文件夹

登录到SSH页面:https://yourappservicename.scm.chinacloudsites.cn/webssh/host 

# find / -name .ssh

# cd /home/xxxxxxxxxxxxxxxxxxx??????????????????/.ssh

# ls -l

查找截图:

 

 

参考文档

1:https://erikschlegel.com/2015/06/20/azure-continuous-deployment-using-git-private-repos/ 

2:https://github.com/projectkudu/kudu/wiki/Continuous-deployment#setting-up-continuous-deployment-using-manual-steps

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐