A while ago I wrote a post about integration between SharePoint 2010 and System Center Orchestrator, and the solution has been successfully used so far in my company. Since then, we moved to SharePoint 2013 and Microsoft released their new runbook engine – “Service Management Automation” (SMA) that integrated with the Windows Azure Pack (WAP). So, after we deployed WAP I was looking for an option to integrate between our SharePoint and the new runbook engine but found that the existing solutions are the same as they were for the Orchestrator – implemented by an infinity loop that queries a SharePoint list every specific interval. As I explained in my previous post this implementation is not efficient as it executes a lot of unnecessary queries and includes a delay of up to the interval time till the runbook kicks off. So I decided to adapt my previous solution to the new SMA engine. The attached solution uses SharePoint BDC to expose the SMA runbooks as an external list. The list contains a column called “InitValue” and by updating its value, the selected runbook will be triggered and the new value will be provided as the runbook’s first parameter. This external list allows users to create a SharePoint workflow (using SharePoint designer) that will execute a SMA runbook by using the “Update List Item” action, picking the desired runbook from the list and setting the parameter’s value. To send more than one parameter you can pass the current record Id as a parameter and then query the record’s values from the runbook. The solution also allows the administrator to filter the runbooks that are exposed by the external list, to include only runbooks that are tagged with a specific name.
Required Ingredients:
- SMA server with at least one runbooks that accepts zero or one parameter.
- SharePoint 2013 with the BCD service and the Security storage service enabled and attached to your web application.
- The “SMA BDC connector” (download link at the bottom of this post).
Deployment:
- Deploy the provided WSP File. You can accomplish that by executing the following cmdlets on the SharePoint server:
Add-SPSolution {extract path}SmaBdcConnector.wsp
Install-SPSolution -Identity SmaBdcConnector.wsp -GACDeployment - On the Business Data Connectivity Service set the object permissions of the new “Runbook” type and give the end users the Execute permission.
- Create a new Secure Storage Target Application with the following configurations:
- Name: “C60.SmaBdcConnector”
- Type: “Group Restricted”
- On the fields definition page, add the last 2 fields:
Name Type Mask Windows User Name Windows User Name False Windows Password Windows Password True URL Generic False Tag Filter Key False - On the permission page, set the Members to the end users group. I used “Everyone”
- Choose the new store application and click “Set credential”:
- Username/Password – user that has permission to execute the SMA’s runbooks. The username should include the domain (Domainusername). You can grant a user the required permission by adding it to the local group “SMA Administration Group” on the SMA server.
- URL of the SMA services. The format is (if deployed with the default port):
https://{SMA Server}:9090/00000000-0000-0000-0000-000000000000
- Optional – to filter the runbooks list for only a specific tag, type in the “Tag Filter” field the required tag name.
- Create an External List based on the “SmaBdcModel” External content type.
- Edit one of the workflows on the list, set the value of the “InitValue” field to the value of the first parameter.
- Check that the runbook was executed.