azure-webjobs

Multiple Azure Webjob instances on one queue

馋奶兔 提交于 2019-12-23 05:18:05
问题 I'm looking for a way to have multiple instances of my azure webjob running together and clearing my queue. One of the functions of our application is to decrease the user's credit on every page view on their site (called by an ajax). We currently have close to 600 of these websites and every page view of their site is generating a call that results in a credit being deducted from their account (SQL Azure). This happens real time in the and we are calling the sql server on ever one of these

Azure Web Job - Authorization Basic Header

泄露秘密 提交于 2019-12-22 11:33:40
问题 I created an Azure Web Job and published and associated with my Web App. I think created a schedule to run every hour. When I login to the portal, I notice a new Schedule has been created. It has two automatically headers: Where did that Basic Authorization key come from? I can't seem to find it when drilling into the Web Jobs tab under my Web App. It's also strange the scheduler only allows for minimum of hour intervals for a "Basic" web app. But I can just create a fresh Scheduled Job using

Entity Framework bulk insert unreal slow

纵然是瞬间 提交于 2019-12-22 10:29:18
问题 I am using EF 6. I am trying to insert around 200.000 entities while saving changes to database after each 100 entities. The issue is it took 11 hours to save 50.000 entities, and it is still running behind. I am running this with WebJobs, and job is published on the same azure webapp as main website. Is the issue because of that and WebJob don't have enough resources, or saving after 100 entities, or the approach? Method public void SaveLeadsForBuyer(ISenderModel model) { var rowCounter = 0;

“The function runtime is unable to start”

流过昼夜 提交于 2019-12-22 10:18:24
问题 I know it probably has something to do with a misconfiguration, but unfortunately the most info I get is The function runtime is unable to start. Session Id: b939c608ae424150878a55eeac6e7d36 Timestamp: 2018-10-04T18:05:22.023Z My function looks like [FunctionName("DoJob")] public static async Task DoJobAsync([ServiceBusTrigger("job-queue", Connection = "MyServiceBusConnection")] string json, ILogger log) { … } and my my local.settings.json is like { "IsEncrypted": false, "Values": {

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 LogicApp runs webjob and send email

蓝咒 提交于 2019-12-22 01:11:16
问题 I want to create an Azure LogicApps that has to launch and verify the status of a webjob . This is because I want to take an action if the webjob finishes its activities with an error and, in this case, the LogicApps has to send an email with an alert and restart the webjob . I have tried to find some documentation about it on LogicApps site and in the editor but I can't find any connectors. Any ideas, documentation or samples? Thank you 回答1: I thought my way could meet your requirements. You

ConfigureAwait when not awaiting

怎甘沉沦 提交于 2019-12-22 00:02:22
问题 I have an async method I am using to offload a few seconds' worth of fire-and-forget work so as not to slow down my page load. This work needs a bit of general setup and tidy-up; I want the (fast) setup to throw synchronously if it throws, but I don't want to force the tidy-up to run in the ASP context so I am using ConfigureAwait on the bit I am awaiting: public Task FireAndForget() { DoSetup(); return FireAndForgetAfterSetup(); } private async Task FireAndForgetAfterSetup() { await

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 - graceful shutdown of a queue handling function

浪尽此生 提交于 2019-12-21 09:37:42
问题 I have a bunch of webjob queue handling functions: public static void ProcessSomething( [QueueTrigger("testrequest")] TestThing thing, TextWriter logger, CancellationToken token) I'm confused about graceful shutdown. So - when you shutdown the webjob (or re-deploy to it), it allows currently processing webjob to run and to complete - by default your Queue handler has 5 seconds to complete. You can pass a CancellationToken into the method to check for a cancellation request if it's likely that