Posted by Anuraj on Friday, June 23, 2017 Reading time :1 minute
First you need to install Azure Functions Core Tools, you can download it via NPM. The Azure Functions Core Tools provide a local development experience for creating, developing, testing, running, and debugging Azure Functions. You can install the azure function core tools using the command -
npm i -g azure-functions-core-tools.
In this post I am using Visual Studio. For developing Azure Functions with Visual Studio, you need to install the Azure Function Tools for Visual Studio 2017. This is a preview of Visual Studio 2017 Tools for Azure Functions. Unfortunately this extension will not work with Visual Studio 2017 stable version, you need Visual Studio 2017 Preview.
Once you install the extension, you can create Azure Function from New Project > Azure Functions.
This will create the project file and two json files (host.json file and local.settings.json.) Next you need to create a Azure Function, using Add new item option. It will popup various templates, like in the azure portal.
You can click on the template and it will display configuration properties. For this post, I am selecting HttpTrigger template. It will create a C# file. Now like any other Visual Studio project, you can run the function using Debug > Start Debugging option. If Azure Functions Core Tools not installed, Visual Studio will prompt to install it. When you start the debugging, it will display the Azure Function CLI like this.
Now you can open postman, and send the request to “http://localhost:7071/api/HttpTriggerCSharp”
Here is the HTTP Request using cUrl.
You can deploy the function either directly from Visual Studio using Publish option, where you can deploy to Azure Function App and Folder. Selecting the Azure Function option will popup the Subscription Plan, Resource Group and Display the existing functions.
Happy Programming :)