Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 13 additions & 32 deletions docs/logic-apps-agent-in-a-day/04_servicenow_dev_sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,32 @@ A ServiceNow environment will be required to enable our integration to create an

![ServiceNow ID Signup](./images/02_01_signup_servicenow_id.png "Signup")

1. You will receive an Email Verification Code:
1. You will receive a verification email:

![Email Verification Code](./images/02_02_email_verificaiton_code.png "Verify your account")

1. Navigate to the developer portal:

https://developer.servicenow.com/dev.do

(if prompted, sign in using the account created above)
If prompted, sign in using the account created above. You may receive an email from ServiceNow with a one time verification code. Multi-factor authentication is not required for this lab. You may skip that step.

1. Request a Developer Instance
1. When prompted to tune your experience, you can select "No, I need a guided experience." You do not have to specifify job responsibilities. Agree to terms of use and click on Finish Setup

![Request Developer Instance](./images/02_03_request_developer_instance.png)

1. Click the Start Building link:

![Start building](./images/02_04_start_building.png)

## Configure OAuth Authentication
We will need to configure an OAuth API endpoint to enable our logic apps to authenticate to our ServiceNow instance
1. Request a Developer Instance, by clicking on the Request Instance button in the upper right hand corner.
![Request Developer Instance](./images/02_03_request_developer_instance_a.png)

1. Navigate to the `OAuth -> Inbound Integrations` section
- Using the top navigation menu
- Select `All`
- Enter `OAuth` in the search box
- Select `Inbound Integrations`
1. Select the latest ServiceNow release.

![Menu OAuth Inbound Integrations](./images/02_05_menu_inbound_integrations.png "menu oauth inbound integrations")

1. Select `New Integration`

![New Integration](./images/02_06_inbound_integrations_new_integration.png "new integration")
![Request Developer Instance](./images/02_03_request_developer_instance.png)

1. Your instance will now get created, this step may take 5-10 minutes. You should receive an email when it is completed and your browser should re-direct to the following screen. Capture the following information in notepad: Dev Instance Name, Username, Password.
![Request Developer Instance](./images/02_04_DevInstanceDetails.png)


1. Select `OAuth - Authorization code grant`

![Create OAuth Authorization Grant](./images/02_07_create_oauth_authorization_grant.png "create oauth api endpoint")
1. Click the Start Building link:

1. Configure the OAuth API endpoint as follows:
- **Name:** `logic-apps-client`
- **Redirect URL:** https://logic-apis-northcentralus.consent.azure-apim.net/redirect

(**note:** your redirect URL will depend on the region you are deployment your Azure Logic Apps Instance. If you deployed to a different region, you will need to update your **Redirect URL: https://logic-apis-{azure-region}.consent.azure-apim.net/redirect**)
- Click `Submit`
![Start building](./images/02_04_start_building.png)

![Configure OAuth API Endpoint](./images/02_08_oauth_authorization_code_grant_config.png "configure oauth api endpoint")
1. Your ServiceNow instance has now been setup, and you may proceed to the next module.

1. Save the `Client ID`, `Client Secret` and the `Instance Name` created in this module for later steps when configuring the Logic Apps connection to ServiceNow
Original file line number Diff line number Diff line change
Expand Up @@ -82,53 +82,30 @@ In this module we will create a stateful workflow to create a ServiceNow inciden

- Configure the Connection:
- **Connection Name:** `connServiceNowDev`
- **Authentication Type:** `Use Oauth2`
- **Instance Name:** [obtained from Module 2]
- **Authentication Type:** `Basic Authentication`
- **Instance Name:** [obtained from Module 4]
- example: `devXXXXXX`
- can also be found in the URL of your developer instance https://[instance name].service-now.com
- **ClientId:** [obtained from Module 2 - ]
- example: 924168e8304a2210cc58c3f34c9b62f3
- Click `Sign in`
- **Username:** [obtained from Module 4 - ]
- example: admin
- **Password:** [obtained from Module 4 - ]
- Click `Create new`

![Configure ServiceNow Connection](./images//08_09_servicenow_connection_configuration.png)

- **NOTE** you **may** receive the following error.

![ServiceNow Connection Error - Invalid Redirect URI](./images/08_10_servicenow_connection_error_invalid_redirect_uri.png "servicenow connection error invalid redirect uri")

If you receive this error you will need to:
- Copy the URL into a text editor
- note the `redirect_uri` parameter in the query string
- redirect_uri=https%3a%2f%2flogic-apis-canadacentral.consent.azure-apim.net%2fredirect
- convert the URL Encoded ASCII characters back as follows
- Replace %3a with :
- Replace %2f with /
- in the above example we would have resolved to https://logic-apis-canadacentral.consent.azure-apim.net/redirect

- Update the Application Registration entry created in the [Module 4 - Prerequisites - ServiceNow setup](04_servicenow_dev_sandbox.md).
Add the Redirect URL

![ServiceNow Connection Error - Invalid Redirect URI](./images/08_10_servicenow_connection_error_invalid_redirect_uri.png "servicenow connection error invalid redirect uri")

- Close the browser popup window

- Click the `Sign In` button again

**Note** please check for errors in the upper right hand corner of your browser. Some browsers may block popups.

![ServiceNow Connection - Sign In](./images/08_11_servicenow_connection_sign_in_after_error.png "service now connection sign in")

1. Click `Allow` granting Logic Apps permission to connect to your ServiceNow instance

![Service Now Grant Permissions](./images/08_12_servicenow_connection_all_permissions.png "service now grant permissions")

1. Configure the List Records Action as follows
- **Record Type:** `Group`
- **Advanced Parameters** (click `Show all`)
- **Query:** `name=@{triggerBody()?['AssignmentGroup']}`

![ServiceNow List Action Configuration](./images/08_14_servicenow_list_records_configuraiton.png "servicenow list records configuration")


**Note:** ServiceNow has two types of Groups that are available in this dropdown. Unfortunately, the ordering in the dropdown is non-deterministic. To ensure that you have the right Group selected, click on the Code view tab and ensure that 'sys_usr_group' is selected. If you see one that references CMDB, you have the wrong instance and should select the other value from the dropdown.

![List Groups troubleshooting](./images/08_13_servicenow_list_records_troubleshooting.png)


1. Add a new action

1. Select the `ServiceNow - Create Record` action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In this module we will take the ServiceNow Close Incident workflow and add it as
- **Workflow Name** - `tool-ServiceNow-CloseIncident`
- Click **Show all**

![Configure Call Workflow](./images/11_06_configure_call_workflow.png "configure call workflow")
![Configure Call Workflow](./images/13_10_configure_call_workflow_parameters.png "configure call workflow")

1. Configure the Tool action
- Rename the tool to `Close Service Now Incident`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.