In today’s dynamic IT landscape, continuous integration and continuous delivery (CI/CD) have become essential practices for implementing Azure infrastructure changes as well as delivering software at high speed and with enhanced reliability. However, integrating change management processes—especially for organizations with strict compliance requirements—can be challenging.

While integrating ServiceNow Change Management into your Azure DevOps pipelines is a powerful way to streamline change approvals and enforce compliance, it’s not just about technology. Success in this integration also requires a significant cultural shift within your organization. In this section, we’ll explore the cultural changes needed to support this integration and how to drive that transformation effectively.

Integrating ServiceNow with Azure DevOps represents a shift from rigid, manual change processes to an automated, agile approach where change management is integrated into the DevOps lifecycle. This requires teams to:

  1. Trust Automation: Traditional ITSM practices often rely on manual oversight to reduce risk. Shifting to automated change approvals requires a culture of trust in automated systems.
  2. Foster Collaboration: Development, operations, and ITSM teams need to break down silos and collaborate more effectively.
  3. Embrace Agility and Continuous Feedback: Change management processes must evolve from being bottlenecks to becoming enablers of continuous delivery and rapid feedback loops.

So now that some prerequisite detail has been exposed let’s get back to the implementation of the integration project.

In this comprehensive guide, we’ll walk you through how to seamlessly integrate ServiceNow Change Management into your Azure DevOps pipelines. By the end of this guide, you’ll have a fully automated, compliant CI/CD workflow.


Why Integrate ServiceNow with Azure DevOps?

Agin, before diving into the how, let’s explore the benefits of integrating ServiceNow Change Management with Azure DevOps:

  1. Automated Change Approvals: Automatically create and approve change requests in ServiceNow as part of your CI/CD pipeline, reducing manual overhead.
  2. Compliance and Audit Trails: Ensure that all changes are logged and tracked in ServiceNow for audit purposes, helping meet compliance requirements.
  3. Improved Collaboration: Enhance visibility between development, operations, and IT service management teams.
  4. Faster Release Cycles: Streamline release processes by automating change management approvals, reducing deployment bottlenecks.

Pre-requisites

Before starting, ensure you have the following:

  1. Cultural Shift and Organizational Buy in.
  2. ServiceNow Instance with access to the Change Management module.
  3. Azure DevOps Organization with access to create pipelines.
  4. ServiceNow DevOps Extension for Azure DevOps installed from the Azure DevOps Marketplace.
  5. Appropriate ServiceNow API credentials for authentication.
  6. ServiceNow Developer Account (if needed) to create integration points.

Step 1: Install the ServiceNow DevOps Extension for Azure DevOps

The ServiceNow DevOps Extension simplifies the integration between Azure DevOps pipelines and ServiceNow’s Change Management process.

  1. Navigate to the Azure DevOps Marketplace:
    • Go to the Azure DevOps Marketplace.
    • Search for “ServiceNow DevOps”.
    • Click on “Get it free” and follow the prompts to install it in your Azure DevOps organization.
  2. Add the ServiceNow DevOps Extension to your pipeline:
    • After installation, you’ll be able to access the ServiceNow tasks directly in your Azure DevOps pipelines.

Step 2: Set Up ServiceNow DevOps Integration in ServiceNow

To integrate ServiceNow with Azure DevOps, you need to configure ServiceNow to recognize your Azure DevOps environment:

  1. Log in to your ServiceNow instance.
  2. Go to ServiceNow DevOps in the application navigator.
  3. Navigate to DevOps Configurations > Tool Integrations.
  4. Click on New and choose Azure DevOps.
  5. Enter the following information:
    • Instance URL: Your Azure DevOps organization URL.
    • Personal Access Token (PAT): Generate this in Azure DevOps under User Settings > Personal Access Tokens.
  6. Click Save to establish the connection.

Step 3: Create a ServiceNow Change Request Template

To streamline the change management process, set up a Change Request Template in ServiceNow:

  1. Go to Change Management > Change Request Templates in ServiceNow.
  2. Click on New to create a template.
  3. Set fields like:
    • Category: Normal Change.
    • Assignment Group: DevOps or relevant team.
    • Approval Group: Set an auto-approval group if you want changes to be auto-approved.
  4. Save the template.

This template will be used by your Azure DevOps pipeline to automatically generate change requests.


Step 4: Create an Azure DevOps Pipeline with ServiceNow Integration

Now, let’s configure your Azure DevOps pipeline to integrate with ServiceNow Change Management:

Step 4.1: Create or Edit an Azure DevOps Pipeline

  1. Navigate to your Azure DevOps project.
  2. Go to Pipelines > Create Pipeline.
  3. Choose your repository (GitHub, Azure Repos, etc.) and follow the setup process.

Step 4.2: Add ServiceNow Change Management Tasks

Add the following tasks to your pipeline YAML file:

Task 1: Create a Change Request

yamlCopy code- task: ServiceNowCreateChangeRequest@1
  inputs:
    serviceConnection: 'ServiceNowConnection'
    changeRequestType: 'normal'
    changeRequestTemplate: 'DevOps Change Template'
    assignmentGroup: 'DevOps Team'
    shortDescription: 'Automated deployment change request'
    description: 'CI/CD pipeline change request from Azure DevOps'

This task will automatically create a change request in ServiceNow whenever a pipeline is triggered.

Task 2: Wait for Change Approval

If your change process requires approval, add a task to wait for ServiceNow approval before proceeding:

yamlCopy code- task: ServiceNowWaitForChangeApproval@1
  inputs:
    serviceConnection: 'ServiceNowConnection'
    changeRequestSysId: $(changeRequestSysId)
    waitForApprovalTimeout: '3600'

This task will pause the pipeline until the change request is approved in ServiceNow.

Task 3: Update Change Request Status

Once the deployment is complete, update the status of the change request:

yamlCopy code- task: ServiceNowUpdateChangeRequest@1
  inputs:
    serviceConnection: 'ServiceNowConnection'
    changeRequestSysId: $(changeRequestSysId)
    status: 'Closed'
    closeNotes: 'Deployment completed successfully'

Step 4.3: Save and Run Your Pipeline

  • Save the pipeline configuration.
  • Queue a new build to test the integration.
  • Confirm that a change request is automatically created in ServiceNow and linked to your deployment.

Step 5: Automate Notifications and Approvals

To fully automate the process, you can set up notifications and approval workflows in ServiceNow:

  1. Configure Notifications:
    • Use ServiceNow’s Notification Engine to send alerts when a change request is created, approved, or rejected.
  2. Auto-approval Rules (Optional):
    • Set up business rules in ServiceNow to auto-approve changes based on criteria such as deployment type, change category, or environment (e.g., non-production).

Step 6: Validate the Integration

After setting up the integration, test it to ensure it’s working correctly:

  1. Trigger your Azure DevOps pipeline.
  2. Verify that a change request is automatically created in ServiceNow.
  3. Check that the approval process works as expected (manual or auto-approved).
  4. Ensure that the pipeline waits for approval before proceeding with the deployment.
  5. Confirm that the change request status is updated upon pipeline completion.

Best Practices for ServiceNow and Azure DevOps Integration

  1. Use Separate Service Accounts: Use dedicated service accounts for API connections to enhance security and auditability.
  2. Implement Role-based Access Control (RBAC): Limit access to change management tasks and pipelines based on user roles.
  3. Monitor Logs and Metrics: Regularly review pipeline and ServiceNow logs to ensure smooth integration.
  4. Test in a Non-Production Environment: Validate your integration in a staging environment before rolling it out to production.
  5. Automate Change Approvals: For non-critical changes, leverage ServiceNow’s auto-approval workflows to accelerate deployments.