Invoking Azure Runbook SharePoint Operations Using Webhooks - Part Two

Introduction
 
In this article, you will learn how to create Azure Webhook and provide the necessary input parameters.
 
This article is part two of the article series, which explains about invoking the SharePoint online PowerShell operations built on Azure (Runbook) through Azure Webhooks, using external Applications.
 
In the previous article, we have seen the basic understanding of each component. The flow of the operations was explained in detail and the article can be accessed at the link, given below-
Steps involved 
 
I assume Azure Automation account is available prior to carrying out the steps, given below-
  1. Automation Account and Runbook creates. The snapshot, given below, shows the Automation account and Runbook (selected) to be used in the current operations.



  2. The module to be used for the operations is SharePointPnPPowerShellOnline, which needs to be imported into the modules in the assets section. We are using PnP PowerShell commands for our example.

     

  3. The credentials to be used for our operation should be stored in the credentials under the assets component.

     

  4. Runbook contains PowerShell code to create the list on SharePoint portal, using the supplied input parameters. Publish Runbook.

     

  5. From Runbook, click Webhook. Webhook will act as an interface between Azure Runbook and the external Applications.



  6. Provide the necessary Webhook information, as shown below. The required information is  title, expiry date and other input parameters. The input parameters required for Azure Runbook can be configured from Webhook under "parameters and run settings" section.
From "create new Webhook section", provide Webhook title and the expiry date for executing Runbook. In this section, Webhook URL will be generated for the access to the external Applications. This has to be copied and saved for the later use.
 
 
Configure parameters and run settings values, required for Runbook. The snapshot, given below, shows the input parameters required, for example, Webhook. The parameters here match Runbook parameters, as shown in the code at step 4. Here, the parameter is left blank, since the input parameters are passed from the external Applications.
 
 

Once configured, click create to generate Webhook.
 
The snapshot, given below, shows the created Webhook.

 
 
Summary
 
Thus, we have successfully created Webhook. Runbooks created for automation purposes can be exposed to the external Applications, using the created Webhook. Webhook acts as an intermediate layer for Runbook and the external Applications.
 
In the next article, you will learn how to invoke the created Webhook.