logo

NJP

Orchestration: Azure Create User workflow Activity

Import · Mar 19, 2018 · article

Are you confused about how to integrate ServiceNow and Azure, in order to use Orchestration to use ServiceNow to create users within Azure? This is not the Multi Provider SSO, that creates users within ServiceNow. This is for using a request in ServiceNow to send data to Azure and Create the User in Azure.

I Created a new application in Azure showing you all of the APP ID's. i've already deleted this application so it does not work if you try to use it.

**Disclaimer**

I am NOT an Expert in this area. I had a need and figured it out. I went through this step by step in a new environment and was able to get the workflow working correctly.

image

  1. Login to Microsoft Azure using an account that has admin credentials.
  2. Click Active Directory.
    image
  3. Click on App Registrations
    image
  4. Create a New Application Registration
    image
  5. Give it a Name Application Type: Web App / API
    Sign-on URL: https://devxxxxx.service-now.com/login.do
    click Create:
    image
  6. Copy the Application ID and set it aside. You’ll need this data for ServiceNow.
    image
  7. Click the Settings:
    image
  8. Click on Properties:
    image
  9. Change Multi-tenanted to “Yes”
  10. Click Save:
    image
  11. Click on Reply URL’s
    image
  12. Set any Redirect Urls that are needed. Your Production, Development, and Test Environments. make sure to have the /oauth_redirect.do at the end.
    https://dev13195.service-now.com/oauth%5Fredirect.do
  13. Click Save
    image
  14. Click on Keys.
    image
  15. Give the Key a Name (will only be used in Azure, This way you can tell what the key is for.
    Set the Expiration Date. If you set an expiration date, the integration will fail when it expires.
  16. Click Save to generate the key.
    image
  17. Copy the Key (This will be the only time you’ll ever see this key in Azure. As soon as you leave this “blade” it will be hidden forever).
    image
  18. Click Required Permissions
    image
  19. Click the Windows Azure Active Directory API
  20. Check the “Read and write directory data” in the Application Permissions.
  21. Check the “Read and write directory data” in the Delegated Permissions.
  22. Click Save
    image
  23. Click Grant Permissions
  24. Click Yes.
    image
  25. Copy your Endpoints Information and set it aside.
    image
    image

ServiceNow Settings:

  1. Change to the Azure AD Application.
    image
  2. Type “Oauth” in the filter navigator
  3. Under “System OAuth” click on Application Registry
  4. Click the Azure AD Record. (Do not Create a new One as this profile is setup for the Orchestration Events)
    image
    image
  5. Client ID: Copy the App ID that you copied from Azure.
  6. Client Secret: Copy the Private Key you copied from Azure.
  7. Authorization URL: The Link you copied from the Endpoints.
    https://login.microsoftonline.com/92071890-a56d-4f26-92c0-aaa38471b9c4/oauth2/authorize

However, you need to add ?resource= {app id}

https://login.microsoftonline.com/92071890-a56d-4f26-92c0-aaa38471b9c4/oauth2/authorize?resource=2aefeea8-44ae-4747-8c6c-a20dec102c9e

  1. Click the OAuth Entity Profiles Tab.
  2. Click the Azure AD default profile to load the record.
    image
  3. Double Click the Insert New Row
    image
  4. Click the Magnifying Glass
  5. Select the Profile you just created.
  6. Save the record
    image
  7. Type “Rest” in the filter navigator
  8. Click on the “Rest Message”
  9. Click the “Azure AD user Management” record
    image
  10. Paste the Graph API link that you copied from the Azure Endpoints.
    image
  11. Save the record
  12. Edit each record
    image
  13. Enter the Graph API link that you copied from Azure Endpoints
  14. Update each record.replace the https://graph.windows.net/myorganization with the graph endpoint.if there is a /user/${userID} dont erase it.
    image
  15. Test the OAuth Token:
    image
    image
    image

image

View original source

https://www.servicenow.com/community/now-platform-articles/orchestration-azure-create-user-workflow-activity/ta-p/2310020