azure-webjobssdk

How to get an Azure Webjob to process multiple queue messages?

落花浮王杯 提交于 2021-02-08 07:37:47
问题 In Azure worker roles, you can create a batch job that processes a list of messages. I'm wondering if there is something similar to that for Azure WebJobs? Currently you can trigger a webjob from a queue as follows: public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TextWriter log) Is there some way to pull and process a list of messages? 回答1: No, there is no inbuilt binding for a batch of Queue messages currently. However, someone in the community has recently

Why does my continuous azure webjob run the function twice?

时间秒杀一切 提交于 2021-02-07 18:44:30
问题 I have created my first azure webjob that runs continously; I'm not so sure this is a code issue, but for the sake of completeness here is my code: static void Main() { var host = new JobHost(); host.CallAsync(typeof(Functions).GetMethod("ProcessMethod")); host.RunAndBlock(); } And for the function: [NoAutomaticTrigger] public static async Task ProcessMethod(TextWriter log) { log.WriteLine(DateTime.UtcNow.ToShortTimeString() + ": Started"); while (true) { Task.Run(() => RunAllAsync(log));

Visual Studio 2019 - Adding WebJob project in WebApp

房东的猫 提交于 2021-01-28 05:36:08
问题 In my solution i have an aspnet core 2.2 WebApp, and i want to add an existent project like webJob but there isn't the option: Add WebJobs from existent project Why? With the same procedure i add WebJobs on my other .Net application, and this option is shown in visual studio 2019 EDIT Changed images with english language. Sometimes the Add > Existing project as Azure WebJobs it's showned but if I click on it it shows this error: (the selected project is the aspnet.core 2.2. WebApp) After this

Does StorageConnectionString in AzureWebjobSDK require access to the whole storage account?

社会主义新天地 提交于 2021-01-28 02:29:29
问题 I'm trying to use Azure WebJobs SDK to trigger a function when a message is posted on a queue. This works fine when setting StorageConnectionString to a connection string with the storage account key. I would like to use a Shared Access Token (SAS) which has access to that queue (and only that) in the StorageConnectionString but getting errors: Message=Failed to validate Microsoft Azure WebJobs SDK Storage connection string. The Microsoft Azure Storage account connection string is not

Does StorageConnectionString in AzureWebjobSDK require access to the whole storage account?

巧了我就是萌 提交于 2021-01-27 20:51:02
问题 I'm trying to use Azure WebJobs SDK to trigger a function when a message is posted on a queue. This works fine when setting StorageConnectionString to a connection string with the storage account key. I would like to use a Shared Access Token (SAS) which has access to that queue (and only that) in the StorageConnectionString but getting errors: Message=Failed to validate Microsoft Azure WebJobs SDK Storage connection string. The Microsoft Azure Storage account connection string is not

Dynamically enable/ disable a triggered function in Azure WebJob

我的梦境 提交于 2020-08-04 07:16:45
问题 We have an azure web job that has two methods in the Functions.cs file. Both jobs are triggered off different Topics in Azure Service Bus. As this uses reflection at run time to determine the functions that are to be run/triggered by messages hitting the topics, there are no references to these methods in code. public static async Task DoWork([ServiceBusTrigger("topic-one", "%environmentVar%")] BrokeredMessage brokeredMessage, TextWriter log) {} public static async Task DoOtherWork(

Azure functions - How to read form data

ⅰ亾dé卋堺 提交于 2020-05-12 02:50:52
问题 How to read form data in Azure functions ? I tried to do it in several ways, but always I get an error, eg.: using System.Net; public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { dynamic data = await req.Content.ReadAsFormDataAsync(); return req.CreateResponse(HttpStatusCode.OK, $" {data}"); } Error: Exception while executing function: Functions.FormTrigger. System.Net.Http.Formatting: No MediaTypeFormatter is available to read an object of type

Azure functions - How to read form data

*爱你&永不变心* 提交于 2020-05-12 02:49:25
问题 How to read form data in Azure functions ? I tried to do it in several ways, but always I get an error, eg.: using System.Net; public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { dynamic data = await req.Content.ReadAsFormDataAsync(); return req.CreateResponse(HttpStatusCode.OK, $" {data}"); } Error: Exception while executing function: Functions.FormTrigger. System.Net.Http.Formatting: No MediaTypeFormatter is available to read an object of type