Scheduled Tasks with Sql Azure?

前端 未结 4 546
忘掉有多难
忘掉有多难 2020-12-19 09:28

I wonder if there\'s a way to use scheduled tasks with SQL Azure? Every help is appreciated.

The point is, that I want to run a simple, single line statement every

4条回答
  •  北海茫月
    2020-12-19 10:09

    The overcome the issue of multiple roles executing the same task, you can check for role instance id and make sure that only the first instance will execute the task.

    using Microsoft.WindowsAzure.ServiceRuntime;
    
            String g = RoleEnvironment.CurrentRoleInstance.Id;
            if (!g.EndsWith("0"))
            {
                return;
            }
    

提交回复
热议问题