【问题标题】:Azure App Service Deployment with private Github repo as dependency fails during build使用私有 Github 存储库作为依赖项的 Azure 应用服务部署在构建期间失败
【发布时间】:2022-01-18 14:51:28
【问题描述】:

我有一个基于反应的应用程序,它从另一个私有存储库中提取代码。

在我的 package.json 中显示为

"mylib": "github:orgname/mylib"

这一切都在本地工作。

当我部署到 Azure 应用服务时,我收到以下错误

npm ERR! Error while executing: 
7npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t ssh://git@github.com/orgname/mylib.git 
8npm ERR! 
9npm ERR! Host key verification failed. 
10npm ERR! fatal: Could not read from remote repository. 
11npm ERR! 
12npm ERR! Please make sure you have the correct access rights 
13npm ERR! and the repository exists. 
14npm ERR! 
15npm ERR! exited with error code: 128

我从

获取了公钥

https://[appname].scm.azurewebsites.net/api/sshkey?ensurePublicKey=1

并尝试将其添加到 github 上的帐户、组织和 repo,但我仍然遇到同样的错误。

我这里有什么明显的遗漏吗?

【问题讨论】:

标签: azure github ssh azure-web-app-service ssh-keys


【解决方案1】:

使用私有 GitHub 存储库将应用程序部署到 Azure 应用程序服务。 以下是您可以遵循的解决方法之一:

  • 我在 VS Studio (.net) 中创建了一个演示应用程序,并将项目推送到我的 GitHub私有存储库

  • 在 Azure 门户中创建了一个应用服务。并转到部署中心>选择您的组织作为GitHub,存储库(您的私人存储库)并保存。

  • 一段时间后,您的应用程序将反映在 Azure 门户上

更多信息请参考以下链接:

【讨论】:

    最近更新 更多