Posted by Anuraj on Sunday, September 18, 2016
This post is Azure functions. Azure functions is a new service offered by Microsoft. Azure Functions is an event driven, compute-on-demand experience that extends the existing Azure application platform with capabilities to implement code triggered by events occurring in Azure or third party service as well as on-premises systems. Azure Functions is a solution for easily running small pieces of code, or “functions,” in the cloud. You can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it. This can make development even more productive, and you can use your development language of choice, such as C#, F#, Node.js, Python or PHP. Pay only for the time your code runs and trust Azure to scale as needed. In this post I am creating a Hello World Azure function, it will return HTML color code of a given color.
In this tab, you can see the code editor, logs and infrastructure to test your azure function. And here is the azure function code.
You need to add reference of System.Drawing using “#r” syntax. And you can test it using the utility, like this
You can test it using the fiddler or postman as well, you can either use HTTP POST or HTTP GET methods. Here is the screenshot of testing the azure function using Postman client. I am using HTTP GET method.
In this I am passing the color as query string.
Azure functions can also used for Build BOTs and APIs. You can also use Azure functions integrated with WebHooks.