Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset Kudu cached deployment on Azure

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:

Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --node --sitePath "D:\home\site\repository"').

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

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

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.

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

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.

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.

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?

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.

Edit

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.

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).

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

remote: Resolving dependencies remote: # cd .; git clone https://github.com/org/mypkg D:\local\Temp\8d3397e1e014401\gopath\src\github.com\org\mypkg remote: Building Go app to produce exe file remote: Cloning into 'D:\local\Temp\8d3397e1e014401\gopath\src\github.com\org\mypkg'... remote: fatal: could not read Username for 'https://github.com': Bad file descriptor remote: package github.com/org/pkg/lib: exit status 128 remote: azureapp\main.go:3:8: cannot find package "github.com/org/pkg/lib" in any of: remote: D:\local\Temp\8d3397e1e014401\gopath\src\azureapp\vendor\github.com\org\pkg\lib (vendor tree) remote: Copy files for deployment remote: D:\Program Files\Go\1.5.3\src\github.com\org\pkg\lib (from $GOROOT) remote: D:\local\Temp\8d3397e1e014401\gopath\src\github.com\org\pkg\lib (from $GOPATH) remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot' remote: Could Not Find D:\home\site\repository\azureapp.exe remote: Copy web.config remote: web.config already existed. Skip remote: Finished successfully. remote: Running post deployment command(s)... remote: Deployment successful.

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

remote: # cd .; git clone https://github.com/org/mypkg

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

like image 724
Dominic St-Pierre Avatar asked Dec 25 '22 09:12

Dominic St-Pierre


1 Answers

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

  • Go to Kudu Console
  • Got into the D:\home\site\deployments\tools folder
  • Delete deploy.cmd and deploymentCacheKey
  • Try depoying
like image 97
David Ebbo Avatar answered Jan 08 '23 16:01

David Ebbo