Get powershell Runbook result with Sharpoint List Workflow

Giovanni Rinaldi 1 Reputation point
2021-04-13T11:27:22.657+00:00

Goodmorning
Let's say I have a Sharpoint online list with two fields: GivenName and Surname
When a new record is saved, a workflow stars and calls an Azure Automation Runbook through a Webhook, passing GivenName and Surname as parameters.
The Azure runbook creates an account both on premise and online.

Let's say I now want to write the userprincipalname of the new created account in a third field in the sharepoint linst
Is there a way have workflow to do this?

Thank you for your help

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,685 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
583 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Riwut Libinuko 1 Reputation point
    2021-06-25T12:43:01.273+00:00

    Hi,

    Based on the description, I assume that you have working solution that does following:

    1. On SharePoint item creation, call Webhook passing GivenName and Surname.
    2. Webhook (azure runbook) creates account on-premise and online.

    Then, you would like to update the item with userprincipalname of the newly created account.

    Updating SharePoint list item will require itemId, hence I can propose following update:

    1. On SharePoint item creation, call Webhook passing GivenName, Surname and ItemId.
    2. Webhook (azure runbook) creates account on-premise + online, and store the userprincipalname and itemId in Azure storage queue.
    3. Add Logic App that monitor Azure storage queue, and update SharePoint list based on itemId. It will update userprincipalname.

    Happy coding.

    0 comments No comments

  2. Giovanni Rinaldi 1 Reputation point
    2021-06-27T10:37:22.51+00:00

    First of all thank you for your kind answer.
    I'd never use a logic app, since it's a paid solution

    I ended up with having the webhook (azure Runbook triggered by the sharepoint workflow) doing everything I need, both onpremise and online.
    The runbook also sends an email with all users parameters and also with the operations log

    The logs are also written in the output queue, and I can see the operations progress on Azure

    Is there a way to follow the runbook progress in a sharepooint field, or in a powerapp?

    Thank you

    0 comments No comments

  3. Riwut Libinuko 1 Reputation point
    2021-06-27T10:44:40.26+00:00

    Hi,

    May I know if you are using Power Automate (previously Microsoft Flow) to create the SharePoint's workflow?

    0 comments No comments

  4. Giovanni Rinaldi 1 Reputation point
    2021-06-27T14:10:39.727+00:00

    Sure.
    No I'm not using Power Automate, I usually don't like it very much for many reasons.
    It has many limits and "pushes" to much towards Microsoft online direction, in my opinion

    Also, the great majority of the connectors of Power automate are "premium".
    This means that theycome at a tremendous cost!
    They need a not-cheap license for each user will use the flow (or the App).
    It can also have a pay-per-run option, but I'm not sure.

    Currently I'm using a sharepoint designer 2013 workflow to use the webhook and trigger the powershell runbook

    0 comments No comments

  5. Riwut Libinuko 1 Reputation point
    2021-06-28T01:19:12.657+00:00

    Thanks for clarifying.

    I understand that you are planning to use PowerShell runbook for everything. The missing part in your flow is to update SharePoint list item, after account has been created.

    Assuming that you modified the original webhook to include ItemId (and other SharePoint relevant info), you can follow this article : https://blog.tyang.org/2014/08/30/sma-runbook-update-sharepoint-2013-list-item/

    You may want to read this article to get started with SPO credential : https://practical365.com/how-to-use-azure-automation-with-sharepoint-online-part-one/

    Please let me know if it helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.