Friday 9 November 2018

Azure Functions with Office 365 SharePoint Calls - Creating, Debugging & Deploying NodeJS Functions using Visual Code - Part II

Here let us look at the debugging the azure function locally and deploying the function to the portal.

In the previous article, we have seen creating the Azure function and accessing the SharePoint data using NodeJS.

Since we are calling SharePoint authentication methods and SharePoint list APIs, we need to make sure that the function is not returning the response to client, before executing the authentication and rest API calls. This can be done using async and await keywords. By default, outer module function has the async function. In the azure function code, we need to append the await keyword for the calling code and async to the function present in the code.

async and await on the azure function code
async and await on the azure function code

Note:
The code available in the previous article doesnt have these keywords, i have left it to you for embedding for hands-on.

Thursday 1 November 2018

Azure Functions with Office 365 SharePoint Calls - Creating, Debugging & Deploying NodeJS Functions using Visual Code - Part I

Let us have a detailed look at creating azure functions using visual code, creating sharepoint context for getting site data, debugging locally using visual code, and deploying the code to Azure function app from visual code.


Creating Azure Function using Visual Code:


Setup and install the prerequisites for developing azure functions using visual code.
  • Install the visual code on your machine and install all prerequisites required for developing azure functions.
  • Install the latest of NodeJS.
  • Then install the core tools package required for working with Azure functions. 
npm install -g azure-functions-core-tools
The extensions being enabled on the visual studio can be found in the following snapshot.

Thursday 11 October 2018

Using Azure Functions, Cognitive Services and Flow for classifying Office 365 SharePoint Word Documents - Part II

Let us look how to integrate Azure Function, Cognitive services into Microsoft Flow for extracting tags/categories and update the SharePoint document item.

This article series helps us to work on a special use case of extracting information of word documents uploaded to Office 365 SharePoint libraries and then analyze/classify the document content using Azure Cognitive Services. Then update the document with classified data as tags/categories. The article links are shown below.


Extract Code From Github


The Azure function created in the previous article is available on Github repository (https://github.com/nakkeerann/analyze-sp-word-documents).
  • Clone the code from the github repository to the local. 
  • Open in visual studio and make necessary changes, like updating user credentials and SharePoint site and details.

Saturday 6 October 2018

Using Azure Functions, Cognitive Services and Flow for classifying Office 365 SharePoint Word Documents - Part I

This article series helps us to work on a special use case of extracting information of word documents uploaded to Office 365 SharePoint libraries and then analyze the document content using Azure Cognitive Services.

We have seen before extracting tags and metadata properties of image files from Office 365 SharePoint using Microsoft Flow and Azure Cognitive Services.

Microsoft Flow has a Get File content action, but that doesn't help extracting word documents content. Only it supports extracting content of notepad as straight forward approach. Since Microsoft Flow doesnt provide any option to read the word documents content, we will be using Azure Functions to extract the content. Once we have the content, we will use Azure Cognitive service to get the tags for the content extracted. Here Microsoft Flow is used to manipulate triggers and subsequent actions. So our algorithm is will be as follows.

High level architecture for classifying SharePoint Word Documents