azure-webjobssdk

Azure webjobs JobHostConfiguration missing and can't figure out to do the settings now

依然范特西╮ 提交于 2019-12-25 00:28:26
问题 I want to rewrite my current webjobs config to the version 3.0 but I can't get it to work with the documentation because I have no idea how to set the dashboardconnectionstring or storageconnectionstring without a config file. JobHostConfiguration config = new JobHostConfiguration { NameResolver = new WebJobsNameResolver() }; string defaultStorageConnectionString = string.Format( "Some dynamically generation string" ); config.DashboardConnectionString = defaultStorageConnectionString; config

Dnx (asp.net 5) Console app as Azure Web Job connection strings configuration not found

大憨熊 提交于 2019-12-24 13:47:57
问题 In all of the manuals about how to get the Storage connection for azure web jobs it is said to have those two variables AzureWebJobsDashboard, AzureWebJobsStorage in the connection strings. It works properly for ordinary .net, but it's quite an issue with DNX, since it seems that ConfigurationManager is not available there. So I have added the two strings to the ConnectionStrings in the portal, but I cannot find a good way how the Web Job would read them automatically. I ended up reading them

Azure WebJob QueueTrigger Retry Policy

泪湿孤枕 提交于 2019-12-24 04:26:11
问题 I would like to have my queue retry failed webjobs every 90 minutes and only for 3 attempts. When creating the queue i use the following code CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); IRetryPolicy linearRetryPolicy = new LinearRetry(TimeSpan.FromSeconds(5400), 3); queueClient.DefaultRequestOptions.RetryPolicy = linearRetryPolicy; triggerformqueue = queueClient.GetQueueReference("triggerformqueue"); triggerformqueue.CreateIfNotExists(); However when simulating a

Notification of when continuous Azure WebJob is stopping for NoAutomaticTrigger type jobs

自闭症网瘾萝莉.ら 提交于 2019-12-23 22:48:09
问题 All, I am migrating existing Worker Role code to an Azure Web job. I am trying to use the WebJob SDK (1.0) so that I have the full integration with the Azure Web Site. My difficultly is that the JobHost doesn't play nicely with jobs that are outside it's usual Attribute based invoke options (Queues, Blobs etc.) I already have standard code that I cannot change to listen to Azure Queues/Topics etc. so I cannot use the WebJob code to do this. Therefore I need to use the WebJob Call method: var

Configurable Timer Triggers - Azure Web Jobs

∥☆過路亽.° 提交于 2019-12-23 19:55:44
问题 I'm building a job to trigger at some regular interval (say 1 minute). I've successfully used triggered web jobs with time-span hard coded in the functions. public void foo([TimerTrigger("00:01:00")] TimerInfo timer) Now if I ever want to change the trigger time from 1-min to 2-min I've to redeploy the code. Instead is there a way to make the TimeTrigger Configurable, from a config file. Note that replacing the string with a dynamically read value isn't possible as the TimerTrigger Attribute

How do I have an Async function that writes out to a service bus queue?

我只是一个虾纸丫 提交于 2019-12-23 07:26:45
问题 Using the Azure WebJobs SDK, I want to create an async function that will receive ServiceBus queue input and write to a ServiceBus queue output. Async methods cannot have out parameters which, for examples on BlobStorage, appears to be worked around by having Streams and TextWriters instead. However, when I try to do the same with a ServiceBus parameter I receive an exception. public static async void Transform( [ServiceBusTrigger("%InputQueue%")] String input, [ServiceBus("%OutputQueue%")]

Intercept Azure Function Host Shutdown: Flush Application Insights TelemetryClient

前提是你 提交于 2019-12-22 08:52:12
问题 I am playing a little bit with Azure Function: Mostly I try to migrate an existing webjob to Azure Functions and now it is time for me to integrate Application Insights in one of my function. So basically I only need one instance of the TelemetryClient but this assumes that I am able to flush the in-memory buffer when the application stops. I've used a TimerTrigger but it was just for testing purpose. I've referenced the Microsoft.ApplicationInsights nuget package (from this SO post) and my

Azure Webjob - accessing local file system

余生长醉 提交于 2019-12-22 05:14:51
问题 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? 回答1: Such exe should run fine, as long as you get to pass it the folders to write from/to

Azure WebJobs TimerTrigger not triggering

南楼画角 提交于 2019-12-21 17:48:44
问题 I'm trying to run WebJob as a console app, It works When I add RunOnStartup = true , but I need that it works just with TimerTrigger. this is my code public static void Main() { JobHostConfiguration config = new JobHostConfiguration(); config.UseTimers(); JobHost host = new JobHost(config); host.RunAndBlock(); } public static void TimerJob([TimerTrigger("0 0 8 * * *")] TimerInfo timerInfo) { Console.WriteLine("Job Work"); } What do I need to make this code work? 回答1: This behavior was due to

Azure Webjob TextWriter logger being disposed in the middle of my method

断了今生、忘了曾经 提交于 2019-12-21 04:11:38
问题 I'm using a Webjob with the Windows Azure Storage SDK. When a new item shows up in a Queue, a method in my class is invoked. According to the SDK docs, if I take a TextWriter as a parameter to my method, the SDK will provide me with a TextWriter that I can write to which will show up in the Webjob's logging infrastructure. This makes it pretty easy to diagnose issues and troubleshoot things. public async static void ProcessQueueMessage([QueueTrigger("queueName")]MyModelType model, TextWriter