I need to execute R code as webservice, so I tried MLS and it works ok. The problem is that the packages are too old, and I need functions that are not implemented on old packages. I asked Microsoft support about it, and they have no data up upgrade it, and the new packages require a upgrade of it.
How can I do that using other resources, like webapi instead of MLS? All solutions I found requires R installed on machine, which is a problem for create an azure webapp, function, or API. I need an endpoint for forecast on-demand.
I found one way to execute R on Azure functions. the solutions is copy R-Portable in https://sourceforge.net/projects/rportable/ unzip it using powershell and create a process on function code. In my case i used the code:
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.WorkingDirectory = @"D:\home\site\tools\R-Portable\App\R-Portable\bin\";
process.StartInfo.FileName = @"D:\home\site\tools\R-Portable\App\R-Portable\bin\Rscript.exe";
process.StartInfo.Arguments = "-e \"print('Hello world')\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.Start();
string outputt = process.StandardOutput.ReadToEnd();
string err = process.StandardError.ReadToEnd();
process.WaitForExit();
On your script you can access csv files or write, and after on function read and return that file.