azure-webjobs

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:

Last logging parameter of Azure Function (ILogger or TraceWriter) not accepted

旧时模样 提交于 2019-12-05 05:34:47
After upgrading my own project from an earlier (a few months back) version of Azure Functions to current, I get the following error upon launching from VS. GetLoginUrl: Microsoft.Azure.WebJobs.Host: Error indexing method 'Login.GetLoginUrl'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'log' to type ILogger. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.). Before, I

What is the connection string to use Azure Storage Emulator with a Webjob?

风流意气都作罢 提交于 2019-12-05 02:11:23
I have a simple WebJob which I wish to test with the Azure Storage Emulator. I currently have set the AzureJobsRuntime and AzureJobsData set to use development storage as follows: <connectionStrings> <add name="AzureJobsRuntime" connectionString="UseDevelopmentStorage=true;" /> <add name="AzureJobsData" connectionString="UseDevelopmentStorage=true;" /> </connectionStrings> The webjob is very simple: public static void Main(string[] args) { JobHost host = new JobHost(); host.RunAndBlock(); } public static void Process([QueueInput("queue")] string input, [BlobOutput("containername/blobname")

Azure Website Continuous Deployment always picks up the wrong project

浪子不回头ぞ 提交于 2019-12-05 00:49:18
问题 I have the following folder structure in my TFS online: The folder names also match the project names in the solution. Legend: green dot: web api 2.0 project red dot: class library blue dot: console app added as a webjob to the web project grey dot: console app only used for testing Working folders for build definition: The build definition was created automatically by connecting Azure to TFS online, and I have only changed the folder, so instead of the Team Project root folder, it points to

When publishing website on azure, webjobs are deleted

六眼飞鱼酱① 提交于 2019-12-05 00:17:54
When I publish a site on existing one where I created multiple webjobs, this deletes all the files on server and all the web jobs are deleted. I assume this is because webjobs are stored in App_Data folder. When the APP_Data directory is deleted, the jobs are deleted. How can I avoid deleting the app_data folder when doing a publish? A third option to Andy's answer would be to deploy you WebJobs with your website, just make sure the WebJobs scripts go to the right place which is under app_data\jobs\{job type: continuous/triggered}\{job name} . See more about deploying WebJobs: http://blog

Ftp to external server in azure webjob not working

别说谁变了你拦得住时间么 提交于 2019-12-04 21:48:21
I have a code which runs fine in local machine however in Azure it throws "Unable to connect to remote server", I 'm getting data from sql,processing it, and then uploading to a external server via ftp, is there any settings needs to be done for FTP in Azure ? Code : FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://ftp.example.com/remote/path/file.zip"); request.Credentials = new NetworkCredential("username", "password"); request.Method = WebRequestMethods.Ftp.UploadFile; using (Stream fileStream = File.OpenRead(csvfilestring)) using (Stream ftpStream = request.GetRequestStream(

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:

New Azure WebJob Project - JobHostConfiguration/RunAndBlock missing after NuGet updates

笑着哭i 提交于 2019-12-04 18:45:45
问题 Easy Replication Create a new project 'ASP.NET Web Application (.NET Framework). Build compile, update NuGet, all works. Add: Add New Azure WebJob Project. Build, compile. Happy Update NuGet for the WebJob project. Project no longer compiles. Breaking changes were introduced https://github.com/Azure/app-service-announcements/issues/129 So I install Microsoft.Azure.WebJobs.Extensions.Storage This resolves QueueTriggerAttribute But in program.cs static void Main() { var config = new