Skip to content
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

publish WebJob as a netcoreapp application #745

Open
SergeyRudakov opened this issue Jun 8, 2016 · 23 comments
Open

publish WebJob as a netcoreapp application #745

SergeyRudakov opened this issue Jun 8, 2016 · 23 comments
Assignees
Milestone

Comments

@SergeyRudakov
Copy link

Hello,
I would like to publish a WebJob from .NET Core console app.
It seems that Microsoft.Azure.WebJobs doesn't support Microsoft.NETCore.App 1.0 and there is no "Publish as Azure WebJob..." support from VS 2015.
Let me know, what would be the proper way to deploy .Net core app as a WebJob?

Here is my frameworks section:

 "frameworks": {

    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  }

Thanks,

@SergeyRudakov
Copy link
Author

SergeyRudakov commented Jun 9, 2016

I was able to run the app somehow but only through manual Kudu copy.

However it seems standard WebJob features are not supported because Microsoft.Azure.WebJobs is not compatible with netcoreapp framework. Is there any plans to this port WebJobs SDK and provide VS integration?

@christopheranderson
Copy link
Contributor

dotnet core support is a goal, but we have no plans for it yet. We'll consider this after WebJobs 2.0.0 is rtm'd.

@PaulMouchet
Copy link

Is there any sort of ETA on when WebJobs might be able to support .NetCore? In the meantime though, how would you suggest implementing a webjob-like process using .NetCore?

@davidebbo
Copy link

To clarify, Azure WebJobs that use .NET Core work fine. It's specifically the use of the WebJobs SDK that is not yet supported.

@PaulMouchet
Copy link

Yes. My question was so poorly worded I'm not really sure what the heck I was thinking. Any ETA on when the SDK will be supported? Is there a REST API similar to what is available for the Service Bus?

@christopheranderson
Copy link
Contributor

We don't have an ETA on this. Not this year, likely.

@DreamingDevs
Copy link

@christopheranderson Can we know what is the alternative solution?

@jonsagara
Copy link

Hi,

It has been a while since the last update. Do you have any sort of ETA or road map for .NET Core support?

Thanks!

@paulbatum
Copy link
Member

Investigation work for Azure Functions on .NET Core is now in progress and of course since Functions is built on WebJobs, it is included in the effort. You can track the latest here:
Azure/Azure-Functions#98

@tbertenshaw
Copy link

since SDK V2 has now been released (https://github.com/Azure/azure-webjobs-sdk/releases/tag/v2.0.0), does the SDK support dotnetcore webjobs? And are there any examples/or visualstudio project templates?

@ggirard07
Copy link

Any update on this as .Net Core support is now here with v3.0.0?
Trying to publish a webjob ported to netcoreapp2.1 with webjobs SDK 3.0.0 but can't figure out the proper to get it published right...

@paulbatum
Copy link
Member

paulbatum commented Oct 2, 2018

If you grab the latest tools as described in the prerequisites section of this doc (it applies for both webjobs and functions) then you should be able to just rightclick publish in VS. The extra ".Publish" NuGet is no longer required.

This was incorrect, sorry.

@davidebbo
Copy link

@ggirard07
Copy link

ggirard07 commented Oct 2, 2018

@davidebbo I am the author of the StackOverflow question
@paulbatum actually it helped a lot in some sort! by following your instructions, I created another publish profile which solved my issue. I don't know why but first profile I created did not update my .csproj to add the ;Microsoft.NET.Sdk.Publish reference in Project tag.

By following your instructions, I selected the Publish option in the wizard instead of Create profile which I think is what updated my .csproj this time.

With the added reference to ;Microsoft.NET.Sdk.Publish publish is working perfectly and Kudu pick ups my webjo and start it in Continuous mode as configured.

@davidebbo
Copy link

@ggirard07 Yes, I know the question was from you. But it's important to keep things linked (in both direction) so that all the context can easily be found from either place.

@vijayrkn, you probably understand this better than anyone else, so it would be great of you could shed some light on where things stand with the ability to publish Core WebJobs from VS. Thanks!

@vijayrkn
Copy link

vijayrkn commented Oct 2, 2018

As mentioned in the StackOverflow answer, there is support in VS for publishing .NET Core webjobs. It just works like any other publish operation.

Right click on a .NET core app -> Publish > Create/Select App Service & Publish. This should push the WebJobs to Azure.

The tooling also enables support for Scheduling jobs. Just open the Settings.job file in the project and uncomment/update the schedule as needed.

@ggirard07
Copy link

ggirard07 commented Oct 2, 2018

@vijayrkn As explained in my previous post, if during the wizard to create publish profile you select "Create profile" instead of "Publish immediately" then the project file is not updated properly and publish does nothing.

The steps you described create a 'Triggered' webjobs which is not the behavior I need. I need my webjobs to be Continuous. In that case it makes sense to only create the profile and not deploy it immediately, resulting in the .csproj not being updated properly. Also note in that case Settings.job is useless.

My version of Visual Studio is 15.8.5.

@vijayrkn
Copy link

vijayrkn commented Oct 2, 2018

@ggirard07 - The SDK attribute is added at the time of first publish. So it should work for both Continuous and triggered. I just tried both 'Publish immediately' and 'create profile' and both scenarios worked when I clicked publish from VS.

After creating the profile from VS, are you publishing from a different location outside VS?

@ggirard07
Copy link

@vijayrkn Indeed, retested locally and everything is updated properly now... I can't understand what happened the first time. I had build errors in my output related to VSTS package feed returning 401 unauthorized despite no packages coming from that feed. Don't know whether this could have had some impacts.

I have a bunch of remaining webjobs to update, will notify you if it happens again. Sorry for the inconvenience.

@vijayrkn
Copy link

vijayrkn commented Oct 2, 2018

@ggirard07 - No problem. Glad to know that it is working for you. Let us know if you run into any issues.

@ggirard07
Copy link

@vijayrkn actually I just ran into an issue related to the fact webjobs publishing now rely on a publish profile. Locally everything is working fine. How do you handle CI on platforms like VSTS?

Publish profile are not added to the source code and should not in that case as the same build artifact is going to be deployed to multiple environments anyway. Currently my VSTS build basically generates an empty project package (contains only the base folder obj\Release\netcoreapp2.1\PubTmp\Out which remains empty).

Is there any ways to provide msbuild parameters now defined in the publish profile directly in the csproj? Aim is to start the build command on the solution to build multiple webjobs at the same time.

@ggirard07
Copy link

@vijayrkn just found your blog article along with some of your samples.

Those confirm it is no longer possible to run the build on a solution to produce all required artifacts (for example a WebAPI project with multiple WebJob projects) in a single build. Instead each webjob project must be built in separate MSBuild invocation.

Can you confirm this breaking change is intended prior to review how to update our current CI?

@vijayrkn
Copy link

How do you handle CI on platforms like VSTS?

You can add any property in the pubxml to csproj (pubxml is simply an msbuild file). Also, you can check in the pubxml file. It should not contain any authentication info.

The decision to not combine the publishing for WebApps and WebJobs (for Sdk style projects) was deliberate. Since the publishing process for the WebJob project is just msbuild based, it should be just similar to how the Web App is published.

https://github.com/aspnet/websdk/issues/296 - I have created an item here to make this experience better. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants