7 Jun’17

Azure and Office 365Azure Function


Sometime it happens that you want to write small piece of code and it should be accessible from outside but you may not have infrastructure ready for it. In that situation you can write a function which can be called from anywhere. Azure function provides required infrastructure for code you need to write and you can make it available within few minutes.

You can use Azure functions where you code does not include any complex logic. Azure functions can be used for very small pieces of code which can be invoked via any triggered events.

You can choose your language to write the code like C#, F#, Node.js, Python or PHP. Azure Functions lets you develop server less applications on Microsoft Azure.


1. Features:

Azure function provides the below features:

  • Choice of language – We can write functions using C#, F#, Node.js, Python, PHP, batch, bash, or any executable.
  • Pay-per-use pricing model – Pay only for the time spent running your code.
  • Bring your own dependencies – we can include other library as well if needed.
  • Integrated security – Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account.
  • Simplified integration – Easily leverage Azure services and software-as-a-service (SaaS) offerings.
  • Flexible development – Code your functions right in the portal or set up continuous integration and deploy your code through GitHub, Visual Studio Team Services.

2. Function Task:

Functions provides templates to get you started with key scenarios,

  • Blob Trigger
  • EventHubTrigger
  • Generic webhook
  • GitHub webhook
  • HTTPTrigger
  • QueueTrigger
  • ServiceBusQueueTrigger
  • ServiceBusTopicTrigger
  • TimerTrigger

Create your first function:

  1. Prerequisites:

    Windows Azure Subscription – you can also subscribe for a free trial of Windows Azure from URL.

  2. Add Function Apps
    • In order to host your code, you must have a function app created in the Azure.
    • Login to the azure portal and click on the +(plus) sign
    • Select the function app and provide the required details

  3. Provide the Azure function details as shown below.

    Provide all the required field value and click create, you will able to see below screen,

  4. Create function:
    • Click on the plus sign as shown
    • Select the httptriger-csharp
    • Provide a unique name to the function and click create
    • Now you are read with the function that can be access from anywhere.
    • This is the template you can write your own code, we will work with the sample code that generated automatically.
  5. Let’s test the function from outside.
    • Copy the url form the console as show
  6. You will get the code url that can be called from any API tester application, lets we called it from the Postman application.

    As you can see in the below screen, I called the function from Postman and in out window you will find that it is showing message. It shows some validation message because I have not provided the required fields.

  7. I provided the name you will find that output shows the name with greeting.
  8. View the function logs


So, it concludes that we can have small piece of code that can be called form outside and we don’t require to maintain the infrastructure.

Written by

Subhash Mahato

Technical Consultant

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Managing mailbox through Email Archiving

    20 March’ 2018

    Introduction: Email can fill your Outlook Inbox quickly – new messages, replies, and forwards. Before you know it, yo...

    Read more
  • Workaround to Report.SAVEASPDF in NAV 2018

    20 March’ 2018

    Objective: In NAV 2017 Emailing the PDF by running the report using Report.SAVEASPDF is now not allowed in NAV 2018. Th...

    Read more
  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more