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:
- 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.
- Foster Collaboration: Development, operations, and ITSM teams need to break down silos and collaborate more effectively.
- 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:
- Automated Change Approvals: Automatically create and approve change requests in ServiceNow as part of your CI/CD pipeline, reducing manual overhead.
- Compliance and Audit Trails: Ensure that all changes are logged and tracked in ServiceNow for audit purposes, helping meet compliance requirements.
- Improved Collaboration: Enhance visibility between development, operations, and IT service management teams.
- Faster Release Cycles: Streamline release processes by automating change management approvals, reducing deployment bottlenecks.
Pre-requisites
Before starting, ensure you have the following:
- Cultural Shift and Organizational Buy in.
- ServiceNow Instance with access to the Change Management module.
- Azure DevOps Organization with access to create pipelines.
- ServiceNow DevOps Extension for Azure DevOps installed from the Azure DevOps Marketplace.
- Appropriate ServiceNow API credentials for authentication.
- 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.
- 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.
- 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:
- Log in to your ServiceNow instance.
- Go to ServiceNow DevOps in the application navigator.
- Navigate to DevOps Configurations > Tool Integrations.
- Click on New and choose Azure DevOps.
- 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.
- 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:
- Go to Change Management > Change Request Templates in ServiceNow.
- Click on New to create a template.
- 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.
- 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
- Navigate to your Azure DevOps project.
- Go to Pipelines > Create Pipeline.
- 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:
- Configure Notifications:
- Use ServiceNow’s Notification Engine to send alerts when a change request is created, approved, or rejected.
- 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:
- Trigger your Azure DevOps pipeline.
- Verify that a change request is automatically created in ServiceNow.
- Check that the approval process works as expected (manual or auto-approved).
- Ensure that the pipeline waits for approval before proceeding with the deployment.
- Confirm that the change request status is updated upon pipeline completion.
Best Practices for ServiceNow and Azure DevOps Integration
- Use Separate Service Accounts: Use dedicated service accounts for API connections to enhance security and auditability.
- Implement Role-based Access Control (RBAC): Limit access to change management tasks and pipelines based on user roles.
- Monitor Logs and Metrics: Regularly review pipeline and ServiceNow logs to ensure smooth integration.
- Test in a Non-Production Environment: Validate your integration in a staging environment before rolling it out to production.
- Automate Change Approvals: For non-critical changes, leverage ServiceNow’s auto-approval workflows to accelerate deployments.