如何在Azure上重置Kudu缓存的部署 [英] How to reset Kudu cached deployment on Azure

查看:57
本文介绍了如何在Azure上重置Kudu缓存的部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前在Azure Web App上有一个Node应用程序,现在是Go应用程序.问题是当我部署时,我是从Kudu那里得到的:

I previously had a Node app on Azure Web App that is now a Go app. Problem is when I deploy I get this from Kudu:

使用部署脚本的缓存版本(命令:'azure -y --no-dot-deployment -r"D:\ home \ site \ repository" -o"D:\ home \ site \ deployments \工具" --node --sitePath"D:\ home \ site \ repository"').

这显然是后来抱怨没有找到server/app.js文件.

This obviously complains later that no server/app.js file are found.

因此,我尝试使用 azure网站部署脚本--go 为我的应用程序生成部署脚本.

So I tried generating a deployment script for my app with azure site deploymentscript --go.

即使我在应用程序设置中设置了GO15VENDOREXPERIMENT = 1,它仍在抱怨依赖关系.我所有的依赖项都在/vendor文件夹中提供.

Even though I have the GO15VENDOREXPERIMENT=1 in the app's settings it was complaining about dependencies. All my dependencies are vendored in the /vendor folder.

然后,我在 azure网站部署脚本命令生成的 deploy.cmd 文件中设置此变量.

I than set this variable inside the deploy.cmd file that were generated by the azure site deploymentscript command.

仍然在抱怨没有一个依赖项.请注意,现在它正在搜索本地供应商树,但是相关性在那里,我可以在Github存储库中看到它,也可以在本地看到它.

Still it's complaining that one dependencies is not there. Note that now it is searching into the local vendor tree, but the dependencies is there, I can see it in the Github repo and I see it locally as well.

我还有其他Go应用程序部署得很好,并且对Azure有供应商依赖性,但这是一个Node应用程序,以前根本无法正常工作.

I have other Go apps that deployed just fine with vendored dependencies on Azure, but this one, was a Node app previously is simply not working at all.

我什至尝试从 deploy.cmd 中注释依赖项获取器,因为所有这些都是本地的,因此不需要此步骤.但是,即使那样也行不通,因为 go build 未能抱怨依赖项不存在.它位于供应商文件夹中,并且cmd文件和应用程序应用程序设置中的 GO15VENDOREEXPERIMENT 设置为1.

I even tried to comment the dependencies getter from the deploy.cmd, since all are local this steps is not required. But even that did not work, because the go build failed complaining about the dependency not being there. It's on the vendor folder and GO15VENDOREEXPERIMENT is set to 1 in the cmd file and in the app application settings.

那我在这里有什么选择?

So what are my option here?

我如何告诉Kudu使用Go默认部署,也许Azure的部署可以工作,因为我的其他应用没有本地 .deployement deploy.cmd 文件.

How can I tell Kudu to use a Go default deployment, maybe the one from Azure will work, since my other app do not have local .deployement and deploy.cmd files.

编辑

我刚刚将测试部署到一个全新的Azure Web应用程序中,并且该应用程序默认情况下被检测为Node应用程序.我猜想这是由于根目录下存在package.json所致,我也有一个main.go,其中以 package main 作为包名称.

I just did a test deploy to a completely new Azure web app, and the app is detected as a Node app by default. I would guess it's due to the presence of a package.json at the root, I also have a main.go that has package main as package name.

那么也许仅仅是 azure站点部署脚本生成的 deploy.cmd 不是最新的还是什么?(由于一开始我没有--go标志,所以我更新了Azul-cli的版本,以供参考.)

So maybe it's just the deploy.cmd that is generated by azure site deploymentscript that is not up-to-date or something? (I updated my verison of the azure-cli just FYI, since at first I did not had the --go flag).

为完整起见,这是在新创建的应用程序上部署时Kudu的输出,它得到与Node one相同的错误:

Just for completeness here's the output of Kudu when deploying on a freshly created app, getting same error as the Node one:

<代码>远程:解决依赖关系远程:#cd.;git clone https://github.com/org/mypkg D:\ local \ Temp \ 8d3397e1e014401 \ gopath \ src \ github.com \ org \ mypkg远程:构建Go应用以生成exe文件远程:克隆到'D:\ local \ Temp \ 8d3397e1e014401 \ gopath \ src \ github.com \ org \ mypkg'...远程:致命:无法读取"https://github.com"的用户名:错误的文件描述符远程:包github.com/org/pkg/lib:退出状态128远程:azureapp \ main.go:3:8:在以下任何位置均找不到软件包"github.com/org/pkg/lib":远程:D:\ local \ Temp \ 8d3397e1e014401 \ gopath \ src \ azureapp \ vendor \ github.com \ org \ pkg \ lib(供应商树)远程:复制文件以进行部署远程:D:\ Program Files \ Go \ 1.5.3 \ src \ github.com \ org \ pkg \ lib(来自$ GOROOT)远程:D:\ local \ Temp \ 8d3397e1e014401 \ gopath \ src \ github.com \ org \ pkg \ lib(来自$ GOPATH)远程:KuduSync.NET从:'D:\ home \ site \ repository'到:'D:\ home \ site \ wwwroot'远程:找不到D:\ home \ site \ repository \ azureapp.exe远程:复制web.config远程:web.config已存在.跳过远程:成功完成.远程:运行部署后命令(多个)...远程:部署成功.

为什么要克隆该库,此处的第二行可能是导致整个问题的原因:

Why is it trying to clone the library, this line here [second line] is probably what cause the entire issue:

远程:#cd.git clone https://github.com/org/mypkg

为什么如果设置了 SET GO15VENDOREXPERIMENT = 1 ,它试图克隆依赖项?在我的其他Go应用程序上没有这样做.

Why if SET GO15VENDOREXPERIMENT=1 is set it is trying to clone the dependency? It's not doing that on my other Go app.

推荐答案

不确定是什么原因导致这种状态,但请尝试以下操作:

Not sure what caused that state, but try the following:

  • 转到 Kudu控制台
  • 进入 D:\ home \ site \ deployments \ tools 文件夹
  • 删除 deploy.cmd deploymentCacheKey
  • 尝试伪装

这篇关于如何在Azure上重置Kudu缓存的部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆