DevOps Change Velocity Azure Devops Tool Connection with OAuth 2.0Summary .kb-wiki-content { font-family: Lato, Arial, sans-serif !important; color: #1F2937 !important; } .kb-wiki-content h2 { color: #032D42 !important; font-size: 24pt !important; margin-bottom: 20px !important; border-bottom: 2px solid #00718F !important; padding-bottom: 8px !important; margin-top: 30px !important; } .kb-wiki-content h3 { color: #032D42 !important; font-size: 18pt !important; margin-top: 25px !important; margin-bottom: 15px !important; } .kb-wiki-content h4 { color: #344054 !important; font-size: 14pt !important; margin-top: 20px !important; margin-bottom: 10px !important; } .kb-wiki-content p { margin-bottom: 15px !important; line-height: 1.6 !important; } .kb-wiki-content li { line-height: 1.7 !important; } .kb-wiki-content a { color: #00718F !important; } .kb-wiki-content a:hover { color: #024F69 !important; } .kb-wiki-content code { background-color: #F2F4F7 !important; padding: 1px 5px !important; border-radius: 3px !important; font-family: Menlo, Consolas, monospace !important; color: #1F2937 !important; font-size: 10.5pt !important; } .kb-wiki-content table { width: 100% !important; border-collapse: collapse !important; margin: 20px 0 !important; border: 1px solid #E4E7EC !important; } .kb-wiki-content th { background-color: #F2F4F7 !important; color: #032D42 !important; padding: 10px 12px !important; text-align: left !important; font-weight: 600 !important; border-bottom: 2px solid #00718F !important; } .kb-wiki-content td { padding: 10px 12px !important; border-bottom: 1px solid #E4E7EC !important; } .kb-wiki-content tr:hover { background-color: #F9FAFB !important; } .kb-wiki-content .alert { padding: 14px 18px !important; margin: 20px 0 !important; border-radius: 4px !important; border-left: 4px solid !important; color: #1F2937 !important; } .kb-wiki-content .alert-info { background-color: #F2F8FA !important; border-color: #00718F !important; } .kb-wiki-content .alert-warning { background-color: #FFF8E6 !important; border-color: #C98A00 !important; } .kb-wiki-content .alert-danger { background-color: #FDF3F2 !important; border-color: #B42318 !important; } .kb-wiki-content .alert-success { background-color: #F1F8F3 !important; border-color: #2E7D32 !important; } .kb-wiki-content .step { background-color: #FFFFFF !important; padding: 18px 20px !important; margin: 15px 0 !important; border: 1px solid #E4E7EC !important; border-left: 4px solid #00718F !important; border-radius: 4px !important; } .kb-wiki-content .step-number { display: inline-block !important; background-color: #00718F !important; color: #FFFFFF !important; width: 28px !important; height: 28px !important; border-radius: 50% !important; text-align: center !important; line-height: 28px !important; margin-right: 10px !important; font-weight: bold !important; } .kb-wiki-content .toc { background-color: #F7F8FA !important; padding: 20px !important; border: 1px solid #E4E7EC !important; border-left: 4px solid #00718F !important; border-radius: 4px !important; margin-bottom: 30px !important; } .kb-wiki-content .toc h3 { margin-top: 0 !important; color: #032D42 !important; } .kb-wiki-content .toc ul { margin-left: 20px !important; } .kb-wiki-content .toc li { margin-bottom: 8px !important; } .kb-wiki-content .kb-keywords { background-color: #F7F8FA !important; padding: 15px !important; border: 1px solid #E4E7EC !important; border-left: 4px solid #98A2B3 !important; border-radius: 4px !important; margin-bottom: 25px !important; } .kb-wiki-content .kb-keywords p { margin: 0 0 8px 0 !important; font-size: 11pt !important; } Azure DevOps Tool Connection with OAuth 2.0 Keywords Product: ServiceNow DevOps Change Velocity (DCV), ServiceNow DevOps, DevOps integration, Azure DevOps integration, DevOps tool connection, DevOps data model Authentication: Azure DevOps OAuth 2.0, Microsoft Entra ID, Azure Active Directory (Azure AD), app registration, client ID, tenant ID, client secret, vso.project, Resource App ID, /.default scope, Application Registry, OAuth Entity Scopes, OAuth Entity Profile, oauth_redirect.do, Personal Access Token (PAT) Symptoms: OAuth token not obtained, Get OAuth Token fails, Azure DevOps connection fails, permission errors, token expired, client secret expired, classic release pipelines not visible, change status not updating in Azure DevOps, Update Build Information permission, duplicate service hooks, connection and credential alias Configuration: sn_devops_tool, oauth_entity, oauth_credential, sys_oauth_token, connection_state, valid_credentials, last_permission_check_result, Outbound HTTP Requests, OAuth Debug Table of Contents OverviewOAuth 2.0 Connection Setup Microsoft Entra ID (Azure AD) App RegistrationServiceNow Configuration Tech DetailsTroubleshootingReferences Overview This article provides comprehensive guidance on connecting Azure DevOps to ServiceNow DevOps using OAuth 2.0 authentication. OAuth 2.0 provides a secure, token-based method with automatic refresh capabilities for ServiceNow to interact with Azure DevOps APIs. Why OAuth 2.0 for Azure DevOps? Automatic token refresh (no manual renewal required)Better security compared to Personal Access TokensApp-based authentication (not tied to individual user)Recommended for production environmentsCentralized credential management through Azure AD How to Connect Azure DevOps Using OAuth 2.0 Step 1: Register Application in Microsoft Entra ID (Azure AD) 1 Log In and Navigate Log into the Azure PortalNavigate to: Microsoft Entra ID (formerly Azure Active Directory)Select: App registrationsClick New registration 2 Enter Application Details In the Name field, enter a name for your applicationUnder Supported account types, select: Accounts in this organizational directory only (Single tenant) Under Redirect URI: Enter: https://<instance-name>.service-now.com/oauth_redirect.doReplace <instance-name> with your ServiceNow instance name Click Register 3 Save Application (Client) ID and Directory (Tenant) ID After registration, you are redirected to the application Overview pageCopy and save the following values: Application (client) IDDirectory (tenant) ID You will need these values to configure ServiceNow OAuth provider 4 Create Client Secret In the left navigation, select: Certificates & secretsUnder Client secrets, click New client secretEnter a description for the secretSelect an expiration periodClick AddImportant: Copy the Value field immediately (not the Secret ID)The secret value is displayed only once and cannot be retrieved later Critical: Copy the client secret Value immediately after creation. It will not be shown again. If you lose it, you must create a new secret. 5 Add API Permissions Navigate to: Manage > API permissionsSelect + Add a permissionSelect the Microsoft APIs tab on the rightSearch and select Azure DevOpsAdd the vso.project permissionSelect the vso.project permissionCopy the Resource App ID valueNote: The Resource App ID value will be added in the OAuth Entity Scopes for the Application Registry in ServiceNow Completed! Your Azure AD application is now registered. Proceed to Step 2 for ServiceNow configuration. Step 2: ServiceNow OAuth Configuration 1 Create OAuth Provider Navigate to: System OAuth → Application RegistryClick "New" → "Connect to a third party OAuth Provider"Configure the following fields: FieldValueNameEnter a descriptive nameClient IDApplication (client) ID from Step 1Client SecretSecret value from Step 1Default Grant typeClient CredentialsAuthorization URLhttps://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorizeToken URLhttps://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token Replace {tenant-id} with Directory (tenant) ID from Step 1Right-click form header and select SaveSystem validates and populates Redirect URLVerify Redirect URL matches Azure AD app registration 2 Configure OAuth Entity Scopes Select OAuth Entity Scopes related tabClick NewEnter OAuth scope: <Resource-App-ID>/.defaultReplace with Resource App ID from Step 1Click Submit Note: The Resource App ID from Azure DevOps API permissions combined with /.default requests all permissions configured for the app. 3 Create OAuth Entity Profile Navigate to: System OAuth → OAuth Entity ProfilesClick "New"Enter a nameIn the OAuth provider field, select the OAuth provider created in Step 2.1Set Type: OAuth 2.0Click "Submit" 4 Create OAuth Credential Navigate to: Connections & Credentials → CredentialsClick "New" → "OAuth 2.0 Credentials"Enter a nameSelect OAuth Entity Profile from Step 3Set Type: OAuth 2.0Click "Submit" 5 Obtain OAuth Token Open OAuth credential recordClick "Get OAuth Token"Because the grant type is Client Credentials, ServiceNow requests the token using the client ID and client secret — no user sign-in is requiredVerify token status: "Token obtained successfully" Success! OAuth 2.0 credential is now configured and authenticated. Token will automatically refresh when expired. 6 Connect Azure DevOps Tool Navigate to: DevOps → ToolsClick "Connect Tool" → Select "Azure DevOps"Enter Tool NameEnter Tool URL: https://dev.azure.com/{organization}Select Authentication Type: OAuth 2.0Select OAuth Credential from Step 4Click "Connect" 7 Verify Connection System will run automatic validation checks: Credential validationAPI connectivity testPermission verificationRepository/project access check Check the Connection State field - should show "Connected"Verify Valid Credentials = trueCheck Last Permission Check Result = "full_permissions" Success! Your Azure DevOps tool is now connected with OAuth 2.0. Tokens will automatically refresh without manual intervention. Tech Details sn_devops_tool Table Parent table storing all connection information. Key fields: FieldDescriptionnameDisplay name of tool connectiontool_urlAzure DevOps organization URLconnection_stateconnected, disconnected, errorvalid_credentialsBoolean - credentials validlast_permission_check_resultfull_permissions, partial_permissions, no_permissionsoverall_statusconnected, not_configured, error Important Records to Follow sn_devops_tool: Main tool connection recordoauth_entity: OAuth provider configurationoauth_credential: OAuth credential recordsys_oauth_token: Token storage with expirationsys_pd_activity: Process activity record with action = "connect"Outbound HTTP Requests: Check for OAuth token exchange and API calls Troubleshooting Common Issues and Solutions Issue 1: OAuth Token Not Obtained Symptoms: Get OAuth Token fails, redirects to error page Solutions: Verify Redirect URI: Check Azure AD app registration Redirect URI matches ServiceNowFormat: https://<instance>.service-now.com/oauth_redirect.do Verify OAuth Provider Configuration: Authorization URL and Token URL have correct tenant IDOAuth Entity Scopes configured with Resource App IDClient ID and Client Secret are correctClient secret hasn't expired Issue 2: Connection Fails with Permission Errors Symptoms: OAuth token obtained, but tool connection fails with permission errors Solutions: Check API Permissions: Navigate to: Azure AD → App registrations → API permissionsVerify "Azure DevOps" with "vso.project" permission is addedEnsure Resource App ID is correctUser must have access to Azure DevOps organization Verify OAuth Entity Scopes: In ServiceNow OAuth provider, check OAuth Entity Scopes tabScope format: <Resource-App-ID>/.defaultResource App ID must match value from Azure AD Issue 3: Connection Fails After Some Time Symptoms: Connection works initially, fails later with "Token expired" or authentication errors Solutions: Check Client Secret Expiration: Navigate to: Azure AD → Certificates & secretsVerify expiration dateGenerate new secret if expiredUpdate ServiceNow OAuth provider with new secret Re-authenticate: Open OAuth credential in ServiceNowClick "Get OAuth Token"Verify token status: "Token obtained successfully" Issue 4: Release Pipeline Not Visible in Azure DevOps Symptom: Classic release pipelines are not visible in Azure DevOps account Solution: Navigate to Azure DevOps Organization SettingsCheck the "Disable creation of classic release pipelines" settingEnsure this setting is switched off for your organizationThis allows classic release pipelines to be visible and created Issue 5: Change Status Not Updating in Azure DevOps Console Symptom: Change status is not updating in Azure DevOps console when change state changes in ServiceNow Solution: Update the "Update Build Information" permission for specified users/group in Azure DevOps: Go to the Pipelines tab in Azure DevOpsClick Manage Security (three dots in the top-right corner)For the required user/group, Allow the "Update Build Information" permission Issue 6: Duplicate Service Hooks Created During Tool Reconfiguration Limitation: Duplicate service hooks are created for release creation and deployment when reconfiguring the tool Explanation: This is a limitation from Azure DevOps when using access tokens with limited permissionsServiceNow cannot update existing service hooks if the token has limited scopeNew service hooks are created for release creation and deployment events Workaround: Create the tool with a PAT that has Full ScopeWith full scope permissions, release and deployment webhooks will not be duplicatedAlternatively, manually delete duplicate service hooks in Azure DevOps → Project Settings → Service Hooks Issue 7: Tool Creation Requires Two Available Connection and Credential Aliases Requirement: Azure DevOps tool requires at least two available connection and credential alias records (one is created automatically) Explanation: Azure DevOps tool creates three connections for different purposes: Azure DevOps API connection (for accessing projects, repos, pipelines) - created automaticallyAzure Artifacts/Package feed connection - requires free aliasRelease pipeline connection - requires free alias Solution: Before creating the tool, verify your ServiceNow instance has at least two free connection and credential alias recordsCheck: Connections & Credentials → Connection & Credential AliasesLook for records that are not linked to any credentialsIf insufficient aliases exist, create additional ones: Navigate to: Connection & Credential AliasesClick "New"Create aliases (e.g., DevOpsAlias1, DevOpsAlias2) Tip: Always verify at least two available connection aliases before connecting Azure DevOps to avoid connection failures. Debug Locations Outbound HTTP Requests: System Logs → Outbound HTTP Requests - Check API call statusSystem Logs: System Logs → System Log → All - Filter by "devops" or "azure" or "ado"Flow Execution: Process Automation → Flow Execution - Check "Azure DevOps connect flow"Business Rules: System Definition → Business Rules - Check "DevOps Create Tool BR"OAuth Debug: System OAuth → OAuth Debug - Enable for detailed OAuth logsTool Record: DevOps → Tools - Check connection_state, valid_credentials fields References ServiceNow: Set Up Azure DevOps OAuth 2.0 CredentialServiceNow: Azure DevOps Integration OverviewServiceNow: Configure DevOps Extensions for Azure DevOpsMicrosoft: Register an Application with Microsoft Entra IDMicrosoft: OAuth 2.0 Client Credentials FlowMicrosoft: Authorize Access to Azure DevOps with OAuth 2.0ServiceNow Tables: sn_devops_tool, sn_devops_tool_integration, oauth_entity, oauth_credentialServiceNow Flows: Azure DevOps connect flow, DevOps Create Tool DDServiceNow Business Rules: DevOps Create Tool BR