Visual Studio 2015 Publish WebJobs Issue

后端 未结 4 1710
独厮守ぢ
独厮守ぢ 2021-01-04 19:36

Using the right-click, Publish as Azure WebJob... option in VisualStudio 2015, the job is published however the runMode seems to be ignored.

In my file, I have the f

相关标签:
4条回答
  • 2021-01-04 19:49

    Based off of the error, the issue is that you must be logged into Cloud Explorer within Visual Studio for the job to be scheduled properly.

    The job will still publish if you are not logged in, however it will only be available OnDemand.

    0 讨论(0)
  • 2021-01-04 19:50

    On my case even though I'm already logged into Cloud Explorer I still get the same error.

    I have the latest Azure SDK for .NET (VS 2015) installed as of writing. I had to update my NuGet package Microsoft.Web.WebJobs.Publish from version 1.0.2 to the latest version which is 1.0.10. NuGet Package Upgrade

    Then finally the web job was published successfully!

    0 讨论(0)
  • 2021-01-04 20:00

    There is now a better way of scheduling WebJobs using CRON expressions, which is simpler and avoids all the Scheduler issues mentioned here.

    To use it, do the following:

    • Your Azure Web App must be running in Standard mode, and have 'Always On' enabled.
    • When creating your WebJob in Visual Studio, choose 'Run on Demand' instead of 'Run on a Schedule'.
    • Create a settings.job file at the root of your WebJob. Make sure to set Copy to Output Directory='Copy if newer'. This file should contain something like this (which makes it run on the top of each hour):

    { "schedule": "0 0 * * * *" }

    For more information, about this technique, see the following links:

    https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduledCRON

    http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/

    0 讨论(0)
  • 2021-01-04 20:09

    When deploying for Visual Studio, check the Output Window. You should see that it builds your project, and then it will seem to have finished. About 30-90 seconds later, you will see any errors that may occur with the scheduling part of the deployment. You will also see them in the "Azure App Service Activity" window, which will give you a full log of the deployment.

    As there's quite a delay where nothing seems to be happening while it deploys, it's easy to miss any error message that may occur. If you see an error, post it here and we can debug further. Thanks.

    0 讨论(0)
提交回复
热议问题