ServiceNow Integration With Azure DevOps

ServiceNow
Azure Cloud

Share Post Now :

HOW TO GET HIGH PAYING JOBS IN AWS CLOUD

Even as a beginner with NO Experience Coding Language

Explore Free course Now

Table of Contents

Loading

This blog provides a basic overview of Azure Pipelines integration with ServiceNow change management to enhance collaboration between development and IT teams.

The technologies that are covered in this blog are a part of the Azure DevOps environment. If it’s something in which you have an interest or you want to learn, then you can visit our previous blog to know more about the [AZ-400] Microsoft Azure DevOps certification.

In this blog we will be covering:

  1. Configure the ServiceNow instance
  2. Set up the Azure DevOps organization
  3. Configure a release pipeline
  4. Add a task to update the change request
  5. Running an Azure release

By including change management in CI/CD pipelines, teams can reduce the risks associated with changes and follow service management methodologies such as ITIL, while gaining all DevOps benefits from Azure Pipelines.

ServiceNow is a software-as-a-service (SaaS) provider of IT service management (ITSM) software, including change management. Specific change management subprocesses include change risk assessment, change schedule, change approvals, and oversight. With change management, your organization can reduce the risks associated with change, while speeding up the deployments with Azure Pipelines.

ServiceNow Logo

Configure The ServiceNow Instance 

Step 1: Install the Azure Pipelines application on your ServiceNow instance, we require credentials to complete the installation.

Step 2: Create a new user in ServiceNow and grant them x_mioms_azpipeline.pipelinesExecution role.

Azure Pipelines service account

Set Up The Azure DevOps Organization

Step 1: Install the ServiceNow Change Management extension on your Azure DevOps organization.

Step 2: This extension enables the integration of ServiceNow Change Management with Azure Pipelines. Follow the instructions to “Get it Free”

ServiceNow Extension

Step 3: Create a new ServiceNow service connection in the Azure DevOps project used for managing your releases. Enter the user name and password for the service account created in ServiceNow.

Adding serviceNow connection

ServiceNow connection settings

Also Check: Our blog post on Veracode. Click here

Basic Authentication

This needs a service account (user) to be created in ServiceNow. Provide username and password for the service account configured for basic auth.

Use Verify connection before using it in the gate or task.

OAuth2 Authentication

In addition to granting a role to a user in ServiceNow, Azure DevOps should be registered in ServiceNow as an OAuth app.

Register your OAuth configuration in Azure DevOps Services

Step 1: Sign in to Azure DevOps Services.

Step 2: Add OAuth configuration from Organization settings>Oauth configurations

OAuth Configuration

Create an OAuth configuration using the OAuth application details obtained while registering Azure DevOps as an OAuth app in ServiceNow.

OAuth configuration Settings

Create OAuth service connection for ServiceNow

Use the OAuth configuration created above and provide the ServiceNow instance Url.

Check Out: What is Ansible? Click here

Configure A Release Pipeline

Step 1: In your release pipeline, add a pre-deployment gate for ServiceNow Change Management.

Pre-deployment Conditions

Step 2: Select the ServiceNow service connection you created earlier and enter the values for the properties of the change request.

Pipeline gates

Gate can be configured to create a new change request for every run of the pipeline or use an existing request. Inputs provided in the gate are used as properties for the new change request in ServiceNow, if applicable.

Inputs for Gate:

  • ServiceNow connection: Connection to the ServiceNow instance used for change management.

Additional properties can be set in the created change request using the following inputs. Note: Available inputs change based on the selected change type.

  • Description: A detailed description of the change.

Gate Success Criteria :

  • Desired state of change request: The gate would succeed and the pipeline continues when the change request status is same as the provided value.

Gate Output Variables :
ServiceNow gate produces output variables. You must specify the reference name to be able to use these output variables in the deployment workflow. Gate variables can be accessed by using "PREDEPLOYGATE" as a prefix in an agentless job in the workflow. For eg. when the reference name is set to ‘gate1’, then the change number can be obtained as $(PREDEPLOYGATE.gate1.CHANGE_REQUEST_NUMBER).

  • CHANGE_REQUEST_NUMBER: Number of the change request.

Add A Task To Update The Change Request

adding pipeline tasks

Inputs for Update change request task:

  • ServiceNow connection: Connection to the ServiceNow instance used for change management.

The update task would fail if none of the fields in the change request are updated during the execution of the task. ServiceNow ignores invalid fields and values passed to the task.

Also Read: Our blog post on Azure DevOps Environment Setup. Click here

Running An Azure Release

Step 1: Create a new release from the configured release pipeline in Azure DevOps

Step 2: After completing the Dev stage, the pipeline creates a new change request in ServiceNow for the release and waits for it to reach the desired state.

Azure release

Step 3: The values defined as gate parameters will be used. You can get the change number that was created from the logs.

ServiceNow Queue

Step 4: The ServiceNow change owner will see the release in the queue as a new change.

Change Request

Step 5: The release that caused the change to be requested can be tracked from the Azure DevOps Pipeline metadata section of the change.

Azure Pipelines Metadata

Step 6: The change goes through its normal life cycle: Approval, Scheduled, and more until it is ready for implementation.

Step 7: When the change is ready for implementation (it is in the Implement state), the release in Azure DevOps proceeds. The gates status will be as shown here:

Gate success demo

After the deployment, the change request is closed automatically.

Related/References

Next Task For You

Begin your journey toward Mastering Azure Cloud and landing high-paying jobs. Just click on the register now button on the below image to register for a Free Class on Mastering Azure Cloud: How to Build In-Demand Skills and Land High-Paying Jobs. This class will help you understand better, so you can choose the right career path and get a higher paying job.

azure cloud job free class

Picture of mike

mike

I started my IT career in 2000 as an Oracle DBA/Apps DBA. The first few years were tough (<$100/month), with very little growth. In 2004, I moved to the UK. After working really hard, I landed a job that paid me £2700 per month. In February 2005, I saw a job that was £450 per day, which was nearly 4 times of my then salary.