How it works...

Still in your GitHub repository, open a file and add a comment to it. Click on the Comment on this commit button.

Swing back to your Azure Function and take a look at the Logs window. This window is directly below the code window. You will see that the comment we posted in GitHub pops up in the log output of the Azure Function.

If nothing appears in the log window, ensure that you have clicked on the Run button of the Azure Function. If all else fails, click on the Run button at the bottom of the Test window.

While this is a very simple example, the usefulness of Azure Functions should become evident to you. You will also notice that the function has a .csx extension. What is important to note is that Azure Functions share a few core concepts and components irrespective of which programming language you choose to code it in. At the end of the day, a function is the primary concept here. You also have a function.json file that contains JSON configuration data. You can see this and other files by clicking on the View files link to the right.

Clicking on the function.json file, you will see the contents of the JSON file. Changing the disabled property to true will effectively stop the function from executing if called. You will also notice the bindings property. Here, you configure your web hook. All these settings can be set from within the Integrate and other sections of the Azure Function.

        {
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"webHookType": "github",
"name": "req"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
],
"disabled": false
}

Azure Functions and the benefits exposed to developers is an exciting concept. This is one area of your programming repertoire that will surely keep you busy for many hours as you explore more intricate and complex tasks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.157.197