First published on MSDN on Sep 29, 2017
Microsoft Machine Learning Server
allows us to publish R/Python models and code in the form of web services and the consume these services within client applications. This article outlines step-by-step details of consuming the published
(R language) using
(C# TimerTrigger). Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud without worrying about a whole application or the infrastructure to run it.
To run this Azure Function locally, we need to define a storage account connection string for AzureWebJobStorage in local.settings.json file. Create a storage account (or) use an existing storage account connection string.
After updating the local.settings.json file, Set ManualTransmissionFunctionApp as Startup project, build the solution and run the app.
You will see that the function is called every 5
minute and the prediction output is printed in the console. You can also debug this locally, by setting a breakpoint in the code.
Now lets publish this app from Visual Studio to Azure. Right Click ManualTransmissionFunctionApp and choose Publish.
Once you have published to Azure successfully, you can view the console output of Azure Function from Azure Portal as well.
The Visual Studio Solution is available in Github
Azure function supports
and it integrates with Dropbox, Github, Onedrive, VSTS etc. We can develop an Azure function (C# code) to update a published web service with new model/code if new code/model is checked-in to Github/VSTS.
Azure Functions have blob trigger and Cosmos DB Trigger. So whenever new data is added to a blob or CosmosDB, Azure function can be triggered to “Score” the new data and store/perform subsequent action based on the scoring results.