Kudu: Core RC2 Webjobs don't deploy via git

Created on 31 May 2016  路  14Comments  路  Source: projectkudu/kudu

When deploying a Webjob that uses RC2 (Console App) through CI, containing a solution with more than 1 project (1 class library + 1 console) and I specify which Project to build (Application Configuration setting pointing to the Webjob xproj file), the packages don't get restored previously to the build.

Repro repo: https://github.com/ealsur/WebjobRC2/

The portal output during deployment is:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Site deployment.
  D:\Program Files (x86)\dotnet\dotnet.exe build "D:\home\site\repository\src\ClassLibrary" --configuration Debug --no-dependencies
  Project ClassLibrary (.NETFramework,Version=v4.6.1) will be compiled because expected outputs are missing
  Compiling ClassLibrary for .NETFramework,Version=v4.6.1
  Compilation succeeded.
      0 Warning(s)
      0 Error(s)
  Time elapsed 00:00:04.3499580

  D:\Program Files (x86)\dotnet\dotnet.exe build "D:\home\site\repository\src\Webjob" --configuration Debug --no-dependencies
  Project Webjob (.NETFramework,Version=v4.6.1) will be compiled because expected outputs are missing
  Compiling Webjob for .NETFramework,Version=v4.6.1
  Compilation failed.
      0 Warning(s)
      11 Error(s)
  Time elapsed 00:00:00.0150036
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.Azure.WebJobs >= 1.1.0 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.Azure.WebJobs.Core 1.1.0 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.Data.Edm 5.6.2 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.Data.OData 5.6.2 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.Data.OData >= 5.6.2 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.Data.Services.Client >= 5.6.2 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Microsoft.WindowsAzure.ConfigurationManager >= 1.8.0 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Newtonsoft.Json >= 6.0.8 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency Newtonsoft.Json >= 5.0.8 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency System.Spatial 5.6.2 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
D:\home\site\repository\src\Webjob\project.json(9,39): error NU1001: The dependency WindowsAzure.Storage >= 4.3.0 could not be resolved. [D:\home\site\repository\src\Webjob\Webjob.xproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\TestWebjobRC2.sln" /verbosity:m /nologo
An error has occurred during web site deployment.
\r\nC:\Program Files (x86)\SiteExtensions\Kudu\55.50526.2249\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

All 14 comments

The root problem is that we don't yet have support for deploying standalone Core WebJobs. But it should be relatively easy to write a custom deployment script for it. We can help with that as needed.

Thanks @davidebbo ! Do you have any tips? I can grab the current generated deploy.cmd as a start, but being a Powershell illiterate I might break the whole thing :D

Sure, I'll take a crack at it.

It's less straightforward than I thought, as the build behaves a bit funny with Core. Here is my attempt, which I think will work: https://github.com/ealsur/WebjobRC2/pull/1

But note that for regular .NET, if you git push a Console app to Kudu, we treat it as a _continuous_ WebJob, while here you're expecting a triggered job.

Also note that this approach is for when you don't want to also run a Web App.

On my real world scenario, we are using Continuous Webjobs, but to try this out on a repro repo, I didn't initialize any function :)

Thanks a lot for your time and effort!

Do you by any chance have an ETA on the native support without the custom cmd? Core RTM maybe?

Ok, search for the word 'triggered' in the script and change it to 'continuous'. You can also rename the WebJob there.

No clear ETA, but we should aim to support that.

Awesome, thanks a lot again David! You can close this issue if you want. I'll share the deployment cmd with the community in case anyone else needs to do something similar.

We can keep it open to track that we need to add the automatic support.

@davidebbo was there an update regarding this for RTM? Right now we keep deploying with a custom CMD.

Yes, the support is now in, and you should no longer need a custom script to deploy an RTM Core app (unless you have special needs).

@davidebbo We tried without the CMD and we are unable to deploy. Using the same repo I had (it is now an RTM project https://github.com/ealsur/WebjobRC2), if I don't use the custom CMD file you created, Kudu picks it up a a ".NET Web Site" and fails to restore packages. I manually added the Command setting on the Application Settings blade of the Web App pointing to the custom deploy.cmd and that's the only way of making it work.

Sorry, I responded too fast above, and didn't have the context of the thread, and missed that it was WebJobs related. This is not yet in, so I'll reactivate. My Bad!

Cleaning up old issues.

Was this page helpful?
0 / 5 - 0 ratings