I have a two net core console apps that I deploy to Azure as web jobs using visual studio.
<Project Sdk="Microsoft.NET.Sdk;Microsoft.NET.Sdk.Publish">
It works well, when I publish them separately.
I have tried create webproject/properties/webjob-list.json
. Paths are relative to webproject/webproject.csproj:
{
"$schema": "http://schemastore.org/schemas/json/webjobs-list.json",
"WebJobs": [
{
"filePath": "../PeopleWebJob/PeopleWebJob.csproj"
},
{
"filePath": "../Reminder/ReminderWebJob.csproj"
}
]
}
I've also tried to install Microsoft.Web.WebJobs.Publish
nuget, but it looks like this approach is not working for .NET Core.
Alternativelly,
I've tried to dotnet publish
the WebJob project and copy the output to $(Build.ArtifactStagingDirectory)/webproject.zip/App_Data/jobs/Triggered
Deploy to Azure App ServiceIn Solution Explorer, right-click the project and select Publish. In the Publish dialog box, select Azure for Target, and then select Next. Select Azure WebJobs for Specific target, and then select Next. Above App Service instances select the plus (+) button to Create a new Azure WebJob.
It is not supported for VS to deploy WebJobs along with .NET Core Apps yet.
This is a similar issue, you could refer to it. To publish the webjobs via VSTS, you could refer to this link.
Besides, you can also zip it up and use the Azure Portal to create the WebJob or use Kudu Console or FTP to do it.
Since you copy the necessary output to webproject.zip/App_Data/jobs/Triggered
(do not zip published web project during dotnet publish, then copy files and zip files through Archive Files task), you just need to publish the project through Azure App Service Deploy task.
Package or folder: {the website zip file}
Check Publish using Web Deploy option in Additional Deployment Options section
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With