Azure Functions 中缺少 R 站点扩展

标签 r azure-functions

我正在尝试按照教程将 R 脚本站点扩展安装到 azure 函数。它不在列表中。有解决办法吗?

编辑: enter image description here

最佳答案

不需要安装R。您可以在本地安装它并通过 ftp 将文件夹复制到您的 Azure Function。

我使用 R.Net 运行 R在 C# 中。

public static class Function1
{
    [FunctionName("Function1")]
    public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, ExecutionContext context, TraceWriter log)
    {
        REngine.SetEnvironmentVariables(System.IO.Path.Combine(context.FunctionDirectory, @"R-3.4.4\bin\x64"), System.IO.Path.Combine(context.FunctionDirectory, @"R-3.4.4"));
        REngine engine = REngine.GetInstance();
        string[] a = engine.Evaluate("'Hi there .NET, from the R engine'").AsCharacter().ToArray();
        engine.Dispose();

        return req.CreateResponse(HttpStatusCode.OK, a[0]);
    }
}

关于Azure Functions 中缺少 R 站点扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53526216/

相关文章:

java - Java 中的 Azure Function 无法在本地运行

python - R中的函数auto.arima()如何确定d?

r - 如何衡量部署 Shiny 应用程序的所有方式的可扩展性?

c# - Azure 持久实体,用于存储运行之间的函数应用程序状态 (.net 6)

c# - 由于缺少 Azure 存储连接字符串和 SAS 连接 uri,Blob 存储的 secret 初始化失败

c# - 在 Visual Studio 中调试 Azure 函数

javascript - Azure Function - Node 应用程序中的端口耗尽

c++ - 将 Rcpp 函数扩展到任何类型的输入 vector

r - 编写使用运算符传递值的 R 函数

r - 将函数应用于列表的列表的特定元素