gpt4 book ai didi

azure - 如何在 Azure 中使用事件网格触发 C++ 代码?

转载 作者:行者123 更新时间:2023-12-03 05:43:57 26 4
gpt4 key购买 nike

我正在尝试在 Azure 存储中上传 blob,并且上传成功。现在,下一步是使用 C++ 代码处理 blob。由于Azure函数不支持C++,我如何处理blob?

最佳答案

Azure Function 支持运行 .exe 可执行文件。因此,我建议生成您的 cpp 程序 exe 文件,然后将其上传到 Azure Function 并运行以下示例代码。

enter image description here

using System;

public static void Run(TimerInfo myTimer, TraceWriter log)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = @"D:\home\site\wwwroot\TimerTriggerCSharp1\testfunc.exe";
process.StartInfo.Arguments = "";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.Start();
string output = process.StandardOutput.ReadToEnd();
string err = process.StandardError.ReadToEnd();
process.WaitForExit();

log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
}

关于azure - 如何在 Azure 中使用事件网格触发 C++ 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56428852/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com