Run .exe executable file in Azure Function

前端 未结 2 1605
说谎
说谎 2020-11-30 09:57

I have executable abcd.exe (it contains/merged with many .dll). Is it possible to create Azure Function for abcd.exe and run it in Azure Cloud Functions?

The abcd.e

2条回答
  •  情书的邮戳
    2020-11-30 10:38

    Fred Thank you very much for your help. Now, with minor modification the application is compiling and running.

    Some minor modifications to the application:

    using System;
    
    using System.Diagnostics;
    
    using System.Threading;
    
    
    public static void Run(TimerInfo myTimer, TraceWriter log)
    {
    
        System.Diagnostics.Process process = new System.Diagnostics.Process();
        string WorkingDirectoryInfo =@"D:\home\site\wwwroot\TimerTriggerCSharp1";
        string ExeLocation = @"D:\home\site\wwwroot\TimerTriggerCSharp1\MyApplication.exe";
        Process proc = new Process();
        ProcessStartInfo info = new ProcessStartInfo();
    
        try
        {
        info.WorkingDirectory = WorkingDirectoryInfo;
        info.FileName = ExeLocation;
        info.Arguments = "";
        info.WindowStyle = ProcessWindowStyle.Minimized;
        info.UseShellExecute = false;
        info.CreateNoWindow = true;
        proc.StartInfo = info;
        proc.Refresh();
        proc.Start();
        proc.WaitForInputIdle();
        proc.WaitForExit();
        }
        catch
        {
        }
        log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
    }
    

提交回复
热议问题