azure-webjobs

Azure WebJob Multiple executables

江枫思渺然 提交于 2020-01-05 10:09:00
问题 I am creating a WebJob (console executable). This .exe invokes one of the configured plug-ins which are in the form of executable again. So, when I deploy a WebJob, it contains 3 or more executable. Is there a way to execute only one .exe as a WebJob and block the execution of other .exe ? Thanks in advance 回答1: The best thing to do here is to also include a run.cmd file at the root of your WebJobs files, and have it just be a one-liner that runs whichever exe you want. Once you do that, only

Using an Azure WebJob to read from an EventHub

我的梦境 提交于 2020-01-05 06:01:27
问题 I am trying to consume EventHub messages from a WebJob, without avail. The job builds and runs without throwing any exceptions, but the trigger is never called. I am referencing Microsoft.Azure.WebJobs, Microsoft.Azure.WebJobs.Extensions and Microsoft.Azure.WebJobs.ServiceBus v2.0.0.0-beta2. Here's my code: Program.cs: public static void Main() { var eventHubConfig = new EventHubConfiguration(); string eventHubName = "myHub"; eventHubConfig.AddReceiver(eventHubName, "Endpoint=sb://xxxx

Using an Azure WebJob to read from an EventHub

。_饼干妹妹 提交于 2020-01-05 06:00:27
问题 I am trying to consume EventHub messages from a WebJob, without avail. The job builds and runs without throwing any exceptions, but the trigger is never called. I am referencing Microsoft.Azure.WebJobs, Microsoft.Azure.WebJobs.Extensions and Microsoft.Azure.WebJobs.ServiceBus v2.0.0.0-beta2. Here's my code: Program.cs: public static void Main() { var eventHubConfig = new EventHubConfiguration(); string eventHubName = "myHub"; eventHubConfig.AddReceiver(eventHubName, "Endpoint=sb://xxxx

Azure WebJobs Table Trigger

浪子不回头ぞ 提交于 2020-01-05 04:19:07
问题 As usual, what should be simple NEVER is. There are 5 billion examples of binding to BLOBs and queues, but I cannot find anything which works for binding to Tables. I have a table named Foo, which I add data to (PK and RK) via Azure Storage Explorer while the webjob is running and the trigger never gets hit. Here is the method living in Functions.cs which is recognized upon webjob start: public static void ReadTable([Table("Foo")] ICollector<TableEntity> tableBinding, TextWriter logger) This

How do I get the name of the input blob of my Azure WebJob?

做~自己de王妃 提交于 2020-01-04 14:28:52
问题 I'm using the new Azure WebJobs feature and have a simple trigger when a new file comes into one of by blobs: public static void ProcessImportFile([BlobInput("importjobsdata/{name}")] TextReader input, [BlobOutput("importjobslog/log_{name}")] TextWriter writer) { writer.WriteLine("Starting import file process..."); var result = InputData(input, writer); var status = result == 0 ? "SUCCESS" : "FAIL"; var message = result == 0 ? "Import success." : "Import fail. " + result + " records failed to

Continuous Azure WebJob with Http Triggered Functions

霸气de小男生 提交于 2020-01-03 10:20:15
问题 I currently have an azure webjob that performs a daily sync from one database to another, but would like to add the ability to manually trigger the sync as well. I have set up the functions as follows in the webjob project: public static void SyncData([TimerTrigger("0 0 5 * * *", RunOnStartup = false)] TimerInfo timerInfo) { } [NoAutomaticTrigger] public static Task SyncAll(TraceWriter log){ } [NoAutomaticTrigger] public static Task SyncBranches(TraceWriter log){ } [NoAutomaticTrigger] public

.NET Core WebJob configuration in Azure App Service

点点圈 提交于 2020-01-03 03:16:09
问题 I've written web job as .NET Core Console Application (exe), that has appsettings.json. How do I configure the WebJob in Azure? Basically I want to share some settings like connection string with the web app, that is configured trough App Service's Application Settings. 回答1: The way to get these settings from our ASP.NET Core is accessing to the injected environment variables. Hence we have to load these environment variables into our Configuration in the Startup.cs file: public Startup

Limit number of instances of an azure webjob when scaling out

*爱你&永不变心* 提交于 2020-01-02 10:07:20
问题 I would like to limit the number of instances of a particular webjob when our app service plan scales out. Whilst I am aware of the possibility of having a singleton instance I cannot find any docs to help if we want to limit the number of instances to n where n is a number greater than 1 but less than the total number of instances in the app service plan. For example our app service plan could scale out to be running 4 instances but only a maximum of 2 of them would be allowed to be running

CancellationToken doesn't get triggered in the Azure Functions

房东的猫 提交于 2020-01-02 05:30:27
问题 I've got this simple Azure Function: public static class MyCounter { public static int _timerRound = 0; public static bool _isFirst = true; [FunctionName("Counter")] //[TimeoutAttribute("00:00:05")] public async static Task Run([TimerTrigger("*/10 * * * * *")]TimerInfo myTimer, TraceWriter log, CancellationToken token) { try { log.Info($"C# Timer trigger function executed at: {DateTime.UtcNow}"); if (_isFirst) { log.Info("Cancellation token registered"); token.Register(async () => { log.Info(

Separate schedules for Azure webjob functions?

£可爱£侵袭症+ 提交于 2020-01-02 05:03:51
问题 Is it possible to set up separate schedules for individual non-triggered functions in an Azure webjob? I ask because I have half a dozen individual tasks I'd like to run at different times of the day and at different intervals and don't want to create a separate project for each. 回答1: Yes you can using the TimerTriggerAttribute Azure WebJobs SDK Extensions nuget download page Here is a sample code: public class Program { static void Main(string[] args) { JobHostConfiguration config = new