---
sourceDocument: Australia IT Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/it-service-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# Azure DevOps pipeline tasks

# Azure DevOps pipeline tasks {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 11 minutes to read  
Use these tasks in your Azure
DevOps pipeline to interact with the DevOps Config data
model.  
Important:  
Starting with the Washington D.C. release, DevOps Config is being prepared for future deprecation. It will be hidden and no longer activated on new instances but will continue to be supported.

These tasks are provided to create a specific pipeline definition to achieve your goal.  
* ServiceNow-DevOps-Config-Agent-Upload-ConfigUpload config data to a deployable in the
  data model via Agent Job.

* ServiceNow-DevOps-Config-Agent-Get-SnapshotGet the snapshots for an application.

* ServiceNow-DevOps-Config-Agent-Get-Snapshot-NameExtract the name of a snapshot.

* ServiceNow-DevOps-Config-Agent-Publish-SnapshotPublish a snapshot of your configuration
  data.

* ServiceNow-DevOps-Config-Agent-Export-SnapshotExport a subset of your configuration
  data.

* ServiceNow-DevOps-Config-Agent-Register-PipelineRegister a changeset and/or snapshot to a
  pipeline execution.

* ServiceNow-DevOps-Config-Agent-Validate-SnapshotValidate configuration data against
  organization policies.

* ServiceNow-DevOps-Server-Change-AccelerationCreate a change request as part of the
  pipeline.

{#devops-config-azure-integration__ul_qcb_5cf_psb}

## ServiceNow-DevOps-Config-Agent-Upload-Config {#devops-config-azure-integration__section_qjz_nqg_wpb}

Task to upload a configuration file to a given location within an application data model.  
This task is meant to be used in an iterative nature for all config files the user chooses to upload to their application data model during the pipeline run.  
Note:  
Pre-uploaded files must be in a compatible format.

Input variables
:

    |-|-|
    | connectedServiceName | Specifies the DevOps pipeline endpoint connection. |
    | applicationName | Specifies the application to where config data is uploaded. |
    | deployableName | Specifies the deployable for the application (required if target is deployable). |
    | uploadTarget | Specifies the data model target to where config data is uploaded (for example, <kbd class="ph userinput">component</kbd>, <kbd class="ph userinput">collection</kbd>, <kbd class="ph userinput">deployable</kbd>). |
    | collectionName | (Optional) Specifies the collection to where config data will be uploaded (required if target is collection). |
    | namePath | Specifies the data model path to where config data is uploaded. Note: When uploading to a vars folder, you must start the name path with "vars/" to specifiy the variable folder path. |
    | configFilePath | Specifies the source folder from which config data is uploaded to the component or deployable path in the data model. Empty is the root of the repo. Use variables if files are not in the repo (for example, <kbd class="ph userinput">$(agent.builddirectory)</kbd>). |
    | convertPath | (Optional) Specifies whether to preserve the directory structure of the configuration files (with respect to the workspace), and convert the directory to paths within the data model. Default is false. |
    | dataFormat | Specifies the data format of the config_file (for example, <kbd class="ph userinput">JSON</kbd>, <kbd class="ph userinput">YAML</kbd>, <kbd class="ph userinput">XML</kbd>, etc.). |
    | changesetNumber | (Optional) Specifies the (open) changeset to which this upload activity is associated. If not provided, a new changeset is created. Note: Only used for multiple upload scenarios. |
    | autocommit | Specifies whether to commit configuration data after upload (true/false). Default is false. |
    | autoValidate | Specifies whether to validate configuration data during commit (true/false). Default is true. |
    [ ]

    {#devops-config-azure-integration__table_hpv_5x2_psb}

Output variable
:

    |-|-|
    | changesetNumber | Changeset record created/committed during the upload. Provide a name to the task so it can be used later in the pipeline (per example, <kbd class="ph userinput">componentUpload</kbd>). |
    [ ]

    {#devops-config-azure-integration__table_qjq_rbb_w5b}

Example - Upload config
:


        -task: ServiceNow-DevOps-Config-Agent-Upload-Config
         name: componentUpload​
         inputs:​
           connectedServiceName: 'MyServiceNowInstance'​
           applicationName: 'PaymentDemo'​
           uploadTarget: 'component'​
           namePath: 'wep-api-v1.0'
           configFilePath: 'k8s/helm/values.yml'​
           dataFormat: 'yaml'
           autoCommit: true​
           autoValidate: true​
         
Example - Multiple uploads (component)
:   You can call the upload task more than once to upload configuration data in different file formats from different locations, while still keeping the uploads part of one changeset.

    * In the first upload, name the task so the changesetNumber output variable can be reused in subsequent uploads.  
      YAML file upload:


          -task: ServiceNow-DevOps-Config-Agent-Upload-Config​
             name: componentUpload​
             inputs:​ 
               connectedServiceName: 'MyServiceNowInstance'​
               applicationName: 'PaymentDemo'​
               uploadTarget: 'component'​
               namePath: 'wep-api-v1.0'
               configFilePath: 'k8s/helm/values.yml'​
               dataFormat: 'yaml'
               autoCommit: false​
               autoValidate: false​

    * In subsequent uploads, reference the changesetNumber output variable from the first upload as an input variable.  
      JSON file upload:


          -task: ServiceNow-DevOps-Config-Agent-Upload-Config
             inputs:​
               connectedServiceName: 'MyServiceNowInstance'
               applicationName: 'PaymentDemo'
               uploadTarget: 'component'
               namePath: 'wep-api-v1.0'
               configFilePath: 'featureToggles/set1.json'
               dataFormat: 'json'
               autoCommit: true​
               autoValidate: true​
               changesetNumber: '$(componentUpload.changesetNumber)'

    {#devops-config-azure-integration__ul_qvy_52b_w5b}

Example - Multiple uploads (collection and vars)
:   You can call the upload task more than once to upload configuration data in different file formats from different locations, while still keeping the uploads part of one changeset.

    * In the first upload, make sure to name the task so the changesetNumber output variable can be reused in subsequent uploads.  
      XML file upload:


          -task: ServiceNow-DevOps-Config-Agent-Upload-Config​
             name: componentUpload​
             inputs:​ 
               connectedServiceName: 'MyServiceNowInstance'​
               applicationName: 'PaymentDemo'​
               uploadTarget: 'collection'​
               collectionName: 'release-1.0'​
               namePath: 'v1-common-configs'
               configFilePath: 'infra/v1/config.xml'​
               dataFormat: 'xml'
               autoCommit: false​
               autoValidate: false​

    * In subsequent uploads, reference the changesetNumber output variable from the first upload as an input.  
      JSON file upload:


          -task: ServiceNow-DevOps-Config-Agent-Upload-Config
             inputs:​
               connectedServiceName: 'MyServiceNowInstance'
               applicationName: 'PaymentDemo'
               uploadTarget: 'deployable'
               deployableName: 'Production-EMEA'
               namePath: 'vars/dbSettings'
               configFilePath: 'infra/prodc/dbSettings.json'
               dataFormat: 'json'
               autoCommit: true​
               autoValidate: true​
               changesetNumber: '$(componentUpload.changesetNumber)'

    {#devops-config-azure-integration__ul_zvz_b5m_dwb}

    Note:  
    To upload to a variable folder, uploadTarget must be set to <kbd class="ph userinput">deployable</kbd>, and the correct values must be set for deployableName and changesetNumber.

## ServiceNow-DevOps-Config-Agent-Get-Snapshot {#devops-config-azure-integration__section_nkh_4y2_psb}

This task is intended to be used in different scenarios:

* Retrieve a specific snapshot.Following the CD flow, a specific snapshot is retrieved so it can be published and then exported to be consumed downstream (for example, to provision out infrastructure or application).

* Retrieve latest validated snapshot.The latest validated snapshot is retrieved for the given application-deployable combination.

* Retrieve all snapshots for any impacted deployables.When config files are uploaded to an application data model, the system will create snapshots for any deployables determined to be impacted by the upload. Following
  along the CI flow, assuming the last Upload call had validation enabled, the next step would be to iterate through the list of snapshots and ensure they all passed validation.

* Retrieve the latest snapshots for a deployable of an application in the event an upload does not generate any snapshots.A set of config data is available to deploy to an environment for an
  application-deployable-changeset combination when no configuration changes are made.

* Show policy validation results in a pipeline execution.View policy validation results as test results on the ADO build tests results page, including compliant with exception, when getting a snapshot.

{#devops-config-azure-integration__ul_lgc_ry2_psb}

Input variables
:

    |-|-|
    | connectedServiceName | Specifies the DevOps pipeline endpoint connection (defined in the service connection settings of the project). |
    | applicationName | Specifies the application to upload config data to, or export data from. |
    | deployableName | (Optional) Specifies the deployable (per the specified application) on which to get the latest snapshot data. |
    | changesetNumber | (Optional) Specifies the changeset ID for the applicable set of config changes. |
    | isValidated | (Optional) Specifies whether to return only snapshots that are passed, or passed with exception (true/false). Default is true. |
    | continueWithLatest | (Optional) Specifies whether to return the latest snapshot per the <kbd class="ph userinput">applicationName</kbd>-<kbd class="ph userinput">deployableName</kbd>-<kbd class="ph userinput">changesetNumber</kbd> combination if no snapshots are generated (true/false). Default is false. |
    [ ]

    {#devops-config-azure-integration__table_dmc_nz2_psb}

Output variable
:

    |-|-|
    | snapshotObject | A JSON object containing the requested snapshots. Provide a name to the task so it can be used later in the pipeline (per example, <kbd class="ph userinput">getSnapshot</kbd>). |
    [ ]

    {#devops-config-azure-integration__table_gb4_yfb_w5b}

Example - Specific snapshot
:


        -task: ServiceNow-DevOps-Config-Agent-Get-Snapshot
         name: getSnapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           applicationName: 'PaymentDemo'
           deployableName: 'Production'
           changesetNumber: 'Chset-16'
           isValidated: true
           continueWithLatest: true

Example - Latest validated snapshots (for a given application-deployable combination)
:


        -task: ServiceNow-DevOps-Config-Agent-Get-Snapshot
         name: getSnapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           applicationName: 'PaymentDemo'
           deployableName: 'Production'
           isValidated: true

Example - All changeset snapshots
:


        -task: ServiceNow-DevOps-Config-Agent-Get-Snapshot
         name: getSnapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           applicationName: 'PaymentDemo'
           changesetNumber: 'Chset-16'

Example - Show policy validation results

:   Assign a variable to the path of the file that contains the snapshot validation results generated during the <kbd class="ph userinput">ServiceNow-DevOps-Config-Agent-Get-Snapshot</kbd> task.

    To load the snapshot validation results in your pipeline execution, you need to leverage the ADO native [Publish Test Results v2 task](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/publish-test-results-v2?view=azure-pipelines&tabs=trx,trxattachments,yaml), using the variable as an input.  


        stages:
        - stage: Two
          jobs:
            - job: A
        	variables:
              - name: validationResultsPath
                value: 1/TEST_DATA_$(Build.DefinitionName)_$(Build.BuildNumber)_*.xml
              steps:
                - task: PublishTestResults@2
                  inputs:
                     testResultsFormat: 'JUnit'
                     testResultsFiles: '$(validationResultsPath)'
                     searchFolder: '$(System.WorkFolder)'

## ServiceNow-DevOps-Config-Agent-Get-Snapshot-Name {#devops-config-azure-integration__section_ic5_11f_psb}

This task is used as a follow-up from the
<kbd class="ph userinput">ServiceNow-DevOps-Config-Agent-Get-Snapshot-Name</kbd> task to get the
snapshot name from a particular snapshot. From here, the snapshot name can be used as an input
to a downstream task, like publishing the snapshot.

Input variables
:

    |-|-|
    | deployableName | Specifies the deployable to get the snapshot object that was returned from the <kbd class="ph userinput">ServiceNow-DevOps-Config-Agent-Get-Snapshot</kbd> task. |
    | script | Specifies the script to extract the snapshot name from the snapshot object. |
    [ ]

    {#devops-config-azure-integration__table_ctq_f1f_psb}

Output variable
:

    |-|-|
    | snapshotName | The snapshot name for the deployable. Provide a name to the task so it can be used later in the pipeline (per example, <kbd class="ph userinput">getSnapshotName</kbd>). |
    [ ]

    {#devops-config-azure-integration__table_u4n_hgb_w5b}

Example - Get snapshot name

:   Use this script to extract the snapshot name retrieved from the
    <kbd class="ph userinput">ServiceNow-DevOps-Config-Agent-Get-Snapshot</kbd> task.


        -task: ServiceNow-DevOps-Config-Agent-Get-Snapshot-Name
         inputs:
           deployableName: 'PRD'
           script: |
        	function run() {
                let name;
                let deployableName = process.argv[2];
                let jsonObj = $(getSnapshot.snapshotObjects);
                let size = jsonObj.result.length;
                for(let i=0; i<size; i++) {
                 obj = jsonObj.result[i];
                 if(obj["deployable_id.name"].toLowerCase() == deployableName) {
                   name = obj.name;
                   console.log(name);
                  }
                 }
                }
                run();

Example - Get snapshot name used with get snapshot

:   Call the <kbd class="ph userinput">ServiceNow-DevOps-Config-Agent-Get-Snapshot-Name</kbd> task right
    after the <kbd class="ph userinput">ServiceNow-DevOps-Config-Agent-Get-Snapshot</kbd> task to return
    the snapshot name.

    Get snapshots (returns a JSON object containing impacted snapshots):


        -stage: Two​
         jobs:​
            -job: B​
             steps:​
                -task: ServiceNow-DevOps-Config-Agent-Get-Snapshot
                 name: getSnapshot​
                 inputs:​
                    connectedServiceName: 'MyServiceNowInstance'​​
                    applicationName: 'PaymentDemo'​
                    deployableName: 'Production-2'
                    changesetNumber: 'Chset-16'​

    Get snapshot name (returns snapshot name for a specific deployable):


        -stage: Two​
         jobs:​
            - job: B​
              steps:​
                - task: ServiceNow-DevOps-Config-Agent-Get-Snapshot
                  name: getSnapshotName​
                  inputs:​
                      deployableName: 'Production-2'
                      script:|​
                      function run() {​
                       let name;​
                       let deployableName = process.argv[2]; ​
                       let jsonObj = $(getSnapshot.snapshotObjects);​
                       let size = jsonObj.result.length;​
                       for(let i=0; i<size ;i++) {​
                        obj = jsonObj.result[i];​
                        if(obj["deployable_id.name"].toLowerCase() == deployableName) {​
                         name = obj.name;​
                         console.log(name); // This standard output of inline script is given as the task output​
                        }​
                       }​
                      }​
                      run();

    Use returned snapshot name in the pipeline (for example, publish):


        -stage: Three​
         jobs:​
            -job: C​
             variables:​
               varSnapshotName: $[stageDependencies.Two.B.outputs['getSnapshotName.snapshotName']]​
             steps:​
                -task: ServiceNow-DevOps-Config-Agent-Publish-Snapshot
                 inputs:​
                   connectedServiceName: 'MyServiceNowInstance'
                   applicationName: 'PaymentDemo'
                   deployableName: 'Production-2'
                   snapshotName: '$(varSnapshotName)'​

## ServiceNow-DevOps-Config-Agent-Publish-Snapshot {#devops-config-azure-integration__section_fjq_k1f_psb}

This task publishes a snapshot for the given application and deployable. From here, the
snapshot can be consumed through the Export process.

Input variables
:

    |-|-|
    | connectedServiceName | Specifies the ServiceNow endpoint connection. |
    | applicationName | Specifies the application to publish. |
    | deployableName | Specifies the deployable for the application to publish config data. |
    | snapshotName | Specifies the name of the snapshot to publish. |
    [ ]

    {#devops-config-azure-integration__table_vd4_41f_psb}

Output variable
:   Not applicable (returns true if successful, otherwise false).

Example
:


        -task: ServiceNow-DevOps-Config-Agent-Publish-Snapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           applicationName: 'PaymentDemo'
           deployableName: 'Production-2'
           snapshotName: 'Production-v23.dpl'

## ServiceNow-DevOps-Config-Agent-Export-Snapshot {#devops-config-azure-integration__section_bn2_x1f_psb}

This task exports a snapshot for the given application and deployable. Specify the exporter,
relevant exporter arguments, the export format (for example, YAML, JSON, etc.), and output
location for the exported config data. From here, the config data can be used directly as an
input for a deployment or provisioning tool downstream in the pipeline.

Input variables
:

    |-|-|
    | connectedServiceName | Specifies the ServiceNow endpoint connection. |
    | applicationName | Specifies the application from which to publish. |
    | deployableName | Specifies the deployable for the application from which to export config data. |
    | snapshotName | Specifies the name of the snapshot from which to export config data. |
    | exporterName | Specifies the exporter to apply to the snapshot (for example, <kbd class="ph userinput">UniqueCDIs</kbd>). |
    | args | (Optional) Specifies arguments to be used along with the exporter. |
    | exportFormat | Specifies the format to export the snapshot data (for example, <kbd class="ph userinput">INI</kbd>, <kbd class="ph userinput">YAML</kbd>, <kbd class="ph userinput">PROPS</kbd>). |
    | saveFile | Checks if file is to be saved to an Azure repository (true/false). Default is false. Note: Appropriate permission/OAuth token access to script is required. Otherwise the export file is created in the pipeline workspace directory. |
    [ ]

    {#devops-config-azure-integration__table_mtx_bbf_psb}

Output variable
:   Not applicable (returns true if successful, otherwise false).

Example
:


        -task: ServiceNow-DevOps-Config-Agent-Export-Snapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           applicationName: 'PaymentDemo'
           deployableName: 'Production-2'
           exporterName: 'returnAllData-nowPreview'
           dataFormat: 'yaml'
           args: ''
           snapshotName: 'Production-v23.dpl'
           saveFile: true​
           fileName: 'ExporterOutput/ExportData_$(build.definitionName)_$(build.buildNumber).yaml'
           
## ServiceNow-DevOps-Config-Agent-Register-Pipeline {#devops-config-azure-integration__section_jms_kcf_psb}

This task ties a changeset and a snapshot to the pipeline so that it can be tracked during the
pipeline execution. In DevOps Change Velocity, this is shown in the Pipeline
UI.

Input variables
:

    |-|-|
    | connectedServiceName | Specifies the DevOps pipeline endpoint connection. |
    | applicationName | Specifies the application name. |
    | changesetNumber | (Optional) Specifies the ID of the changeset to associate to the pipeline execution. |
    | snapshotName | (Optional) Specifies the name of the snapshot to associate to the pipeline execution. |
    [ ]

    {#devops-config-azure-integration__table_nym_4cf_psb}

Output variable
:   Not applicable (returns true if successful, otherwise false).

Example
:


        -task: ServiceNow-DevOps-Config-Agent-Publish-Snapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           changesetNumber: 'Changeset-143'

## ServiceNow-DevOps-Config-Agent-Validate-Snapshot {#devops-config-azure-integration__section_a3d_t3b_ypb}

Validate config data against your organization policies.

Input variables
:

    |-|-|
    | connectedServiceName | Specifies the ServiceNow endpoint connection. |
    | applicationName | Specifies the application to validate. |
    | deployableName | Specifies the deployable (per the specified application) to validate. |
    | snapshotName | (Optional) Specifies the name of the snapshot to validate. |
    | showResults | (Optional) Specifies to show validation results in the console log. |
    [ ]

    {#devops-config-azure-integration__table_hk2_nkf_psb}

Output variable
:   Not applicable (returns true if successful, otherwise false).

Example
:


        -task: ServiceNow-DevOps-Config-Agent-Validate-Snapshot
         inputs:
           connectedServiceName: 'MyServiceNowInstance'
           applicationName: 'PaymentDemo'
           deployableName: 'Production-2'
           snapshotName: ''
           showResults: false

## ServiceNow-DevOps-Server-Change-Acceleration {#devops-config-azure-integration__section_tcn_vqf_w5b}

This task is required for agentless (server) jobs to automatically create a change request in
ServiceNow
Change Management as part of the Azure
DevOps pipeline.

In DevOps Config, to associate multiple snapshots of the same changeset to a
change request, use snapshot name and application name to track specific configuration data for
a given application service.

See [Accelerating your DevOps change process](https://servicenow-prod.fluidtopics.net/1IOGCXHTnX02RprvPaB2wg "Enable the change acceleration feature of DevOps Change Velocity for automatic change request creation in your pipeline, and use change approval flows and policies to automate approval under certain conditions.") for more
information regarding the DevOps Change Acceleration feature.

Input variables (related to DevOps Config)
:

    |-|-|
    | connectedServiceName | Specifies the DevOps pipeline endpoint connection. |
    | applicationName | Application associated with the snapshot being attached to the change request. |
    | snapshotName | Name of the snapshot to attach to the change request. |
    [ ]

    {#devops-config-azure-integration__table_tsl_wsf_w5b}

Example
:


        -stage: ChangeRequest
         jobs:
            -job: 'changerequestjob'
             pool: server
             steps:
                -task: ServiceNow-DevOps-Server-Change-Acceleration
                 inputs:
                    connectedServiceName: 'MyServiceNowInstance'
                    applicationName: 'PaymentDemo'
                    snapshotName: 'Production-v23.dpl'

## YAML pipeline example {#devops-config-azure-integration__section_h2d_xkq_mwb}

    trigger:
      branches:
        include:
        - none
    stages:
    - stage: One
      displayName: Upload Configuration Data
      pool:
        vmImage: ubuntu-latest
      jobs:
      - job: A
        displayName: Upload
        steps:
        - task: ServiceNow-DevOps-Config-Agent-Upload-Config@1
          name: componentUpload
          inputs:
            connectedServiceName: 'MyServiceNowInstance'
            applicationName: 'PaymentDemo'
            uploadTarget: 'component'
            configFile: 'k8s/helm/values.yml'
            namePath: 'processor-api-v1.0'
            dataFormat: 'yaml'
            autoValidate: true
            autoCommit: true
            convertPath: true
    - stage: Two
      displayName: Get Latest Snapshot
      pool:
        vmImage: ubuntu-latest
      jobs:
      - job: B
        displayName: Get Snapshot
        variables:
        - name: varChangesetNumber
          value: $[stageDependencies.One.A.outputs['componentUpload.changesetNumber'] ]
        - name: varConfigValidationResults
            value: 1/TEST_DATA_$(Build.DefinitionName)_$(Build.BuildNumber)_*.xml
        steps:
        - task: ServiceNow-DevOps-Config-Agent-Get-Snapshot@1
          name: getSnapshot
          inputs:
            connectedServiceName: 'MyServiceNowInstance'
            applicationName: 'PaymentDemo'
            deployableName: 'Production-EMEA'
            changeSetNumber: '$(varChangesetNumber)'
            continueWithLatest: true
        - task: ServiceNow-DevOps-Config-Agent-Get-Snapshot-Name@1
          name: getSnapshotName
          inputs:
            deployableName: 'Production-EMEA'
            script: "function run() {\n  let name;\n  let deployableName = process.argv[2]; \n  let jsonObj = $(getSnapshot.snapshotObjects);\n  let size = jsonObj.result.length;\n  for(let i=0; i<size ;i++) {\n    obj = jsonObj.result[i];\n    if(obj[\"deployable_id.name\"].toLowerCase() == deployableName) {\n      name = obj.name;\n      console.log(name);   // This standard output of inline script is given as the task output\n    }\n  }\n}\nrun();\n"
        - task: PublishTestResults@2
              inputs:
                 testResultsFormat: 'JUnit'
                 testResultsFiles: '$(varConfigValidationResults)'
                 searchFolder: '$(System.WorkFolder)'
        - task: ServiceNow-DevOps-Config-Agent-Register-Pipeline@1
          inputs:
            connectedServiceName: 'MyServiceNowInstance'
            snapshotName: '$(getSnapshotName.snapshotName)'
            applicationName: 'PaymentDemo'
    - stage: Three
      displayName: Publish Snapshot
      pool:
        vmImage: ubuntu-latest
      jobs:
      - job: C
        displayName: Publish
        variables:
        - name: varSnapshotName
          value: $[stageDependencies.Two.B.outputs['getSnapshotName.snapshotName']]
        steps:
        - task: ServiceNow-DevOps-Config-Agent-Publish-Snapshot@1
          inputs:
            connectedServiceName: 'MyServiceNowInstance'
            applicationName: 'PaymentDemo'
            deployableName: 'Production-EMEA'
            snapshotName: '$(varSnapshotName)'
    - stage: ChangeRequest
      dependsOn:
      - Two
      - Three
      jobs:
      - job: 'changerequestjob'
        timeoutInMinutes: 2
        pool:
          name: server
        variables:
        - name: varSnapshotName
          value: $[stageDependencies.Two.B.outputs['getSnapshotName.snapshotName']]
        steps:
        - task: ServiceNow-DevOps-Server-Change-Acceleration@1
          inputs:
            connectedServiceName: 'MyServiceNowInstance'
            applicationName: 'PaymentDemo'
            snapshotName: '$(varSnapshotName)'
    - stage: Four
      displayName: Export Snapshot
      dependsOn:
      - Two
      - Three
      - ChangeRequest
      pool:
        vmImage: ubuntu-latest
      variables:
      - name: varSnapshotName
        value: $[stageDependencies.Two.B.outputs['getSnapshotName.snapshotName']]
      jobs:
      - job: D
        displayName: Export
        steps:
        - task: ServiceNow-DevOps-Config-Agent-Export-Snapshot@1
          inputs:
            connectedServiceName: 'MyServiceNowInstance'
            applicationName: 'PaymentDemo'
            deployableName: 'Production-EMEA'
            exporterName: 'returnAllData-now'
            dataFormat: 'yaml'
            snapshotName: '$(varSnapshotName)'
            saveFile: true
            fileName: 'ExportData_$(build.definitionName)_$(build.buildNumber).yaml'
        - task: CmdLine@2
          inputs:
            script: |
              echo Write your commands here
              echo Hello world
              tree $(Pipeline.Workspace)


