【Azure 应用服务】App Service For Linux 环境中,如何从App Service中获取GitHub私有库(Private Repos)的Deploy Key(RSA key)呢?
问题描述
为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
- <
符号 - <密码> :第一步截图中的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/
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2021-03-26 【Azure 云服务】在Cloud Service的代码中如何修改IIS Application Pool的配置呢? 比如IdleTimeout, startMode, Recycling.PeriodicRestart.Time等
2021-03-26 【Azure 应用服务】App Service 在使用GIt本地部署,上传代码的路径为/home/site/repository,而不是站点的根目录/home/site/wwwroot。 这个是因为什么?