Link Search Menu Expand Document

Guide

Table of contents

  1. Prerequisites
    1. Install ServiceNow DevOps Change Velocity
    2. Install ServiceNow DevOps Config
  2. Configure ADO Backlog
    1. Create Some ADO Work Items
    2. Connect GitHub with Azure Boards
  3. Configure ServiceNow DevOps Change
    1. Configure DevOps Performance Analytics Jobs
    2. Configure Application Services Change Group
    3. Create ServiceNow DevOps App
    4. Create ServiceNow DevOps Admin User
    5. Create ServiceNow DevOps Admin Credential
    6. Configure ServiceNow DevOps Integration User
    7. Create ServiceNow DevOps Connection
    8. Create DevOps GitHub Tool
    9. Create DevOps ADO Tool
    10. Check Service Connections
    11. Configure Pipeline
  4. Approve Code Change
    1. Make a Code Change
    2. Trigger the Azure DevOps Pipeline
    3. Approve Change in ServiceNow

Prerequisites

Install ServiceNow DevOps Change Velocity

ServiceNow DevOps Change Velocity helps Cloud Native Teams define Change Approval policies for code changes and preventing high risk changes to deployment environments. Leverage your toolchain data in approvals to completely automate the change approval process. Installation is as follows:

  1. Login to your SN Instance as Administrator

  2. Navigate to the System Definition > Plugins and install or activate the following plugins:

    Plugin Name Plugin ID
    DevOps Change Velocity V1.33.3 sn_devops_chgvlcty

Install ServiceNow DevOps Config

ServiceNow DevOps Config helps Cloud Native Teams define advanced validation rules for comparing configuration changes against defined baselines and preventing unauthorised changes to deployment environments. Use the built-in Change Approval Workflows to completely automate the change approval process. Installation is as folows:

  1. Login to your SN Instance as Administrator

  2. Navigate to the System Definition > Plugins and install or activate the following plugins:

    Plugin Name Plugin ID
    DevOps Config V1.0.3 sn_devops_config
    DevOps Config Insights V1.0.3 sn_devops_config_i
    DevOps Config Policy Content Pack V1.0.3 sn_devops_config_p
    DevOps Config Exporter Content Pack V1.0.3 sn_devops_config_e
    Configuration Data Management V1.0.0 sn_cdm
    Context Menu Component V1.0.0 sn_cdm_ctx_menu
    Policy as Code Engine V1.0.0 sn_pace

Configure ADO Backlog

Create Some ADO Work Items

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Boards and create a couple of Work Items

    Work Items

    NOTE: As a best coding practice, developers should set the Git commit message to one of these Work Items relating the code change to the Azure Boards work item.

Connect GitHub with Azure Boards

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Project Settings > Boards > GitHub connections and press the Connect your GitHub account button.

  4. Enter your GitHub password if prompted.

  5. Select the GitHub organization that you want to connect to Azure Boards (e.g. YOUR GITHUB USER ID)

  6. Select the GitHub repository you want to use with your Azure Boards. (e.g. YOUR GITHUB USER ID/cassandra)

  7. Press the Approve, Install & Authorize Button

    GitHub Connection

  8. At this point, all commits in Git using the Azure Boards Work Item notation (e.g. AB#123) will be propagated to the relevant Work Item.

    NOTE: For more information on linking Git commits to Azure Boards see the Azure Devops Documentation

Configure ServiceNow DevOps Change

Configure DevOps Performance Analytics Jobs

  1. Login to your NOW Instance as Administrator

  2. Navigate to Performance Analytics > Data Collector > Jobs

  3. Search for Jobs where Name = *DevOps

    PA Jobs

  4. For each Job, set the fields as follows:

    Field Value
    Active true
    Run as System Administrator

    NOTE: You will have to switch application scope from Global to DevOps Data Model or DevOps Insights accordingly to make changes to Jobs.

Configure Application Services Change Group

  1. Login to your NOW Instance as Administrator

  2. Navigate to Configuration > Application Services

  3. For all Application Services under change control, set the Change Group field to the relevant group (e.g. Team Boutique)

    Change Group

Create ServiceNow DevOps App

  1. Login to your NOW Instance as Administrator

  2. Navigate to DevOps > Create App

  3. Create an App as follows:

    Field Value
    Application Name Boutique App

Create ServiceNow DevOps Admin User

  1. Login to your NOW Instance as Administrator

  2. Navigate to User Administration > Users

  3. Create an admin user as follows:

    Field Value
    Username YOUR DEVOPS ADMIN USER NAME (e.g. devops)
    Password YOUR DEVOPS ADMIN USER PASSWORD
    Roles admin
  4. Press Submit Button

Create ServiceNow DevOps Admin Credential

  1. Login to your NOW Instance as Administrator

  2. Navigate to Connections & Credentials > Credentials

  3. Create a Basic Auth Credential as follows:

    Field Value
    Name YOUR DEVOPS ADMIN USER CREDENTIAL NAME (e.g. devops)
    User Name YOUR DEVOPS ADMIN USER NAME (e.g. devops)
    Password YOUR DEVOPS ADMIN USER PASSWORD
  4. Press Submit Buttom

Configure ServiceNow DevOps Integration User

  1. Login to your NOW Instance as Administrator

  2. Navigate to User Administration > Users

  3. Locate the User ID: devops.integration.user

  4. Update User as follows:

    Field Value
    Password YOUR DEVOPS INTEGRATION USER PASSWORD
  5. Press Update Button

Create ServiceNow DevOps Connection

  1. Login to your NOW Instance as Administrator

  2. Navigate to Connections & Credentials > Connections & Credentials Aliases

  3. Click on the CreateDevOpsTool alias

  4. Under the Connections Tab create a new Connection

  5. Create a New Connection & Credential Alias as follows:

    Field Value
    Name YOUR SERVICENOW CONNECTION NAME(e.g. devops)
    Credential YOUR DEVOPS ADMIN USER CREDENTIAL NAME (e.g. devops)
    Connection URL YOUR SERVICENOW URL (e.g. https://srecon22.service-now.com)
  6. Press Submit Button

Create DevOps GitHub Tool

  1. Login to your NOW Instance as Administrator

  2. Navigate to DevOps > Tools > Create New

    Field Value
    Name YOUR ADO TOOL NAME (e.g. MyGitHub)
    Tool Integration GitHub
    Tool Url GITHUB API URL (e.g. https://api.github.com)
    Credential Type Basic Auth
    Tool Username YOUR GITHUB ID
    Tool Password / Access Token YOUR GITHUB PAT
  3. Press Submit Button

  4. Press Discover Button

  5. Select Repositories Tab

  6. Select the cassandra repository

  7. Set Track file changes = True

  8. Press the Configure Button and configure as follows:

    Field Value
    Integration User DevOps Integration User
    Integration user password YOUR DEVOPS INTEGRATION USER PASSWORD
  9. Press Send Button

    NOTE: The provided Tool URL and credentials will be used to create a Webhook from the Git Repo to ServiceNow.

Create DevOps ADO Tool

  1. Login to your NOW Instance as Administrator

  2. Navigate to DevOps > Tools > Create New

    Field Value
    Name YOUR ADO TOOL NAME (e.g. MyAdo)
    Tool Integration Azure DevOps
    Tool Url YOUR ADO ORG URL (e.g. https://dev.azure.com/YOURORG/YOURREPO)
    Tool Username YOUR ADO TOKEN NAME
    Tool Password / Access Token YOUR ADO TOKEN VALUE
  3. Press Submit Button

  4. Press Discover Button

  5. Select Repositories Tab

  6. Select the cassandra repository

  7. Set the Track field to true

  8. Press the Configure Button and configure as follows:

    Field Value
    Integration User DevOps Integration User
    Integration user password YOUR INTEGRATION USER PASSWORD
  9. Press Send Button

    NOTE: The provided Tool URL and credentials will be used to create 2 Service Connections in Azure DevOps

  10. Select Pipelines Tab

  11. For all Pipelines, set the App field to Boutique App

  12. For all Pipelines, set the Track field to true

    DevOps Pipelines

Check Service Connections

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Project Settings and press the Service Connections button.

  4. Locate the 2 ServiceNow Service Connections you created earlier from ServiceNow.

    Service Connections

Configure Pipeline

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Pipelines > All and create an azure-pipelines folder, if it does not exist.

  4. Navigate to the azure-pipelines folder and press Create Pipeline

  5. For the Where is your code? prompt, select GitHub

  6. For the Select a repository prompt, select your GitHub Repository.

  7. Press Approve and Install

  8. Enter your GitHub password if prompted.

  9. At the Configure your pipeline prompt, select Existing Azure Pipelines YAML file

  10. At the Select an existing YAML file prompt, set fields as follows:

    Field Value
    Branch main
    Path /azure-pipelines/kubernetes-deploy.yml
  11. Press Continue to review your pipeline YAML.

  12. Un-Comment the DevOps_Change Stage and set all occurences of connectedServiceName to your ServiceNow Service Connection name.

    Uncomment Pipeline

  13. Create the following Pipeline Variables:

    Name Value Keep this value secret Let users override this value when running this pipeline
    REPO_USERNAME YOUR DOCKER HUB ID False True
    REPO_PAT YOUR DOCKER PAT True True
    REPO_PREFIX YOUR DOCKER HUB ID False True
    SERVICE_NAME YOUR SERVICE NAME (e.g. frontend) False True
    SERVICE_NAMESPACE cassandra False True
  14. Using the Run Button, select Save Pipeline

Approve Code Change

Make a Code Change

  1. Sign In to GitHub

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Locate the src/adservice/src/main/java/hipstershop/AdService.java file

  4. Update the createAdsMap method for any product to display different discount text as follows:

    Code Change

  5. Commit changes using the Azure Boards Work Item notation (e.g. AB#123)

    Code Change

Trigger the Azure DevOps Pipeline

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Pipelines > All and select the azure-pipelines folder.

  4. Run the kubernetes-deploy Pipeline and set parameters as follows:

    Parameter Value
    SERVICE_NAME adservice
  5. Notice that the pipeline has been paused, pending change control approval.

    Paused Pipeline

Approve Change in ServiceNow

  1. Login to your NOW Instance as Administrator

  2. Navigate to DevOps > Orchestrate > Pipeline Change Requests

    Change Request

  3. Select Change and review all relevant items.

    Change Detail

  4. Click on the Approvers Tab

  5. Hover over Approver and right-click Approve the item.

  6. Press the Implement Button

    NOTE: Notice how the Azure DevOps Pipeline has been un-paused.

  7. Browse to the EXTERNAL-IP to view the Boutique Application and look for the updated AdService discount text.

    Discounted Watches