- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 MVC 网站,该网站发布到 Azure,并在其中使用 Azure SQL 数据库。
我们需要运行计划任务来发送短信提醒。我的印象是 Azure Web Jobs 非常适合此任务,但在启动和运行它时遇到了一些问题。
我已将控制台应用添加到我的网站解决方案中,并由控制台应用中的 EF 数据模型引用(我想将其发布为 Web 作业)。
当前的控制台应用程序如下所示:
class Program
{
static void Main(string[] args)
{
JobHost host = new JobHost();
host.RunAndBlock();
}
public static void ProcessNotifications()
{
var uow = new KirkleesDatabase.DAL.UnitOfWork();
uow.CommunicationRepository.SendPALSAppointmentReminders();
}
}
运行控制台应用程序将引发异常:
Additional information: User account connection string is missing. This can be set via the 'AzureJobsData' connection string or via the constructor.
这表明 Web 作业专门寻找指向存储帐户的连接字符串。但是,我希望 Web 作业查询 Azure 数据库而不是使用存储。
这可行吗?
谢谢
最佳答案
正如 Victor 所写,sdk 事件由 blob、队列和表触发。
满足您需求的简单解决方案:使用 pollig 方法编写控制台应用程序。无需 SDK。详情见http://blog.amitapple.com/post/73574681678/git-deploy-console-app/开头
while(true)
{
if ("isthereworktodo?")
{
var uow = new KirkleesDatabase.DAL.UnitOfWork();
uow.CommunicationRepository.SendPALSAppointmentReminders();
}
Thread.Sleep(10000); // set an appropriate sleep interval
}
关于Azure Web 作业 - 如何连接到 Azure MS SQL 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21758043/
我正在开发一个 voip 调用应用程序。我需要做的是在接到来电时将 Activity 带到前台。我在应用程序中使用 Twilio,并在收到推送消息时开始调用。 问题是我试图在接到任何电话时显示 Act
我是一名优秀的程序员,十分优秀!