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 |
Note: The code available in the previous article doesnt have these keywords, i have left it to you for embedding for hands-on.