创建WebJob计划时发生错误

时间:2021-01-21 18:25:38

I an trying to publish my website along with few WebJobs but after the website and the jobs are created on the Azure Website, I see an error on the VS.NET 2013 that says:

我试图发布我的网站以及一些WebJobs,但在Azure网站上创建网站和作业后,我看到VS.NET 2013上的一个错误:

Error   948 An error occurred while creating the WebJob schedule: No website could be found which matches the WebSiteName [mysitename] and WebSiteUrl [http://mysitename.azurewebsites.net] supplied

my website has 2 WebJobs, 1 that runs continuously and it's created and running, but the one that needs to be triggered on a schedule is having this problem.

我的网站有2个WebJobs,1个连续运行并且已经创建并运行,但是需要按计划触发的那个就是这个问题。

Any ideas as to what may be wrong here?

关于这里可能有什么问题的任何想法?

Edit 1

编辑1

Just wanted to add that the Scheduled Job is getting created as "On Demand"

只想添加计划作业创建为“按需”

here is the settings for publishing I am using :

这是我正在使用的发布设置:

{
  "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
  "webJobName": "ArchiveShipments",
  "startTime": "2015-01-11T00:00:00+05:30",
  "endTime": null,
  "jobRecurrenceFrequency": "Day",
  "interval": 1,
  "runMode": "Scheduled"
}

BTW after i applied AzureSDK. 2.5 I don't see any error on publishing, but the scheduled WebJob is not getting created.

我应用AzureSDK后BTW。 2.5我发布时没有看到任何错误,但是没有创建预定的WebJob。

9 个解决方案

#1


51  

For me this happened when I switched from deploying to one Azure account to another account. In Visual Studio, open/expand the Server Explorer side-window, right click on Azure, select "Connect to Microsoft Azure Subscription...". You'll be asked to logout and login with new credentials. 创建WebJob计划时发生错误

对我来说,当我从部署到一个Azure帐户切换到另一个帐户时,就发生了这种情况。在Visual Studio中,打开/展开Server Explorer侧窗口,右键单击Azure,选择“连接到Microsoft Azure Subscription ...”。系统会要求您注销并使用新凭据登录。

#2


10  

If you get this error when publishing from PowerShell, it probably means you are not logged into to your azure subscription or logged into the wrong subscription. If the browser is not prompting for your credentials, it's probably using the wrong subscription. If does not ask for login, clear the cookies and try again.

如果从PowerShell发布时出现此错误,则可能表示您未登录到您的azure订阅或登录错误的订阅。如果浏览器没有提示您输入凭据,则可能使用了错误的订阅。如果没有要求登录,请清除cookie并再试一次。

#3


2  

I had this problem when trying to publish my webjob to a deployment slot.

尝试将我的webjob发布到部署插槽时遇到此问题。

The webjob got published, but the website was not found when trying to hook up the schedule.

webjob已发布,但在尝试连接时间表时未找到该网站。

I was able to go around this by doing 1 manual publish through the portal, and setting the schedule there. After that i could just publish from VS, and the schedule would remain untouched.

通过门户网站进行1次手动发布,并在那里设置时间表,我能够解决这个问题。之后,我可以从VS发布,并且时间表将保持不变。

#4


1  

I have spent all day on this. The solution for me was to do a manual deployment of the web job via uploading a ZIP and scheduling it as desired. Then, in VS, I did Add Existing Project as Web Job and publishing the Web Site updates the scheduled Web Job as expected.

我整天都在这上面。对我来说,解决方案是通过上传ZIP并根据需要安排来手动部署Web作业。然后,在VS中,我将Add Existing Project添加为Web作业,并且发布Web站点按预期更新计划的Web作业。

#5


1  

After recent updates, something changed. I was unable to publish to any of my subscriptions where I had a scheduled job. After much digging around, the solution is as follows: - Right click solution and Manage NuGet Packages for Solution - Change all Web Publish modules down to version 1.0.3

最近的更新后,有些事情发生我无法发布到我预定工作的任何订阅中。经过深入挖掘后,解决方案如下: - 右键单击​​解决方案并管理解决方案的NuGet包 - 将所有Web发布模块更改为版本1.0.3

Publish. Problem solved.

发布。问题解决了。

#6


1  

Tried everything here and still had the same issue but I managed to resolve by doing the following:

在这里尝试了一切,仍然有同样的问题,但我设法通过执行以下操作来解决:

I have a package called Microsoft.Web.WebJobs.Publish installed which was running an old version (1.0.3). I updated to the latest, currently 1.10.12, and then the app and webjob/schedule published first time.

我有一个名为Microsoft.Web.WebJobs.Publish的软件包,它运行的是旧版本(1.0.3)。我更新到最新的,目前是1.10.12,然后是第一次发布的app和webjob / schedule。

#7


1  

I ran into this again in VS2017, and the root cause was the deprecation of the VS Azure Scheduler integration feature. Per David Ebbo's recommendation in the linked thread, I converted my webjobs to use the CRON scheduling feature and publish now works as expected. Note that the Always On setting must be enabled on the app.

我在VS2017中再次遇到此问题,其根本原因是VS Azure Scheduler集成功能的弃用。根据David Ebbo在链接线程中的建议,我将我的webjobs转换为使用CRON调度功能,现在发布按预期工作。请注意,必须在应用程序上启用“始终开启”设置。

Some more debugging options if you're encountering this:

如果你遇到这个问题,还有一些调试选项:

  • Make sure the correct publish profile (pubxml) file is being used. I had several publish profiles files for the same webjob and tried publishing with the wrong one by mistake.

    确保使用正确的发布配置文件(pubxml)文件。我有几个针对同一个webjob的发布配置文件,并试图错误地使用错误的发布。

  • I suggest trying first to publish the webjobs separately, one by one (rather than publish them all alongside the website).

    我建议先尝试一个一个地分开发布webjobs(而不是将它们全部发布到网站旁边)。

  • If you can't get a webjob to publish, delete its Properties\PublishProfiles folder and try to publish again - you'll be greeted with a VS wizard that should get you sorted (it will recreate the pubxml files correctly).

    如果您无法获取要发布的webjob,请删除其Properties \ PublishProfiles文件夹并尝试再次发布 - 您将看到一个VS向导,它应该让您排序(它将正确地重新创建pubxml文件)。

#8


0  

Try updating to Version 2.9 of the Azure SDK, which fixes a related issue:

尝试更新到Azure SDK的2.9版,该版本修复了相关问题:

Repaired issue related to Scheduled WebJobs in which the authentication information was failing to be passed to the Scheduler provisioning process

修复了与计划WebJobs相关的问题,其中身份验证信息未能传递到计划程序配置过程

(https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx)

(https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx)

EDIT:

编辑:

I ultimately gave up using this scheduler, and switched to the Kudu Scheduler (Internal WebJob Scheduler). See: https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

我最终放弃使用这个调度程序,并切换到Kudu Scheduler(内部WebJob调度程序)。请参阅:https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

It is actually easier to set up. All you need to do is add a settings.json file to the webjob with the following contents: {"schedule": "the schedule as a cron expression"}

它实际上更容易设置。您需要做的就是将settings.json文件添加到webjob,其中包含以下内容:{“schedule”:“将计划作为cron表达式”}

The pros and cons of using the using the Azure Scheduler vs the Kudu Scheduler are discussed here: http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.Vz4sk5ErJaQ

下面讨论使用Azure Scheduler与Kudu Scheduler的利弊:http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.Vz4sk5ErJaQ

An important limitation not mentioned in that blog post is that creating a schedule more frequent than hourly is not supported on the free tier of the scheduler (which you are probably using if you haven't intentionally changed it, as it is separate from the app service tier). This is what finally drove me to the Kudu scheduler, as I needed to schedule my job to run every 15 minutes

该博客文章中未提及的一个重要限制是,在调度程序的免费层上不支持创建比每小时更频繁的调度(如果您没有故意更改它,可能正在使用它,因为它与应用程序是分开的服务层)。这最终驱使我去了Kudu调度员,因为我需要安排我的工作每15分钟运行一次

#9


0  

Updating the nuget package to the latest update, in my case 1.10.12, did the trick.

在我的情况1.10.12中,将nuget包更新到最新更新,就可以了。

HOWEVER visual studio did not manage to remove the previous package. To do this I had to restart windows, and then before opening up visual studio, deleting the folder containing the old version of webjobs.publish.

然而,视觉工作室没有设法删除以前的包。要做到这一点,我必须重新启动Windows,然后在打开visual studio之前,删除包含旧版webjobs.publish的文件夹。

This did the trick for me!

这对我有用!

#1


51  

For me this happened when I switched from deploying to one Azure account to another account. In Visual Studio, open/expand the Server Explorer side-window, right click on Azure, select "Connect to Microsoft Azure Subscription...". You'll be asked to logout and login with new credentials. 创建WebJob计划时发生错误

对我来说,当我从部署到一个Azure帐户切换到另一个帐户时,就发生了这种情况。在Visual Studio中,打开/展开Server Explorer侧窗口,右键单击Azure,选择“连接到Microsoft Azure Subscription ...”。系统会要求您注销并使用新凭据登录。

#2


10  

If you get this error when publishing from PowerShell, it probably means you are not logged into to your azure subscription or logged into the wrong subscription. If the browser is not prompting for your credentials, it's probably using the wrong subscription. If does not ask for login, clear the cookies and try again.

如果从PowerShell发布时出现此错误,则可能表示您未登录到您的azure订阅或登录错误的订阅。如果浏览器没有提示您输入凭据,则可能使用了错误的订阅。如果没有要求登录,请清除cookie并再试一次。

#3


2  

I had this problem when trying to publish my webjob to a deployment slot.

尝试将我的webjob发布到部署插槽时遇到此问题。

The webjob got published, but the website was not found when trying to hook up the schedule.

webjob已发布,但在尝试连接时间表时未找到该网站。

I was able to go around this by doing 1 manual publish through the portal, and setting the schedule there. After that i could just publish from VS, and the schedule would remain untouched.

通过门户网站进行1次手动发布,并在那里设置时间表,我能够解决这个问题。之后,我可以从VS发布,并且时间表将保持不变。

#4


1  

I have spent all day on this. The solution for me was to do a manual deployment of the web job via uploading a ZIP and scheduling it as desired. Then, in VS, I did Add Existing Project as Web Job and publishing the Web Site updates the scheduled Web Job as expected.

我整天都在这上面。对我来说,解决方案是通过上传ZIP并根据需要安排来手动部署Web作业。然后,在VS中,我将Add Existing Project添加为Web作业,并且发布Web站点按预期更新计划的Web作业。

#5


1  

After recent updates, something changed. I was unable to publish to any of my subscriptions where I had a scheduled job. After much digging around, the solution is as follows: - Right click solution and Manage NuGet Packages for Solution - Change all Web Publish modules down to version 1.0.3

最近的更新后,有些事情发生我无法发布到我预定工作的任何订阅中。经过深入挖掘后,解决方案如下: - 右键单击​​解决方案并管理解决方案的NuGet包 - 将所有Web发布模块更改为版本1.0.3

Publish. Problem solved.

发布。问题解决了。

#6


1  

Tried everything here and still had the same issue but I managed to resolve by doing the following:

在这里尝试了一切,仍然有同样的问题,但我设法通过执行以下操作来解决:

I have a package called Microsoft.Web.WebJobs.Publish installed which was running an old version (1.0.3). I updated to the latest, currently 1.10.12, and then the app and webjob/schedule published first time.

我有一个名为Microsoft.Web.WebJobs.Publish的软件包,它运行的是旧版本(1.0.3)。我更新到最新的,目前是1.10.12,然后是第一次发布的app和webjob / schedule。

#7


1  

I ran into this again in VS2017, and the root cause was the deprecation of the VS Azure Scheduler integration feature. Per David Ebbo's recommendation in the linked thread, I converted my webjobs to use the CRON scheduling feature and publish now works as expected. Note that the Always On setting must be enabled on the app.

我在VS2017中再次遇到此问题,其根本原因是VS Azure Scheduler集成功能的弃用。根据David Ebbo在链接线程中的建议,我将我的webjobs转换为使用CRON调度功能,现在发布按预期工作。请注意,必须在应用程序上启用“始终开启”设置。

Some more debugging options if you're encountering this:

如果你遇到这个问题,还有一些调试选项:

  • Make sure the correct publish profile (pubxml) file is being used. I had several publish profiles files for the same webjob and tried publishing with the wrong one by mistake.

    确保使用正确的发布配置文件(pubxml)文件。我有几个针对同一个webjob的发布配置文件,并试图错误地使用错误的发布。

  • I suggest trying first to publish the webjobs separately, one by one (rather than publish them all alongside the website).

    我建议先尝试一个一个地分开发布webjobs(而不是将它们全部发布到网站旁边)。

  • If you can't get a webjob to publish, delete its Properties\PublishProfiles folder and try to publish again - you'll be greeted with a VS wizard that should get you sorted (it will recreate the pubxml files correctly).

    如果您无法获取要发布的webjob,请删除其Properties \ PublishProfiles文件夹并尝试再次发布 - 您将看到一个VS向导,它应该让您排序(它将正确地重新创建pubxml文件)。

#8


0  

Try updating to Version 2.9 of the Azure SDK, which fixes a related issue:

尝试更新到Azure SDK的2.9版,该版本修复了相关问题:

Repaired issue related to Scheduled WebJobs in which the authentication information was failing to be passed to the Scheduler provisioning process

修复了与计划WebJobs相关的问题,其中身份验证信息未能传递到计划程序配置过程

(https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx)

(https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx)

EDIT:

编辑:

I ultimately gave up using this scheduler, and switched to the Kudu Scheduler (Internal WebJob Scheduler). See: https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

我最终放弃使用这个调度程序,并切换到Kudu Scheduler(内部WebJob调度程序)。请参阅:https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

It is actually easier to set up. All you need to do is add a settings.json file to the webjob with the following contents: {"schedule": "the schedule as a cron expression"}

它实际上更容易设置。您需要做的就是将settings.json文件添加到webjob,其中包含以下内容:{“schedule”:“将计划作为cron表达式”}

The pros and cons of using the using the Azure Scheduler vs the Kudu Scheduler are discussed here: http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.Vz4sk5ErJaQ

下面讨论使用Azure Scheduler与Kudu Scheduler的利弊:http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.Vz4sk5ErJaQ

An important limitation not mentioned in that blog post is that creating a schedule more frequent than hourly is not supported on the free tier of the scheduler (which you are probably using if you haven't intentionally changed it, as it is separate from the app service tier). This is what finally drove me to the Kudu scheduler, as I needed to schedule my job to run every 15 minutes

该博客文章中未提及的一个重要限制是,在调度程序的免费层上不支持创建比每小时更频繁的调度(如果您没有故意更改它,可能正在使用它,因为它与应用程序是分开的服务层)。这最终驱使我去了Kudu调度员,因为我需要安排我的工作每15分钟运行一次

#9


0  

Updating the nuget package to the latest update, in my case 1.10.12, did the trick.

在我的情况1.10.12中,将nuget包更新到最新更新,就可以了。

HOWEVER visual studio did not manage to remove the previous package. To do this I had to restart windows, and then before opening up visual studio, deleting the folder containing the old version of webjobs.publish.

然而,视觉工作室没有设法删除以前的包。要做到这一点,我必须重新启动Windows,然后在打开visual studio之前,删除包含旧版webjobs.publish的文件夹。

This did the trick for me!

这对我有用!