azure-webjobssdk

Azure WebJobs - Can I use Async Methods?

大城市里の小女人 提交于 2019-12-13 11:54:01
问题 I was wondering if the Azure WebJobs SDK can trigger async methods? Currently I have a method that looks like the following: class Program { static void Main(string[] args) { var host = new JobHost(); host.RunAndBlock(); } public static void ProcessStuff([QueueInput("myqueue")] string msg) { var tsk = ProcessStuffAsync(msg) .ContinueWith(x => HandleAsyncError(x), TaskContinuationOptions.OnlyOnFaulted); tsk.Wait(); } public static async Task ProcessStuffAsync(string msg) { // do some async

Microsoft.Web.WebJobs.Publish producing duplicate assemblies in deploy package

社会主义新天地 提交于 2019-12-13 11:45:13
问题 I have a large number of Azure WebJobs that all deploy to a single Azure App Service, along with a Website on the same Azure App Service. Each WebJob all use the WebJobs SDK and the Microsoft.Web.WebJobs.Publish nuget package (we are up-to-date with version 1.0.13) to package them up for deployment. The following are the MSBuild arguments we use in the CI build (VSTS) to produce the deploy package: /p:DeployOnBuild=true /p:PublishProfile=Release /p:WebPublishMethod=Package /p

Detecting update/redeployment inside running Azure function

我的梦境 提交于 2019-12-13 06:41:08
问题 The WebJobs SDK supports passing in a CancellationToken argument to a function which is used by the SDK to notify running functions of a host shutdown. I have noticed though that running functions are not notified if the app/function is replaced by a new version. This is a problem if functions are designed to run for a longer period of time, since you could end up having "old" logic running without knowing it. For example, if you create a simple function that will run forever (or until

Any Example of WebJob using EventHub?

笑着哭i 提交于 2019-12-13 06:40:58
问题 I've tried to come up with something from the example in the WebJobsSDK gitHub var eventHubConfig = new EventHubConfiguration(); string eventHubName = "MyHubName"; eventHubConfig.AddSender(eventHubName,"Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=SendRule;SharedAccessKey=xxxxxxxx"); eventHubConfig.AddReceiver(eventHubName, "Endpoint=sb://test.servicebus.windows.net/;SharedAccessKeyName=ReceiveRule;SharedAccessKey=yyyyyyy"); config.UseEventHub(eventHubConfig); JobHost host =

Associating WebJob with Web App in Visual Studio & Azure Pipeline

若如初见. 提交于 2019-12-13 04:34:59
问题 I am trying to associate an existing WebJob (created with Azure WebJob template of net461) project, with an existing Web Application, by following https://docs.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs link. However, Problem 1 : Visual Studio shows me the "Add->Existing Project as Azure WebJob" the first time, then when I click on that menu, it throws an error saying "command is not applicable for the selected project". After that, it never shows that menu, unless I

Azure WebJobs SDK Service Bus DeadLetter queue

一曲冷凌霜 提交于 2019-12-12 16:06:53
问题 When using the WebJobs SDK what is the proper way to move a BrokeredMessage to the deadletter queue? Usually I would just call msg.DeadLetter(). However, the SDK takes care of managing the life cycle of the brokered message. It will call msg.Complete() if the method returns successful, and it will retry the message if an exception occurs. I need the 3rd case of telling the ServiceBus queue to move the message to the deadletter queue as it is a bad message. 回答1: You can explicitly deadletter

Slowcheetah Transforms for Azure Webjobs

青春壹個敷衍的年華 提交于 2019-12-12 14:33:27
问题 In my experience, Slowcheetah does not work with Azure Webjobs. I'm just looking for confirmation as to whether this is the case (or not). Cheers 回答1: I've used this tutorial and it work fine : SlowCheetah VS 2015. Keep in mind that a webjob is just a console app (and more...) Add the slowcheetah nuget package to your webjob project. Add the app.config transform to your project, for example app.Debug.config and app.Release.config Edit your *.csproj file and add these lines (depending on the

What is the clean up mechanism for the blobs that WebJobs SDK creates in the AzureWebJobsDashboard connection?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 11:19:29
问题 Azure WebJob SDK uses the storage connection string defined in the AzureWebJobsStorage and AzureWebJobsDashboard app settings for its logging and dashboard. WebJob SDK creates the following blob container in AzureWebJobsStorage : azure-webjobs-hosts WebJob SDK creates the following blob containers in AzureWebJobsDashboard azure-jobs-host-output azure-webjobs-hosts Many blobs are created in the above blob containers as the WebJob runs. The containers can be bloated or saturated if there is no

Azure Web Jobs and SignalR memory leak

十年热恋 提交于 2019-12-12 09:56:59
问题 So I have some webjobs that occasionally connect to a signalr hub and broadcast a message. Below is just an example of one, in this case its a simple web job for development with the TimerTrigger attribute that is set to run continuously every 20 seconds. Like that shown in the code below. public static void Main() { JobHostConfiguration config = new JobHostConfiguration(); config.Tracing.ConsoleLevel = TraceLevel.Verbose; config.UseTimers(); if (config.IsDevelopment) { config

Azure WebJob fail to start

孤人 提交于 2019-12-12 00:55:21
问题 I have created an Azure WebJob in Visual Studio 2015 and deployed it to Azure. When trying to run the WebJob I get this error: [03/12/2017 22:47:46 > 070c62: SYS INFO] Status changed to Running [03/12/2017 22:47:47 > 070c62: ERR ] [03/12/2017 22:47:47 > 070c62: ERR ] Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.HostingProcess.Utilities.Sync, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its