azure-webjobssdk

Continuous Web Job with timer trigger and Blob trigger

江枫思渺然 提交于 2019-12-06 03:33:18
I have the following functions in the same web job console app that uses the azure jobs sdk and its extensions. The timed trigger queries an API end point for a file, does some additional work on it and then saves the file to the blob named blahinput. Now the second method "ProcessBlobMessage" is supposed to identify the new blob file in the blahinput and do something with it. public static void ProcessBlobMessage([BlobTrigger("blahinput/{name}")] TextReader input, string name, [Blob("foooutput/{name}")] out string output) {//do something } public static void QueryAnAPIEndPointToGetFile(

Basic of Azure WebJobs SDK

泄露秘密 提交于 2019-12-05 17:29:45
I would like to know about JobHostConfiguration on Azure WebJobs SDK. Where I can find the config ? is it on app.config ? How can JobHostConfiguration identified this is IsDevelopment or not ? I cannot find it on app.config What config that JobHostConfiguration read ? Thank You Where I can find the config ? is it on app.config ? Yes, it is in app.config file. You also could add some new configs manually in this file. How can JobHostConfiguration identified this is IsDevelopment or not ? It depends on whether the JobHost is running in a Development environment. The default value is false. If

Azure WebJob QueueTrigger message is not deleted from queue

纵饮孤独 提交于 2019-12-05 09:39:33
I have WebJob running continuously using the 1.0.0 WebJobs SDK. Here is configuration code. public static void Main() { var config = new JobHostConfiguration(); config.Queues.MaxDequeueCount = 1; config.Queues.BatchSize = 1; var host = new JobHost(config); host.RunAndBlock(); } Here is my job function signature. public static void HuntVkusniyBlogRss([QueueTrigger("queue-rss")] string message, DateTimeOffset expirationTime, DateTimeOffset insertionTime, DateTimeOffset nextVisibleTime, string id, string popReceipt, int dequeueCount, string queueTrigger, CloudStorageAccount cloudStorageAccount,

Update (re-deploy) existing azure webjob

試著忘記壹切 提交于 2019-12-05 09:29:24
问题 I created an on-demand webjob. In the management portal there is no option to upload a new zip, to update it. I can delete the existing webjob and create a new one, but I would like to keep my logs. Is there any way to re-deploy it, overriding the old version, maintaining the logs? 回答1: You can connect to the website where the webjob is at via FTP and update the necessary files without erasing your log files. You can get the credentials to connect via FTP from the Publish Profile. 回答2: You

Azure WebJob concurrency when using ServiceBusTrigger

旧时模样 提交于 2019-12-05 08:57:29
I have been using Azure Storage Queues to feed a WebJob, using the QueueTrigger attribute. I configure my QueueTrigger to dequeue a number of items for concurrent processing, like this: public static void Main() { JobHostConfiguration config = new JobHostConfiguration(); config.NameResolver = new QueueNameResolver(); config.Queues.NewBatchThreshold = 10; JobHost host = new JobHost(config); host.RunAndBlock(); } public static void ExecuteStorageQueueItem([QueueTrigger("%AzureQueueName%")] CloudQueueMessage message, TextWriter logger) { ProcessRequest(message.AsString, logger); } I would prefer

Azure Webjob - accessing local file system

这一生的挚爱 提交于 2019-12-05 07:30:43
I have a legacy exe which takes local machine file path, processes it and produces output file in again the local path. Can this be run on Azure Webjob? I was thinking to write a wrapper exe which downloads file from blob storage -> store it in local file system -> call the legacy exe with local file path -> get the output and upload it to the blob again. Will this approach work or there are limitations? Such exe should run fine, as long as you get to pass it the folders to write from/to. Before getting into WebJobs, I suggest testing it manually in a Web App using Kudu Console , to make sure

Azure WebJob FileTrigger Path 'D:\home\data\…' does not exist

放肆的年华 提交于 2019-12-05 05:56:05
问题 I've created a WebJob to read files from Azure Files when they are created. When I run it locally it works but it doesn't when I publish the WebJob. My Main() function is: static void Main() { string connection = "DefaultEndpointsProtocol=https;AccountName=MYACCOUNTNAME;AccountKey=MYACCOUNTKEY"; JobHostConfiguration config = new JobHostConfiguration(connection); var filesConfig = new FilesConfiguration(); if (config.IsDevelopment) { config.UseDevelopmentSettings(); filesConfig.RootPath = @"c:

Best Way to Pass Multiple Blob Inputs to a QueueTrigger Azure Function

谁说胖子不能爱 提交于 2019-12-05 05:14:19
The Problem Upon a trigger, generate 3 XML files and once complete, ftp them to a site. The Current Approach I have a HTTP Trigger Azure function that when run will construct 3 XML files and save these to an Azure Storage Blob container. Because of the multiple outputs, and the need to control the output path/filenames, I use the imperative binding approach and use the IBinder outputBinder in my function. This all works just fine. An example of the output path in the blob storage is export/2017-03-22/file-2017-03-22T12.03.02.54.xml . The file is in a folder with the date, and each filename has

Scheduled WebJob

别等时光非礼了梦想. 提交于 2019-12-04 20:56:35
问题 I'm creating a new Azure WebJob project -- which appears to be a polished version of a console app that can run as a web job. I want this job to run based on a schedule but in the Main() method -- see below -- Microsoft gives you the host.RunAndBlock() for the job to run continuously. Do I need to change that if I want the job to run at regularly scheduled intervals? static void Main() { var host = new JobHost(); // The following code ensures that the WebJob will be running continuously host

Stuck when publishing Web App to Azure with WebJob

懵懂的女人 提交于 2019-12-04 19:39:40
问题 I just used the WebJob SDK to add a WebJob to my web app. Now, when publishing the web app, VS is stuck when publishing (does not hang, but does not progress either). I know it's caused by the WebJob because when I remove the webjobs-list.json , it publishes perfectly. Weird thing is, publishing the WebJob alone (using Publish as Azure WebJob ) does not present this problem. Using .NET Framework 4.5.1 if it matters. Update: 4.5 did not make a difference. Here's an image of the problem: 回答1: