New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing webjobs alongside an asp.net core site #1407
Comments
@vijayrkn we should discuss this at some point - should the existing webjobs tooling continue to work for .net core based webjobs projects. |
we have tooling support for publishing .NETcore webjobs. it does not use the package Microsoft.Web.WebJobs.Publish but uses the inbuilt websdk. e.g: https://github.com/vijayrkn/ASPNetPublishSamples/blob/master/Publish.cmd#L174 |
@vijayrkn Is there a way to package multiple projects into a single zip file? I can create a folder for kudu containing the site and webjobs but I'd like to build & package the project on AppVeyor which requires everything to be in the same web deploy file. |
@xt0rted - Currently websdk only supports packaging individual projects to its own web deploy packages. You should be able to publish all the artifacts to a single folder and use msdeploy.exe to package everything together. |
Are there any plans to add support for .NET Core to Microsoft.Web.WebJobs.Publish? In the meantime, has anything changed in the last few months or is the current recommended practice still overriding and customizing the deployment scripts? |
It's my understanding that webjob publishing is now handled by <PropertyGroup>
<IsWebJobProject>true</IsWebJobProject>
<WebJobName>MyJob1</WebJobName>
<WebJobType>Continuous</WebJobType> <!-- Continuous or Triggered -->
</PropertyGroup> Once those changes are made you'll be able to call msbuild and output the results to a folder of your choosing. Since originally asking about this I've moved my build script over to Cake. I'm now packing my site and tasks up up like so: Task("Package")
.IsDependentOn("PackagePrep")
.IsDependentOn("Compile")
.Does(() =>
{
var msBuildsettings = new DotNetCoreMSBuildSettings
{
MaxCpuCount = -1,
NoLogo = true,
};
msBuildsettings.WithProperty("PublishUrl", MakeAbsolute(paths.ArtifactsDeploy).FullPath)
.WithProperty("DeployOnBuild", "true")
.WithProperty("Configuration", configuration) // release
.WithProperty("WebPublishMethod", "FileSystem")
.WithProperty("DeployTarget", "WebPublish")
.WithProperty("AutoParameterizationWebConfigConnectionStrings", "false")
.WithProperty("SolutionDir", ".");
DotNetCoreMSBuild(paths.HomepageProject, msBuildsettings);
foreach (var project in paths.TaskProjects)
{
DotNetCoreMSBuild(project.FullPath, msBuildsettings);
}
Zip(paths.ArtifactsDeploy, $"{paths.Artifacts}/wwwroot.zip");
}); If you want to do this with the command line then calling
@vijayrkn has an example of doing this more like how the |
Thanks for following up with how you're doing it now, I appreciate it. I'm not sure what the .csproj file adds if you still have to turn around and modify the deployment files to run msbuild? I was able to update the deployment files directly following the steps here: https://hajekj.net/2017/02/20/deploying-asp-net-core-along-with-a-webjob-to-app-service/ |
The first method requires calling The second method works exactly like This is purely an implementation detail but I don't like having to add each webjob to my website project. I had the same complaint with the old tooling and the My Cake script was part of a larger piece of work to simplify my build process while also letting me build & package the site from anywhere. I'm also not a fan of writing batch files or powershell scripts. Now I let AppVeyor handle PR and production builds instead of kudu which lightens the load on my app service vm and shortens my build times by at least half (running on an S2 instance). AppVeyor then triggers a Zip Push deploy and the rest of the process, warmup, deployment slots, etc., stays the same. |
Thanks for the explanation, appreciated. 👍 |
I have a classic asp.net site with various webjobs that use Microsoft.Web.WebJobs.Publish to help package everything up during the build which makes deploying with kudu really easy. Is there a replacement for this that works with .net core? I'd like to start migrating this project but I'm unsure how to handle the webjobs side of it.
The text was updated successfully, but these errors were encountered: