【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
  • <>使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

 

posted @   路边两盏灯  阅读(137)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 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。 这个是因为什么?
点击右上角即可分享
微信分享提示