加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Microsoft Azure,Webjob,如果我使用cron表达式安排webjob在指定

发布时间:2020-12-13 22:40:39 所属栏目:Windows 来源:网络整理
导读:我安排了一个webjob每天凌晨2点使用cron表达式(0 0 2 * * *)按照 Create a scheduled WebJob using a CRON expression的教程运行 我的服务器是在“美国中北部”地区创建的,所以我希望它应该在美国中部时区运行,但它似乎在不同于我指定的时间运行. 根据 here
我安排了一个webjob每天凌晨2点使用cron表达式(0 0 2 * * *)按照 Create a scheduled WebJob using a CRON expression的教程运行
我的服务器是在“美国中北部”地区创建的,所以我希望它应该在美国中部时区运行,但它似乎在不同于我指定的时间运行.
根据 here提到的注释,WebJobs会进入为WebApp托管的WebApp配置的时区.从这篇文章:

假设您尚未为时区配置任何内容,则您的cron作业应使用UTC,这是Azure中的默认时区.

Changing the server time zone on Azure Web Apps开始,您可以通过创建名为WEBSITE_TIME_ZONE的应用程序设置并将其设置为正确的值来指定您希望应用程序运行的时区.来自这篇博文:

If your app is hosted as a Web App on the Azure App Service (formerly
known as Azure Websites),until recently you were completely out of
luck. However there is now an easy and supported way to change the
time zone for your w3wp process (and any processes it spawns):

All you need to do is add an Application Setting (via the portal or the management APIs) called WEBSITE_TIME_ZONE and set that to the name of the time zone as defined in the Windows Registry under HKLMSoftwareMicrosoftWindows NtCurrentVersionTime Zones (for example,“AUS Eastern Standard Time”).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读