<h2>Use the ServiceNow DevOps extension for Azure DevOps</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2023" /><meta name="DC.rights.owner" content="(C) Copyright 2023" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="task" /><meta name="DC.title" content="Use the ServiceNow DevOps extension for Azure DevOps" /><meta name="abstract" content="Install and configure DevOps extension for Azure DevOps to send build and release notifications from your Azure pipeline to ServiceNow DevOps application." /><meta name="description" content="Install and configure DevOps extension for Azure DevOps to send build and release notifications from your Azure pipeline to ServiceNow DevOps application." /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2022-02-03" /><meta name="DC.date.modified" content="2022-06-14" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="config-dev-ops-extensions-azure" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Use the ServiceNow DevOps extension for Azure DevOps</title></head><body> <div class="nested0" id="config-dev-ops-extensions-azure"> <h1 class="title topictitle1" id="ariaid-title1">Use the <span class="ph">ServiceNow</span> <span class="ph">DevOps</span> extension for <span class="ph">Azure DevOps</span></h1> <div class="body taskbody"><p class="shortdesc">Install and configure <span class="ph">DevOps</span> extension for <span class="ph">Azure DevOps</span> to send build and release notifications from your Azure pipeline to <span class="ph">ServiceNow</span> <span class="ph">DevOps</span> application.</p> <div class="section prereq p" id="config-dev-ops-extensions-azure__prereq_csn_1z3_wtb"> <p class="p">Role required: sn_devops.admin</p> </div> <div class="section context" id="config-dev-ops-extensions-azure__context_s5m_c11_ykb"> <p class="p">You can use <span class="ph uicontrol">ServiceNow DevOps</span> extension on <a class="xref" href="https://marketplace.visualstudio.com/" target="_blank" rel="noopener noreferrer">Visual Studio Marketplace</a> to integrate your Azure pipeline with the <span class="ph">ServiceNow</span> <span class="ph">DevOps</span> application.</p> <ul class="ul" id="config-dev-ops-extensions-azure__ul_l4v_pp4_wmb"><li class="li"><span class="ph uicontrol">ServiceNow DevOps</span> service connection<p class="p">Required to connect the Azure pipeline to <span class="ph">ServiceNow</span></p> </li><li class="li"><span class="ph uicontrol">ServiceNow DevOps Release Gate</span> <p class="p">Required to enable change control in Azure release (CD) pipelines (in pre-deployment conditions only)</p> </li></ul> <div class="p">Azure build (CI) pipeline custom tasks:<ul class="ul" id="config-dev-ops-extensions-azure__ul_bpy_z13_wkb"><li class="li">Agentless (server) job<ul class="ul" id="config-dev-ops-extensions-azure__ul_ojk_wlr_2lb"><li class="li"><span class="ph uicontrol">ServiceNow DevOps Server Change Acceleration</span> custom task <p class="p">Required for agentless (server) jobs to automatically create a change request in <span class="ph">ServiceNow</span> <span class="ph">Change Management</span> as part of the Azure pipeline.</p> <div class="note"><span class="notetitle">Note:</span> The <span class="ph uicontrol">ServiceNow DevOps Server Change Acceleration</span> task does not require <span class="ph uicontrol">ServiceNow DevOps Server Job Notification</span> tasks.</div> </li><li class="li"><span class="ph uicontrol">ServiceNow DevOps Server Package Registration</span> custom task <p class="p">Required for agentless (server) jobs to register a package in the <span class="ph">ServiceNow</span> instance</p> </li><li class="li"><span class="ph uicontrol">ServiceNow DevOps Server Artifact Registration</span> custom task <p class="p">Required for agentless (server) jobs to register an artifact in the <span class="ph">ServiceNow</span> instance</p> </li></ul> </li><li class="li">Agent job<ul class="ul" id="config-dev-ops-extensions-azure__ul_gn3_xlr_2lb"><li class="li"><span class="ph uicontrol">ServiceNow DevOps Agent Package Registration</span> custom task <p class="p">Required for agent jobs to register a package in the <span class="ph">ServiceNow</span> instance</p> </li><li class="li"><span class="ph uicontrol">ServiceNow DevOps Agent Artifact Registration</span> custom task <p class="p">Required for agent jobs to register an artifact in the <span class="ph">ServiceNow</span> instance</p> </li></ul> </li><li class="li">Software Quality scans (SonarQube/SonarCloud)<ul class="ul" id="config-dev-ops-extensions-azure__ul_pn4_m2x_spb"><li class="li"><span class="ph uicontrol">ServiceNow DevOps Build Sonar Registration</span> custom task (for Build pipelines)</li><li class="li"><span class="ph uicontrol">ServiceNow DevOps Release Sonar Registration</span> custom task (for Release pipelines)</li></ul> </li></ul> </div> </div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Go to <a class="xref" href="https://marketplace.visualstudio.com/" target="_blank" rel="noopener noreferrer">Visual Studio Marketplace</a>, search for the <span class="ph uicontrol">ServiceNow DevOps</span> extension, and click <span class="ph uicontrol">Get it free</span>.</span> <div class="itemgroup info"> <div class="fig fignone" id="config-dev-ops-extensions-azure__fig_jgc_kmc_ykb"> <img class="image" id="config-dev-ops-extensions-azure__image_i1l_nmc_ykb" src="../image/dev-ops-azure-extension.png" alt="DevOps Azure extension" /> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">In <span class="ph">Azure DevOps</span> Pipelines, navigate to the service connections section in your project settings and create a <span class="ph uicontrol">New service connection</span> using the <span class="ph uicontrol">ServiceNow DevOps</span> service connection.</span> <div class="itemgroup info"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="config-dev-ops-extensions-azure__table_mpl_d11_ykb" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><tbody class="tbody"><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;">ServiceNow URL</td><td class="entry cell-norowborder" style="vertical-align:top;"><p class="p">https://<your-instance>.service-now.com/</p> </td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;">Tool ID</td><td class="entry cell-norowborder" style="vertical-align:top;"><p class="p">The sys_id of the orchestration tool.</p> <p class="p">You can copy this value using the Copy sys_id command on the Orchestration Tool form. If you are using the workspace, select <span class="ph uicontrol">More form options (<img class="image icon" id="config-dev-ops-extensions-azure__image_rby_wyn_kwb" src="../image/more-form-actions-icon.png" alt="More form options icon" />) > Copy sys_id</span> on the ADO tool connection form. If you are using Service Catalog or Classic, select <span class="ph uicontrol">Additional actions (<img class="image icon" id="config-dev-ops-extensions-azure__image_rqh_5yn_kwb" src="../image/additional-actions.png" alt="Additional actions icon" />) > Copy sys_id</span> on the ADO tool connection form.</p> </td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;">Username</td><td class="entry cell-norowborder" style="vertical-align:top;">devops.integration.user</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;">Password</td><td class="entry cell-norowborder" style="vertical-align:top;">Password for DevOps Integration User.</td></tr><tr class="row"><td class="entry nocellnorowborder" style="vertical-align:top;">Service connection name</td><td class="entry cell-norowborder" style="vertical-align:top;">DevOps Connection</td></tr><tr class="row"><td class="entry row-nocellborder" style="vertical-align:top;">Grant access permission to all pipelines</td><td class="entry cellrowborder" style="vertical-align:top;">Select check box.</td></tr></tbody></table> </div> </div> </li></ol> <div class="example"> <div class="p"><div class="fig fignone" id="config-dev-ops-extensions-azure__fig_szf_3zz_xkb"><span class="figcap"><span class="fig--title-label">Figure 1. </span>Azure pipeline - ServiceNow DevOps service connection</span> <img class="image" id="config-dev-ops-extensions-azure__image_tzf_3zz_xkb" src="../image/dev-ops-azure-service-conn.png" height="550" width="308" alt="Azure Service Connection" /> </div> </div> </div> </div> <div class="topic task nested1" id="dev-ops-config-azure-bld-pipeline"> <h2 class="title topictitle2" id="ariaid-title2">Set up an Azure build (CI) pipeline in <span class="ph">DevOps</span></h2> <div class="body taskbody"><p class="shortdesc">Use the <span class="ph">ServiceNow</span> <span class="ph">DevOps</span> extension for <span class="ph">Azure DevOps</span> to configure change control and artifacts and packages in your Azure build (CI) pipeline.</p> <div class="section prereq p" id="dev-ops-config-azure-bld-pipeline__prereq_wgc_qh2_hwb"> <p class="p">Role required: sn_devops.admin</p> </div> <ol class="ol steps" id="dev-ops-config-azure-bld-pipeline__steps_a2b_gv4_wmb"><li class="li step stepexpand"> <span class="ph cmd">In <span class="ph">Azure DevOps</span> Pipelines, <span class="ph uicontrol">Add (+)</span> the <span class="ph uicontrol">ServiceNow DevOps Server Change Acceleration</span> custom task to the Tasks section of your Azure pipeline agentless (server) job to configure change acceleration.</span> <div class="itemgroup info">For more information regarding change acceleration, see <a class="xref" href="../concept/dev-ops-change-acceleration.html" title="Enable the Change Acceleration feature of DevOps for automatic change request creation in your pipeline, and use change approval policies to automate approval under certain conditions.">change acceleration</a>. <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dev-ops-config-azure-bld-pipeline__table_a2l_311_ykb" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;">Display name</td><td class="entry cellrowborder" style="vertical-align:top;">ServiceNow Change Acceleration</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;">ServiceNow endpoint</td><td class="entry cellrowborder" style="vertical-align:top;">My Connection</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;">Upstream job executed</td><td class="entry cellrowborder" style="vertical-align:top;">Indicates the previous job in line. <p class="p">For example, the job before Server might be Test.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;">Change request details</td><td class="entry cellrowborder" style="vertical-align:top;"><p class="p">Set <a class="xref" href="../concept/dev-ops-config-change-details.html" title="Set closure code and change request fields from within Azure and Jenkins pipelines.">closure code and change request fields</a> from within the pipeline.</p> <p class="p">Click the information icon to view sample input.</p> </td></tr></tbody></table> </div> </div> </li><li class="li step stepexpand"> <span class="ph cmd">In <span class="ph">Azure DevOps</span> Pipelines, <span class="ph uicontrol">Add (+)</span> the ServiceNow DevOps server or agent artifact and package registration custom tasks to the Tasks section of your Azure pipeline server or agent job to configure artifacts and packages.</span> <div class="itemgroup info">See <a class="xref" href="../concept/using-dev-ops-release-change.html" title="DevOps change acceleration for releases lets you view all commits and work items in the change request for the DevOps release when approving, rather than having commits spread across multiple task executions.">DevOps change acceleration for releases</a> for more information regarding artifacts.</div> </li></ol> <div class="example"> <div class="p"><div class="fig fignone" id="dev-ops-config-azure-bld-pipeline__fig_uyt_hxx_2lb"><span class="figcap"><span class="fig--title-label">Figure 2. </span>Azure pipeline: ServiceNow DevOps Change Acceleration custom task</span> <img class="image" id="dev-ops-config-azure-bld-pipeline__image_s5h_kxx_2lb" src="../image/dev-ops-azure-change-server.png" alt="DevOps Azure Change extension" /> </div> </div> <img class="image" id="dev-ops-config-azure-bld-pipeline__image_b1g_3zz_xkb" src="../image/dev-ops-azure-job-config-all.png" alt="DevOps ServiceNow Change Acceleration extension" /> <p class="p"><img class="image" id="dev-ops-config-azure-bld-pipeline__image_jwr_jd1_3lb" src="../image/dev-ops-yaml-server.png" alt="Azure DevOps server custom tasks" /></p> <div class="p"><div class="fig fignone" id="dev-ops-config-azure-bld-pipeline__fig_wdf_5kc_v4b"><span class="figcap"><span class="fig--title-label">Figure 3. </span>Change request details example</span> <img class="image" id="dev-ops-config-azure-bld-pipeline__image_txs_blc_v4b" src="../image/dev-ops-azure-change-details.png" alt="DevOps Azure change details" /> </div> </div> </div> </div> </div> <div class="topic task nested1" id="dev-ops-config-azure-rel-pipeline"> <h2 class="title topictitle2" id="ariaid-title3">Set up an Azure release (CD) pipeline in <span class="ph">DevOps</span></h2> <div class="body taskbody"><p class="shortdesc">Use the <span class="ph">ServiceNow</span> <span class="ph">DevOps</span> extension for <span class="ph">Azure DevOps</span> to configure change control, and artifacts and packages in your Azure release (CD) pipeline.</p> <div class="section prereq p" id="dev-ops-config-azure-rel-pipeline__prereq_wgc_qh2_hwb"> <p class="p">Role required: sn_devops.admin</p> </div> <div class="section context" id="dev-ops-config-azure-rel-pipeline__context_atr_5s4_wmb"> <div class="note"><span class="notetitle">Note:</span> Change control in Azure release (CD) pipelines is supported in pre-deployment gates only. Pre-deployment gate change requests are mapped to the step execution of the first job in that stage.</div> <p class="p">Phases in an Azure release pipeline are mapped to a step. The step name for a multi-config or multi-agent job must include the phase name only, and not the actual job name derived at pipeline execution run time.</p> <p class="p">Task executions for skipped jobs are marked as failed.</p> </div> <ol class="ol steps" id="dev-ops-config-azure-rel-pipeline__steps_ys2_fv4_wmb"><li class="li step stepexpand"> <span class="ph cmd">In <span class="ph">Azure DevOps</span> Pipelines, navigate to your release pipeline and open the Pre-deployment conditions window.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Enable the Gates setting and click <span class="ph uicontrol">+Add</span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Click the <span class="ph uicontrol">ServiceNow DevOps Release Gate</span> and select the ServiceNow endpoint.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Exit the release gate configuration, and expand the Evaluation options section to configure the timing fields.</span> <div class="itemgroup info"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dev-ops-config-azure-rel-pipeline__table_tg3_2hq_wmb" class="table" frame="border" border="1" rules="all"><colgroup><col style="width:50%" /><col style="width:50%" /></colgroup><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;">Time between re-evaluation of gates</td><td class="entry cellrowborder" style="vertical-align:top;"><p class="p">Re-evaluation interval in minutes, hours, or days.</p> <p class="p">If the change request is canceled or rejected, the Azure pipeline release gate keeps re-evaluating the change request status at the configured interval until timeout.</p> <p class="p">No user intervention is required for further attempts of re-evaluation after the change request has already been approved, rejected, or canceled.</p> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;">Timeout after which gates fail</td><td class="entry cellrowborder" style="vertical-align:top;">Timeout value in minutes, hours, or days.<p class="p">If the pre-deployment conditions fail, the subsequent jobs of the stage are marked as failed, and the start and end time defaults to the current system time.</p> </td></tr></tbody></table> </div> </div> </li><li class="li step stepexpand"><strong>Optional: </strong> <span class="ph cmd">Configure artifacts in your Azure release (CD) pipeline.</span> <div class="itemgroup info"> <div class="p">To set up artifacts using the build pipeline as the source, these names must match.<ul class="ul" id="dev-ops-config-azure-rel-pipeline__ul_dhv_1jq_wmb"><li class="li">Repository name, and build pipeline name (for example, DeployableRepo).</li><li class="li">Name property of the build pipeline artifact, and source alias property of the release pipeline artifact (for example, BuildDrop).</li></ul> </div> <div class="p">In addition to the build pipeline, you can select artifacts from any other eight sources. To track commit & work item details, follow these rules.<ul class="ul" id="dev-ops-config-azure-rel-pipeline__ul_ft2_qjq_wmb"><li class="li">When the source is the build pipeline, the semantic version property of the artifacts should be in the format MAJOR.MINOR.PATCH (for example 5.1.3).</li><li class="li">When the source is not the build pipeline, define a semantic version by implementing the <span class="ph uicontrol">DevOpsArtifactSemanticVersionAPI</span> extension interface.</li></ul> </div> <p class="p">See <a class="xref" href="../concept/using-dev-ops-release-change.html" title="DevOps change acceleration for releases lets you view all commits and work items in the change request for the DevOps release when approving, rather than having commits spread across multiple task executions.">DevOps change acceleration for releases</a> for more information regarding artifacts.</p> </div> </li></ol> <div class="example"> <div class="p"><div class="fig fignone" id="dev-ops-config-azure-rel-pipeline__fig_ar2_r5p_wmb"><span class="figcap"><span class="fig--title-label">Figure 4. </span><span class="ph">ServiceNow</span> <span class="ph">DevOps</span> extension for <span class="ph">Azure DevOps</span> - Release Gate</span> <img class="image" id="dev-ops-config-azure-rel-pipeline__image_d2q_1vp_wmb" src="../image/dev-ops-azure-release-gate.png" alt="ServiceNow DevOps release gate for Azure DevOps" /> </div> </div> <div class="p"><div class="fig fignone" id="dev-ops-config-azure-rel-pipeline__fig_zj3_1dp_wmb"><span class="figcap"><span class="fig--title-label">Figure 5. </span>Azure release pipeline pre-deployment gate configuration</span> <img class="image" id="dev-ops-config-azure-rel-pipeline__image_ujj_bdp_wmb" src="../image/dev-ops-azure-gate.png" alt="DevOps Azure gate config" /> </div> </div> <div class="p"><div class="fig fignone" id="dev-ops-config-azure-rel-pipeline__fig_ezx_cbq_wmb"><span class="figcap"><span class="fig--title-label">Figure 6. </span>Artifact setup - build pipeline source</span> <img class="image" id="dev-ops-config-azure-rel-pipeline__image_xqq_dbq_wmb" src="../image/dev-ops-artifact-repo-yaml.png" alt="DevOps artifact YAML config" /> </div> </div> <div class="p"><div class="fig fignone" id="dev-ops-config-azure-rel-pipeline__fig_htr_gbq_wmb"><span class="figcap"><span class="fig--title-label">Figure 7. </span>Artifact setup - release pipeline</span> <img class="image" id="dev-ops-config-azure-rel-pipeline__image_pbk_hbq_wmb" src="../image/dev-ops-artifact-build-pipeline.png" alt="DevOps artifact pipeline config" /> </div> </div> </div> </div> </div> </div> </body></html></div>