Fortinet white logo
Fortinet white logo
1.0.0

Azure DevOps v1.0.0

About the connector

Azure DevOps is a cloud-based service for managing software development projects. The Azure DevOps FortiSOAR connector integrates with Azure DevOps to automate the management of repositories, pipelines, work items, and more within FortiSOAR, enabling streamlined DevOps workflows and incident response.

This document provides information about the Azure DevOps connector, which facilitates automated interactions, with a Azure DevOps server using FortiSOAR™ playbooks. Add the Azure DevOps connector as a step in FortiSOAR™ playbooks and perform automated operations with Azure DevOps.

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 7.6.1-5275

Azure DevOps Version Tested on: 7.2

Authored By: Fortinet

Certified: Yes

Installing the connector

Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.

You can also use the yum command as a root user to install the connector:

yum install cyops-connector-azure-devops

Prerequisites to configuring the connector

  • You must have the credentials of Azure DevOps server to connect and perform automated operations.
  • The FortiSOAR™ server should have outbound connectivity to port 443 on the Azure DevOps server.

Minimum Permissions Required

To call the Azure DevOps API, to perform any action, you must be assigned specific permissions as defined in the following table:

Action Name Permission Type Permissions
Get Pipeline List Delegate vso.build
Access Token Build -> Read
Get Pipeline Run List Delegate vso.build
Access Token Build -> Read
Get Pipeline Run Details Delegate vso.build
Access Token Build -> Read
Get Project List Delegate vso.profile, vso.project
Access Token Project -> Read, Team -> Read
Get Repository List Delegate vso.code
Access Token Code -> Read
Get Branch List Delegate vso.code
Access Token Code -> Read
Get Commit Details Delegate vso.code
Access Token Code -> Read
Get Pull Request List Delegate vso.code
Access Token Code -> Read
Get Pull Request Details Delegate vso.code
Access Token Code -> Read
Create Pull Request Delegate vso.code_write, vso.identity
Access Token Code -> Read & write, Identity -> Read
Update Pull Request Delegate vso.code_write
Access Token Code -> Read & write
Get Pull Request Reviewer List Delegate vso.code
Access Token Code -> Read
Add Pull Request Reviewer Delegate vso.code_write, vso.identity
Access Token Code -> Read & write, Identity -> Read
Get Pull Request Commit List Delegate vso.code
Access Token Code -> Read
Get Commit List Delegate vso.code
Access Token Code -> Read
Run Pipeline Delegate vso.build_execute
Access Token Build -> Read & Execute

Configuring the connector

For the procedure to configure a connector, click here

Configuration parameters

In FortiSOAR™, on the Connectors page, click the Azure DevOps connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:

Parameter Description
Server URL Specify the IP address or hostname of the Azure DevOps server to connect and perform automated operations.
Organization Name Specify the name of the organization created on Azure DevOps.
Auth Type Select the authentication method to access the Azure DevOps Services REST API. You can choose from the following options:
  • Access Token: Select this and specify an access token in the Access Token field. For information on generating access tokens, refer to Creating PAT on Microsoft's Azure DevOps documentation.
  • On behalf of User - Delegate Permission: Select this option to use a delegated token and specify values in the following fields:
    • Tenant ID: Specify the ID of the tenant assigned to you by the Azure application registration portal.
    • Client ID: Specify the Unique Application ID of the Azure Active Directory application to create an authentication token required to access the API. For information on getting authentication tokens, see the Getting Authentication Tokens section.
    • Client Secret: Specify the Unique Client Secret of the Azure Active Directory application that is used to create an authentication token required to access the API. For information on how to get the secret key, see Get started with Azure DevOps OAuth on Microsoft's Azure DevOps documentation.
    • Authorization Code: Specify the authorization code that you acquired during the authorization step. For more information, see the Getting Access Tokens using the Delegate Permissions method section.
    • Redirect URL: The redirect_uri of your app, where authentication responses can be sent and received by your app. The redirect URL that you specify here must exactly match one of the redirect_uri's you have registered in your app registration portal.
API Version Specify the API version to use. By default it uses 7.1 api version.
Verify SSL Specifies whether the SSL certificate for the server is to be verified.
By default, this option is selected, i.e., set to true.

Actions supported by the connector

You can use the following automated operations in playbooks and also use the annotations to access operations:

Function Description Annotation and Category
Get Pipeline List Retrieves list of all pipelines within a project. list_pipelines
Investigation
Get Pipeline Run List Retrieves top 10000 runs for a specified pipeline. list_pipeline_runs
Investigation
Get Pipeline Run Details Retrieve details of a specific pipeline run. get_pipeline_run
Investigation
Get Project List Retrieve a list of all projects within the Azure DevOps organization. list_projects
Investigation
Get Repository List Retrieve a list of all repositories within a project. list_repositories
Investigation
Get Branch List Retrieves list of all branches within a specified repository. list_branches
Investigation
Get Commit Details Retrieve details of a specific commit. get_commit
Investigation
Get Pull Request List List all pull requests for a given repository or project. list_pull_requests
Investigation
Get Pull Request Details Retrieves details of a specific pull request. get_pull_requests_by_id
Investigation
Create Pull Request Creates a new pull request for code changes to be reviewed and merged. create_pull_request
Investigation
Update Pull Request Updates an existing pull request with new information such as status, title, description, and merge options. update_pull_request
Investigation
Get Pull Request Reviewer List Retrieve the list of reviewers for a specific pull request. list_pull_request_reviewers
Investigation
Add Pull Request Reviewer Add a reviewer to a pull request or cast a vote on a pull request in Azure DevOps. add_pull_request_reviewer
Investigation
Get Pull Request Commit List Retrieve the commits associated with a specific pull request in Azure DevOps. list_pull_request_commits
Investigation
Get Commit List Retrieve the commits for a specific repository in Azure DevOps. list_commits
Investigation
Run Pipeline Triggers a new run for a specified pipeline. run_pipeline
Investigation

operation: Get Pipeline List

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its pipelines from Azure DevOps.
Sort Field (Optional) Specify the field based on which to sort the retrieved results from Azure DevOps. By default it is set to name.
Sort Order (Optional) Select the sort order to sort the retrieved results from Azure DevOps. You can choose from the following options:
  • ASC
  • DESC

NOTE: The selected sort order sorts the results only by the name field.

Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.
Limit (Optional) Specify the maximum number of records to be retrieved in this operation.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "_links": {
                "web": {
                    "href": ""
                },
                "self": {
                    "href": ""
                }
            },
            "folder": "",
            "revision": ""
        }
    ]
}

operation: Get Pipeline Run List

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its pipeline run list from Azure DevOps.
Pipeline ID Specify the ID of the pipeline whose runs are to be retrieved.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "_links": {
                "web": {
                    "href": ""
                },
                "self": {
                    "href": ""
                },
                "pipeline": {
                    "href": ""
                },
                "pipeline.web": {
                    "href": ""
                }
            },
            "result": "",
            "pipeline": {
                "id": "",
                "url": "",
                "name": "",
                "folder": "",
                "revision": ""
            },
            "createdDate": "",
            "finishedDate": "",
            "templateParameters": {}
        }
    ]
}

operation: Get Pipeline Run Details

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its pipeline run details from Azure DevOps.
Pipeline ID Specify the ID of the pipeline whose run details are to be retrieved.
Run ID Specify the ID of the run whose details are to be retrieved.

Output

The output contains the following populated JSON schema:

{
    "id": "",
    "url": "",
    "name": "",
    "state": "",
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "pipeline": {
            "href": ""
        },
        "pipeline.web": {
            "href": ""
        }
    },
    "result": "",
    "pipeline": {
        "id": "",
        "url": "",
        "name": "",
        "folder": "",
        "revision": ""
    },
    "resources": {
        "repositories": {
            "self": {
                "refName": "",
                "version": "",
                "repository": {
                    "id": "",
                    "type": ""
                }
            }
        }
    },
    "createdDate": "",
    "yamlDetails": {
        "rootYamlFile": {
            "ref": "",
            "yamlFile": "",
            "repoAlias": ""
        },
        "expandedYamlUrl": ""
    },
    "finishedDate": "",
    "templateParameters": {}
}

operation: Get Project List

Input parameters

Parameter Description
State (Optional) Select the state of the project to be retrieved from Azure DevOps. You can choose from the following options:
  • All
  • Create Pending
  • Deleted
  • Deleting
  • New
  • Unchanged
  • Well Formed (Default)
Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.
Offset (Optional) Specify the number of records to be skipped when retrieving results.
Limit (Optional) Specify the maximum number of records to be retrieved.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "lastUpdateTime": ""
        }
    ]
}

operation: Get Repository List

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its repositories from Azure DevOps.
Include Hidden Repositories (Optional) Select to include hidden repositories in the response. By default, this option is cleared, i.e., set to false.
Include All URLs (Optional) Select to include all remote URLs in the response. By default, this option is cleared, i.e., set to false.
Include Reference Links (Optional) Select to include reference links in the response. By default, this option is cleared, i.e., set to false.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "size": "",
            "sshUrl": "",
            "webUrl": "",
            "project": {
                "id": "",
                "url": "",
                "name": "",
                "state": "",
                "revision": "",
                "visibility": "",
                "description": "",
                "lastUpdateTime": ""
            },
            "remoteUrl": "",
            "isDisabled": "",
            "defaultBranch": "",
            "isInMaintenance": "",
            "validRemoteUrls": [],
            "_links": {
                "ssh": {
                    "href": ""
                },
                "web": {
                    "href": ""
                },
                "refs": {
                    "href": ""
                },
                "self": {
                    "href": ""
                },
                "items": {
                    "href": ""
                },
                "pushes": {
                    "href": ""
                },
                "commits": {
                    "href": ""
                },
                "project": {
                    "href": ""
                },
                "pullRequests": {
                    "href": ""
                }
            }
        }
    ]
}

operation: Get Branch List

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the branch list.
Repository Specify the ID or name of the repository whose branch list is to be retrieved.
Branch Name Filter (Contains) (Optional) Specify a substring to retrieve only those branch names that contain the specified string.
Branch Name Filter (Starts With) (Optional) Specify a prefix to retrieve only those branch names that start with the specified string. For example, heads/ma returns branches such as refs/heads/main and refs/heads/master.
Include My Branches (Optional) Select to include only those branches that the user owns, has marked as favorites, and the default branch. By default, this option is cleared, i.e., set to false.
Include Statuses (Optional) Select to include up to the first 1000 commit statuses for each ref. By default, this option is cleared, i.e., set to false.
Include Links (Optional) Select to include referenceLinks in the results. By default, this option is cleared, i.e., set to false.
Latest Statuses Only (Optional) Select to include only the tip commit status for each ref. Requires includeStatuses to be true. By default, this option is cleared, i.e., set to false.
Peel Tags (Optional) Select to use annotated tags to populate the PeeledObjectId property. By default, this option is cleared, i.e., set to false.
Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.
Limit (Optional) Specify the maximum number of refs to return. Maximum value is 1000.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "name": "",
            "_links": {
                "self": {
                    "href": ""
                },
                "repository": {
                    "href": ""
                }
            },
            "creator": {
                "id": "",
                "url": "",
                "_links": {
                    "avatar": {
                        "href": ""
                    }
                },
                "imageUrl": "",
                "descriptor": "",
                "uniqueName": "",
                "displayName": ""
            },
            "objectId": "",
            "statuses": []
        }
    ]
}

operation: Get Commit Details

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the commit details.
Repository Specify the ID or name of the repository whose commit is to be retrieved.
Commit ID Specify the ID of the commit to be retrieved.
Change Count (Optional) Specify the number of changes to include in the result.

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "push": {
        "date": "",
        "pushId": "",
        "pushedBy": {
            "id": "",
            "url": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "descriptor": "",
            "uniqueName": "",
            "displayName": ""
        }
    },
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "changes": {
            "href": ""
        },
        "repository": {
            "href": ""
        }
    },
    "author": {
        "date": "",
        "name": "",
        "email": "",
        "imageUrl": ""
    },
    "treeId": "",
    "comment": "",
    "parents": [],
    "commitId": "",
    "committer": {
        "date": "",
        "name": "",
        "email": "",
        "imageUrl": ""
    },
    "remoteUrl": "",
    "changes": [
        {
            "item": {
                "url": "",
                "path": "",
                "commitId": "",
                "objectId": "",
                "gitObjectType": ""
            },
            "changeType": ""
        }
    ],
    "changeCounts": {
        "Add": "",
        "Edit": "",
        "Delete": ""
    }
}

operation: Get Pull Request List

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the list of pull requests (PR).
Repository Specify the ID or name of the repository to retrieve its list of PRs.
Status (Optional) Select the status of the pull requests to filter the retrieved results. You can choose from the following options:
  • All
  • Active
  • Abandoned
  • Completed
  • Not Set
Search Criteria (Optional) Specify the search criteria, as JSON, to retrieve the pull requests from Azure DevOps. For example:
{
                    "maxTime": "",
                    "minTime": "",
                    "creatorId": "",
                    "reviewerId": "",
                    "includeLinks": "",
                    "repositoryId": "",
                    "sourceRefName": "",
                    "targetRefName": "",
                    "queryTimeRangeType": "",
                    "sourceRepositoryId": ""
                  }
Offset (Optional) Specify the number of records to be skipped retrieved in this operation.
Limit (Optional) Specify the maximum number of records to be retrieved in this operation.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "title": "",
            "status": "",
            "isDraft": "",
            "mergeId": "",
            "createdBy": {
                "id": "",
                "url": "",
                "_links": {
                    "avatar": {
                        "href": ""
                    }
                },
                "imageUrl": "",
                "descriptor": "",
                "uniqueName": "",
                "displayName": ""
            },
            "reviewers": [
                {
                    "id": "",
                    "url": "",
                    "vote": "",
                    "_links": {
                        "avatar": {
                            "href": ""
                        }
                    },
                    "imageUrl": "",
                    "isFlagged": "",
                    "uniqueName": "",
                    "displayName": "",
                    "hasDeclined": "",
                    "reviewerUrl": ""
                }
            ],
            "closedDate": "",
            "repository": {
                "id": "",
                "url": "",
                "name": "",
                "project": {
                    "id": "",
                    "name": "",
                    "state": "",
                    "visibility": "",
                    "lastUpdateTime": ""
                }
            },
            "mergeStatus": "",
            "description": "",
            "codeReviewId": "",
            "creationDate": "",
            "pullRequestId": "",
            "sourceRefName": "",
            "targetRefName": "",
            "lastMergeCommit": {
                "url": "",
                "commitId": ""
            },
            "completionOptions": {
                "mergeStrategy": "",
                "mergeCommitMessage": "",
                "transitionWorkItems": "",
                "autoCompleteIgnoreConfigIds": []
            },
            "supportsIterations": "",
            "completionQueueTime": "",
            "lastMergeSourceCommit": {
                "url": "",
                "commitId": ""
            },
            "lastMergeTargetCommit": {
                "url": "",
                "commitId": ""
            }
        }
    ]
}

operation: Get Pull Request Details

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the pull request (PR) details.
Pull Request ID Specify the ID of the pull request which is to be retrieved for the specified project.

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "title": "",
    "status": "",
    "isDraft": "",
    "mergeId": "",
    "createdBy": {
        "id": "",
        "url": "",
        "_links": {
            "avatar": {
                "href": ""
            }
        },
        "imageUrl": "",
        "descriptor": "",
        "uniqueName": "",
        "displayName": ""
    },
    "reviewers": [
        {
            "id": "",
            "url": "",
            "vote": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "isFlagged": "",
            "uniqueName": "",
            "displayName": "",
            "hasDeclined": "",
            "reviewerUrl": ""
        }
    ],
    "artifactId": "",
    "repository": {
        "id": "",
        "url": "",
        "name": "",
        "size": "",
        "sshUrl": "",
        "webUrl": "",
        "project": {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "description": "",
            "lastUpdateTime": ""
        },
        "remoteUrl": "",
        "isDisabled": "",
        "isInMaintenance": ""
    },
    "mergeStatus": "",
    "codeReviewId": "",
    "creationDate": "",
    "pullRequestId": "",
    "sourceRefName": "",
    "targetRefName": "",
    "lastMergeCommit": {
        "url": "",
        "author": {
            "date": "",
            "name": "",
            "email": ""
        },
        "comment": "",
        "commitId": "",
        "committer": {
            "date": "",
            "name": "",
            "email": ""
        }
    },
    "lastMergeSourceCommit": {
        "url": "",
        "commitId": ""
    },
    "lastMergeTargetCommit": {
        "url": "",
        "commitId": ""
    },
    "supportsIterations": "",
    "description": ""
}

operation: Create Pull Request

Input parameters

Parameter Description
Project Name Specify the Azure DevOps project associated with the repository under which the PR is to be created.
Repository Select the ID or name of the repository under which the PR is to be created.
Pull Request Title Specify a title for the pull request being created.
Source Branch Name Specify the name of the source branch for creating the PR.
Target Branch Name Specify the name of the target branch for creating the PR.
Pull Request Description (Optional) Specify a description for the pull request.
Reviewers (Optional) Specify IDs, display names, or email IDs as comma-separated values to add as reviewers for this pull request.
Supports Iterations (Optional) Select to enable reviewing of subsequent pushes individually.
Additional Inputs (Optional) Specify any other parameters, as JSON, of this pull request to be created. For example, { "isDraft": true }

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "title": "",
    "_links": {
        "self": {
            "href": ""
        },
        "statuses": {
            "href": ""
        },
        "createdBy": {
            "href": ""
        },
        "workItems": {
            "href": ""
        },
        "repository": {
            "href": ""
        },
        "sourceBranch": {
            "href": ""
        },
        "sourceCommit": {
            "href": ""
        },
        "targetBranch": {
            "href": ""
        },
        "targetCommit": {
            "href": ""
        }
    },
    "labels": [],
    "status": "",
    "isDraft": "",
    "mergeId": "",
    "createdBy": {
        "id": "",
        "url": "",
        "_links": {
            "avatar": {
                "href": ""
            }
        },
        "imageUrl": "",
        "descriptor": "",
        "uniqueName": "",
        "displayName": ""
    },
    "reviewers": [],
    "artifactId": "",
    "repository": {
        "id": "",
        "url": "",
        "name": "",
        "size": "",
        "sshUrl": "",
        "webUrl": "",
        "project": {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "description": "",
            "lastUpdateTime": ""
        },
        "remoteUrl": "",
        "isDisabled": "",
        "isInMaintenance": ""
    },
    "mergeStatus": "",
    "codeReviewId": "",
    "creationDate": "",
    "pullRequestId": "",
    "sourceRefName": "",
    "targetRefName": "",
    "lastMergeSourceCommit": {
        "url": "",
        "commitId": ""
    },
    "lastMergeTargetCommit": {
        "url": "",
        "commitId": ""
    },
    "supportsIterations": "",
    "description": ""
}

operation: Update Pull Request

Input parameters

Parameter Description
Project Name Specify the Azure DevOps project associated with the repository under which the PR is to be updated.
Repository Select the ID or name of the repository under which the PR is to be updated.
Pull Request ID Specify the ID of the pull request to update.
Pull Request Title Specify a title for the pull request to update.
Pull Request Description (Optional) Specify a new description for the pull request (up to 4000 characters).
Pull Request Status (Optional) Select the new status of the pull requests to update. You can choose from the following options:
  • Active
  • Abandoned
  • Completed
  • Not Set
Target Branch Name (Optional) Specify a different name of the target branch to update, if changing the target for the PR.
Additional Inputs Specify any other parameters, as JSON, of this pull request to be created. For example, { "isDraft": true }

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "title": "",
    "_links": {
        "self": {
            "href": ""
        },
        "statuses": {
            "href": ""
        },
        "createdBy": {
            "href": ""
        },
        "workItems": {
            "href": ""
        },
        "iterations": {
            "href": ""
        },
        "repository": {
            "href": ""
        },
        "sourceBranch": {
            "href": ""
        },
        "sourceCommit": {
            "href": ""
        },
        "targetBranch": {
            "href": ""
        },
        "targetCommit": {
            "href": ""
        }
    },
    "status": "",
    "isDraft": "",
    "mergeId": "",
    "createdBy": {
        "id": "",
        "url": "",
        "_links": {
            "avatar": {
                "href": ""
            }
        },
        "imageUrl": "",
        "descriptor": "",
        "uniqueName": "",
        "displayName": ""
    },
    "reviewers": [],
    "artifactId": "",
    "repository": {
        "id": "",
        "url": "",
        "name": "",
        "size": "",
        "sshUrl": "",
        "webUrl": "",
        "project": {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "description": "",
            "lastUpdateTime": ""
        },
        "remoteUrl": "",
        "isDisabled": "",
        "isInMaintenance": ""
    },
    "mergeStatus": "",
    "codeReviewId": "",
    "creationDate": "",
    "pullRequestId": "",
    "sourceRefName": "",
    "targetRefName": "",
    "lastMergeCommit": {
        "url": "",
        "author": {
            "date": "",
            "name": "",
            "email": ""
        },
        "comment": "",
        "commitId": "",
        "committer": {
            "date": "",
            "name": "",
            "email": ""
        }
    },
    "lastMergeSourceCommit": {
        "url": "",
        "commitId": ""
    },
    "lastMergeTargetCommit": {
        "url": "",
        "commitId": ""
    },
    "supportsIterations": "",
    "description": ""
}

operation: Get Pull Request Reviewer List

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository whose PR reviewers are to be retrieved.
Repository Specify the ID or name of the repository where the pull request exists.
Pull Request ID Specify the ID of the pull request whose reviewers you want to retrieve.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "vote": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "isFlagged": "",
            "uniqueName": "",
            "displayName": "",
            "hasDeclined": "",
            "reviewerUrl": ""
        }
    ]
}

operation: Add Pull Request Reviewer

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository where PR reviewers are to be added.
Repository Specify the ID or name of the repository where the pull request exists.
Pull Request ID Specify the ID of the pull request to which the reviewer is to be added.
Reviewer Specify the ID, display name, or email address of the reviewer to be added to the pull request.
Required Reviewer (Optional) Select to mark the reviewer as required.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "vote": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "isFlagged": "",
            "uniqueName": "",
            "displayName": "",
            "hasDeclined": "",
            "reviewerUrl": ""
        }
    ]
}

operation: Get Pull Request Commit List

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository whose PR commit list is to be retrieved. Specify the name of the Azure DevOps project associated with the repository.
Repository Specify the ID or name of the repository where the pull request exists.
Pull Request ID Specify the ID of the pull request for which the commits are to be listed.
Limit (Optional) Specify the maximum number of commits to return.
Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "author": {
                "date": "",
                "name": "",
                "email": ""
            },
            "comment": "",
            "commitId": "",
            "committer": {
                "date": "",
                "name": "",
                "email": ""
            }
        }
    ]
}

operation: Get Commit List

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository whose commits are to be retrieved.
Repository Specify the ID or name of the repository whose commit list is to be retrieved.
Search Options (Optional) Select the criteria to filter search results. You can choose from the following options:
  • Commit IDs: Select this option to specify exact commit IDs as comma-separated values in the Commit IDs field.
  • Other: Select to use additional filtering options by specifying values in the following fields:
    • Committer: (Optional) Specify the alias or display name of the committer.
    • From Commit ID: (Optional) Specify the lower bound commit ID for filtering commits.
    • To Commit ID: (Optional) Specify the upper bound commit ID for filtering commits.
    • From Date: (Optional) Specify the start date to include history entries created after this date.
    • To Date: (Optional) Specify the end date to include history entries created before this date.
    • Commit Author: (Optional) Specify the alias or display name of the author.
    • Exclude Deletes: (Optional) Specify whether to exclude delete entries for the specified path.
    • History Mode: (Optional) Specify the Git history mode to use.
    • Include Push Data: (Optional) Specify whether to include push information.
    • Show Oldest Commits First: (Optional) Specify whether to show the oldest commits first.
    • Search Criteria: Specify the search criteria to retrieve the commits from Azure DevOps. For example, you can include parameters like `fromCommitId`, `toCommitId`, `author`, and `fromDate`.
    • Offset: (Optional) Specify the number of records to skip.
    • Limit: (Optional) Specify the maximum number of commits to retrieve.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "author": {
                "date": "",
                "name": "",
                "email": ""
            },
            "comment": "",
            "commitId": "",
            "committer": {
                "date": "",
                "name": "",
                "email": ""
            },
            "remoteUrl": "",
            "changeCounts": {
                "Add": "",
                "Edit": "",
                "Delete": ""
            },
            "commentTruncated": ""
        }
    ]
}

operation: Run Pipeline

Input parameters

Parameter Description
Project Name Specify the name of the project under which the pipeline is to be run.
Pipeline ID Specify the ID of the pipeline to run.
Stages to Skip (Optional) Specify the pipeline stage names as comma-separated values that are to be skipped during execution.
Pipeline Version (Optional) Specify the pipeline version being run.
Preview Run (Optional) Select to return the final YAML document after parsing templates as a run preview.
Resources (Optional) Specify the resources required for the run.

Output

The output contains the following populated JSON schema:

Output schema when you choose Preview Run as false:

{
    "id": "",
    "url": "",
    "name": "",
    "state": "",
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "pipeline": {
            "href": ""
        },
        "pipeline.web": {
            "href": ""
        }
    },
    "pipeline": {
        "id": "",
        "url": "",
        "name": "",
        "folder": "",
        "revision": ""
    },
    "resources": {
        "repositories": {
            "self": {
                "refName": "",
                "version": "",
                "repository": {
                    "id": "",
                    "type": ""
                }
            }
        }
    },
    "createdDate": "",
    "templateParameters": {}
}

Output schema when you choose Preview Run as true:

{
    "id": "",
    "url": "",
    "name": "",
    "state": "",
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "pipeline": {
            "href": ""
        },
        "pipeline.web": {
            "href": ""
        }
    },
    "pipeline": {
        "id": "",
        "url": "",
        "name": "",
        "folder": "",
        "revision": ""
    },
    "finalYaml": "",
    "templateParameters": {}
}

Included playbooks

The Sample - Azure DevOps - 1.0.0 playbook collection comes bundled with the Azure DevOps connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the Azure DevOps connector.

  • Add Pull Request Reviewer
  • Create Pull Request
  • Get Branch List
  • Get Commit Details
  • Get Commit List
  • Get Pipeline List
  • Get Pipeline Run Details
  • Get Pipeline Run List
  • Get Project List
  • Get Pull Request Commit List
  • Get Pull Request Details
  • Get Pull Request List
  • Get Pull Request Reviewer List
  • Get Repository List
  • Run Pipeline
  • Update Pull Request

Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.

Getting Access Tokens

You can get authentication tokens to access the Azure DevOps APIs using two methods:

Getting Access Tokens using the On behalf of the User – Delegate Permission method

  1. Register your app. To register an app refer to https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app.
  2. Ensure that the required permissions are granted for the registration of the application. Select API Permissions > Add permission > Azure DevOps > Delegated Permissions.

    NOTE: The API Permission that should be granted to the registered application is mentioned in the Minimum permissions section required for the 'Delegate-type' permission table available in the Minimum Permissions section of this document.

  3. The Redirect URL can be directed to any web application in which you want to receive responses from Azure DevOps. If you are unsure about what to set as a redirect URL, you can use https://localhost/myapp.
  4. Copy the following URL and replace the TENANT_ID, CLIENT_ID, and REDIRECT_URI with your tenant ID, client ID, and the following redirect URL:

    https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize?client_id= CLIENT_ID& response_type=code&redirect_uri=REDIRECT_URL&response_mode=query&scope=https://app.vssps.visualstudio.com/.default%20offline_access

  5. Enter the above link with the replaced values and you will be prompted to grant permissions for your Azure Service Management. You will be automatically redirected to a link with the following structure:
    REDIRECT_URI?code=AUTH_CODE&session_state=SESSION_STATE
  6. Copy the AUTH_CODE (without the "code=" prefix) and paste it into your instance configuration in the Authorization Code parameter.
  7. Enter your client ID in the Client ID field.
  8. Enter your client secret in the Client Secret field.
  9. Enter your redirect URL in the Redirect URL field. By default, it is set to https://localhost/myapp.
  10. Enter your API version in the API Version field.
Previous
Next

Azure DevOps v1.0.0

About the connector

Azure DevOps is a cloud-based service for managing software development projects. The Azure DevOps FortiSOAR connector integrates with Azure DevOps to automate the management of repositories, pipelines, work items, and more within FortiSOAR, enabling streamlined DevOps workflows and incident response.

This document provides information about the Azure DevOps connector, which facilitates automated interactions, with a Azure DevOps server using FortiSOAR™ playbooks. Add the Azure DevOps connector as a step in FortiSOAR™ playbooks and perform automated operations with Azure DevOps.

Version information

Connector Version: 1.0.0

FortiSOAR™ Version Tested on: 7.6.1-5275

Azure DevOps Version Tested on: 7.2

Authored By: Fortinet

Certified: Yes

Installing the connector

Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.

You can also use the yum command as a root user to install the connector:

yum install cyops-connector-azure-devops

Prerequisites to configuring the connector

Minimum Permissions Required

To call the Azure DevOps API, to perform any action, you must be assigned specific permissions as defined in the following table:

Action Name Permission Type Permissions
Get Pipeline List Delegate vso.build
Access Token Build -> Read
Get Pipeline Run List Delegate vso.build
Access Token Build -> Read
Get Pipeline Run Details Delegate vso.build
Access Token Build -> Read
Get Project List Delegate vso.profile, vso.project
Access Token Project -> Read, Team -> Read
Get Repository List Delegate vso.code
Access Token Code -> Read
Get Branch List Delegate vso.code
Access Token Code -> Read
Get Commit Details Delegate vso.code
Access Token Code -> Read
Get Pull Request List Delegate vso.code
Access Token Code -> Read
Get Pull Request Details Delegate vso.code
Access Token Code -> Read
Create Pull Request Delegate vso.code_write, vso.identity
Access Token Code -> Read & write, Identity -> Read
Update Pull Request Delegate vso.code_write
Access Token Code -> Read & write
Get Pull Request Reviewer List Delegate vso.code
Access Token Code -> Read
Add Pull Request Reviewer Delegate vso.code_write, vso.identity
Access Token Code -> Read & write, Identity -> Read
Get Pull Request Commit List Delegate vso.code
Access Token Code -> Read
Get Commit List Delegate vso.code
Access Token Code -> Read
Run Pipeline Delegate vso.build_execute
Access Token Build -> Read & Execute

Configuring the connector

For the procedure to configure a connector, click here

Configuration parameters

In FortiSOAR™, on the Connectors page, click the Azure DevOps connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:

Parameter Description
Server URL Specify the IP address or hostname of the Azure DevOps server to connect and perform automated operations.
Organization Name Specify the name of the organization created on Azure DevOps.
Auth Type Select the authentication method to access the Azure DevOps Services REST API. You can choose from the following options:
  • Access Token: Select this and specify an access token in the Access Token field. For information on generating access tokens, refer to Creating PAT on Microsoft's Azure DevOps documentation.
  • On behalf of User - Delegate Permission: Select this option to use a delegated token and specify values in the following fields:
    • Tenant ID: Specify the ID of the tenant assigned to you by the Azure application registration portal.
    • Client ID: Specify the Unique Application ID of the Azure Active Directory application to create an authentication token required to access the API. For information on getting authentication tokens, see the Getting Authentication Tokens section.
    • Client Secret: Specify the Unique Client Secret of the Azure Active Directory application that is used to create an authentication token required to access the API. For information on how to get the secret key, see Get started with Azure DevOps OAuth on Microsoft's Azure DevOps documentation.
    • Authorization Code: Specify the authorization code that you acquired during the authorization step. For more information, see the Getting Access Tokens using the Delegate Permissions method section.
    • Redirect URL: The redirect_uri of your app, where authentication responses can be sent and received by your app. The redirect URL that you specify here must exactly match one of the redirect_uri's you have registered in your app registration portal.
API Version Specify the API version to use. By default it uses 7.1 api version.
Verify SSL Specifies whether the SSL certificate for the server is to be verified.
By default, this option is selected, i.e., set to true.

Actions supported by the connector

You can use the following automated operations in playbooks and also use the annotations to access operations:

Function Description Annotation and Category
Get Pipeline List Retrieves list of all pipelines within a project. list_pipelines
Investigation
Get Pipeline Run List Retrieves top 10000 runs for a specified pipeline. list_pipeline_runs
Investigation
Get Pipeline Run Details Retrieve details of a specific pipeline run. get_pipeline_run
Investigation
Get Project List Retrieve a list of all projects within the Azure DevOps organization. list_projects
Investigation
Get Repository List Retrieve a list of all repositories within a project. list_repositories
Investigation
Get Branch List Retrieves list of all branches within a specified repository. list_branches
Investigation
Get Commit Details Retrieve details of a specific commit. get_commit
Investigation
Get Pull Request List List all pull requests for a given repository or project. list_pull_requests
Investigation
Get Pull Request Details Retrieves details of a specific pull request. get_pull_requests_by_id
Investigation
Create Pull Request Creates a new pull request for code changes to be reviewed and merged. create_pull_request
Investigation
Update Pull Request Updates an existing pull request with new information such as status, title, description, and merge options. update_pull_request
Investigation
Get Pull Request Reviewer List Retrieve the list of reviewers for a specific pull request. list_pull_request_reviewers
Investigation
Add Pull Request Reviewer Add a reviewer to a pull request or cast a vote on a pull request in Azure DevOps. add_pull_request_reviewer
Investigation
Get Pull Request Commit List Retrieve the commits associated with a specific pull request in Azure DevOps. list_pull_request_commits
Investigation
Get Commit List Retrieve the commits for a specific repository in Azure DevOps. list_commits
Investigation
Run Pipeline Triggers a new run for a specified pipeline. run_pipeline
Investigation

operation: Get Pipeline List

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its pipelines from Azure DevOps.
Sort Field (Optional) Specify the field based on which to sort the retrieved results from Azure DevOps. By default it is set to name.
Sort Order (Optional) Select the sort order to sort the retrieved results from Azure DevOps. You can choose from the following options:
  • ASC
  • DESC

NOTE: The selected sort order sorts the results only by the name field.

Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.
Limit (Optional) Specify the maximum number of records to be retrieved in this operation.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "_links": {
                "web": {
                    "href": ""
                },
                "self": {
                    "href": ""
                }
            },
            "folder": "",
            "revision": ""
        }
    ]
}

operation: Get Pipeline Run List

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its pipeline run list from Azure DevOps.
Pipeline ID Specify the ID of the pipeline whose runs are to be retrieved.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "_links": {
                "web": {
                    "href": ""
                },
                "self": {
                    "href": ""
                },
                "pipeline": {
                    "href": ""
                },
                "pipeline.web": {
                    "href": ""
                }
            },
            "result": "",
            "pipeline": {
                "id": "",
                "url": "",
                "name": "",
                "folder": "",
                "revision": ""
            },
            "createdDate": "",
            "finishedDate": "",
            "templateParameters": {}
        }
    ]
}

operation: Get Pipeline Run Details

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its pipeline run details from Azure DevOps.
Pipeline ID Specify the ID of the pipeline whose run details are to be retrieved.
Run ID Specify the ID of the run whose details are to be retrieved.

Output

The output contains the following populated JSON schema:

{
    "id": "",
    "url": "",
    "name": "",
    "state": "",
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "pipeline": {
            "href": ""
        },
        "pipeline.web": {
            "href": ""
        }
    },
    "result": "",
    "pipeline": {
        "id": "",
        "url": "",
        "name": "",
        "folder": "",
        "revision": ""
    },
    "resources": {
        "repositories": {
            "self": {
                "refName": "",
                "version": "",
                "repository": {
                    "id": "",
                    "type": ""
                }
            }
        }
    },
    "createdDate": "",
    "yamlDetails": {
        "rootYamlFile": {
            "ref": "",
            "yamlFile": "",
            "repoAlias": ""
        },
        "expandedYamlUrl": ""
    },
    "finishedDate": "",
    "templateParameters": {}
}

operation: Get Project List

Input parameters

Parameter Description
State (Optional) Select the state of the project to be retrieved from Azure DevOps. You can choose from the following options:
  • All
  • Create Pending
  • Deleted
  • Deleting
  • New
  • Unchanged
  • Well Formed (Default)
Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.
Offset (Optional) Specify the number of records to be skipped when retrieving results.
Limit (Optional) Specify the maximum number of records to be retrieved.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "lastUpdateTime": ""
        }
    ]
}

operation: Get Repository List

Input parameters

Parameter Description
Project Name Specify the name of the project to retrieve its repositories from Azure DevOps.
Include Hidden Repositories (Optional) Select to include hidden repositories in the response. By default, this option is cleared, i.e., set to false.
Include All URLs (Optional) Select to include all remote URLs in the response. By default, this option is cleared, i.e., set to false.
Include Reference Links (Optional) Select to include reference links in the response. By default, this option is cleared, i.e., set to false.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "name": "",
            "size": "",
            "sshUrl": "",
            "webUrl": "",
            "project": {
                "id": "",
                "url": "",
                "name": "",
                "state": "",
                "revision": "",
                "visibility": "",
                "description": "",
                "lastUpdateTime": ""
            },
            "remoteUrl": "",
            "isDisabled": "",
            "defaultBranch": "",
            "isInMaintenance": "",
            "validRemoteUrls": [],
            "_links": {
                "ssh": {
                    "href": ""
                },
                "web": {
                    "href": ""
                },
                "refs": {
                    "href": ""
                },
                "self": {
                    "href": ""
                },
                "items": {
                    "href": ""
                },
                "pushes": {
                    "href": ""
                },
                "commits": {
                    "href": ""
                },
                "project": {
                    "href": ""
                },
                "pullRequests": {
                    "href": ""
                }
            }
        }
    ]
}

operation: Get Branch List

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the branch list.
Repository Specify the ID or name of the repository whose branch list is to be retrieved.
Branch Name Filter (Contains) (Optional) Specify a substring to retrieve only those branch names that contain the specified string.
Branch Name Filter (Starts With) (Optional) Specify a prefix to retrieve only those branch names that start with the specified string. For example, heads/ma returns branches such as refs/heads/main and refs/heads/master.
Include My Branches (Optional) Select to include only those branches that the user owns, has marked as favorites, and the default branch. By default, this option is cleared, i.e., set to false.
Include Statuses (Optional) Select to include up to the first 1000 commit statuses for each ref. By default, this option is cleared, i.e., set to false.
Include Links (Optional) Select to include referenceLinks in the results. By default, this option is cleared, i.e., set to false.
Latest Statuses Only (Optional) Select to include only the tip commit status for each ref. Requires includeStatuses to be true. By default, this option is cleared, i.e., set to false.
Peel Tags (Optional) Select to use annotated tags to populate the PeeledObjectId property. By default, this option is cleared, i.e., set to false.
Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.
Limit (Optional) Specify the maximum number of refs to return. Maximum value is 1000.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "name": "",
            "_links": {
                "self": {
                    "href": ""
                },
                "repository": {
                    "href": ""
                }
            },
            "creator": {
                "id": "",
                "url": "",
                "_links": {
                    "avatar": {
                        "href": ""
                    }
                },
                "imageUrl": "",
                "descriptor": "",
                "uniqueName": "",
                "displayName": ""
            },
            "objectId": "",
            "statuses": []
        }
    ]
}

operation: Get Commit Details

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the commit details.
Repository Specify the ID or name of the repository whose commit is to be retrieved.
Commit ID Specify the ID of the commit to be retrieved.
Change Count (Optional) Specify the number of changes to include in the result.

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "push": {
        "date": "",
        "pushId": "",
        "pushedBy": {
            "id": "",
            "url": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "descriptor": "",
            "uniqueName": "",
            "displayName": ""
        }
    },
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "changes": {
            "href": ""
        },
        "repository": {
            "href": ""
        }
    },
    "author": {
        "date": "",
        "name": "",
        "email": "",
        "imageUrl": ""
    },
    "treeId": "",
    "comment": "",
    "parents": [],
    "commitId": "",
    "committer": {
        "date": "",
        "name": "",
        "email": "",
        "imageUrl": ""
    },
    "remoteUrl": "",
    "changes": [
        {
            "item": {
                "url": "",
                "path": "",
                "commitId": "",
                "objectId": "",
                "gitObjectType": ""
            },
            "changeType": ""
        }
    ],
    "changeCounts": {
        "Add": "",
        "Edit": "",
        "Delete": ""
    }
}

operation: Get Pull Request List

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the list of pull requests (PR).
Repository Specify the ID or name of the repository to retrieve its list of PRs.
Status (Optional) Select the status of the pull requests to filter the retrieved results. You can choose from the following options:
  • All
  • Active
  • Abandoned
  • Completed
  • Not Set
Search Criteria (Optional) Specify the search criteria, as JSON, to retrieve the pull requests from Azure DevOps. For example:
{
                    "maxTime": "",
                    "minTime": "",
                    "creatorId": "",
                    "reviewerId": "",
                    "includeLinks": "",
                    "repositoryId": "",
                    "sourceRefName": "",
                    "targetRefName": "",
                    "queryTimeRangeType": "",
                    "sourceRepositoryId": ""
                  }
Offset (Optional) Specify the number of records to be skipped retrieved in this operation.
Limit (Optional) Specify the maximum number of records to be retrieved in this operation.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "title": "",
            "status": "",
            "isDraft": "",
            "mergeId": "",
            "createdBy": {
                "id": "",
                "url": "",
                "_links": {
                    "avatar": {
                        "href": ""
                    }
                },
                "imageUrl": "",
                "descriptor": "",
                "uniqueName": "",
                "displayName": ""
            },
            "reviewers": [
                {
                    "id": "",
                    "url": "",
                    "vote": "",
                    "_links": {
                        "avatar": {
                            "href": ""
                        }
                    },
                    "imageUrl": "",
                    "isFlagged": "",
                    "uniqueName": "",
                    "displayName": "",
                    "hasDeclined": "",
                    "reviewerUrl": ""
                }
            ],
            "closedDate": "",
            "repository": {
                "id": "",
                "url": "",
                "name": "",
                "project": {
                    "id": "",
                    "name": "",
                    "state": "",
                    "visibility": "",
                    "lastUpdateTime": ""
                }
            },
            "mergeStatus": "",
            "description": "",
            "codeReviewId": "",
            "creationDate": "",
            "pullRequestId": "",
            "sourceRefName": "",
            "targetRefName": "",
            "lastMergeCommit": {
                "url": "",
                "commitId": ""
            },
            "completionOptions": {
                "mergeStrategy": "",
                "mergeCommitMessage": "",
                "transitionWorkItems": "",
                "autoCompleteIgnoreConfigIds": []
            },
            "supportsIterations": "",
            "completionQueueTime": "",
            "lastMergeSourceCommit": {
                "url": "",
                "commitId": ""
            },
            "lastMergeTargetCommit": {
                "url": "",
                "commitId": ""
            }
        }
    ]
}

operation: Get Pull Request Details

Input parameters

Parameter Description
Project Name Specify the name of the project from which to retrieve the pull request (PR) details.
Pull Request ID Specify the ID of the pull request which is to be retrieved for the specified project.

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "title": "",
    "status": "",
    "isDraft": "",
    "mergeId": "",
    "createdBy": {
        "id": "",
        "url": "",
        "_links": {
            "avatar": {
                "href": ""
            }
        },
        "imageUrl": "",
        "descriptor": "",
        "uniqueName": "",
        "displayName": ""
    },
    "reviewers": [
        {
            "id": "",
            "url": "",
            "vote": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "isFlagged": "",
            "uniqueName": "",
            "displayName": "",
            "hasDeclined": "",
            "reviewerUrl": ""
        }
    ],
    "artifactId": "",
    "repository": {
        "id": "",
        "url": "",
        "name": "",
        "size": "",
        "sshUrl": "",
        "webUrl": "",
        "project": {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "description": "",
            "lastUpdateTime": ""
        },
        "remoteUrl": "",
        "isDisabled": "",
        "isInMaintenance": ""
    },
    "mergeStatus": "",
    "codeReviewId": "",
    "creationDate": "",
    "pullRequestId": "",
    "sourceRefName": "",
    "targetRefName": "",
    "lastMergeCommit": {
        "url": "",
        "author": {
            "date": "",
            "name": "",
            "email": ""
        },
        "comment": "",
        "commitId": "",
        "committer": {
            "date": "",
            "name": "",
            "email": ""
        }
    },
    "lastMergeSourceCommit": {
        "url": "",
        "commitId": ""
    },
    "lastMergeTargetCommit": {
        "url": "",
        "commitId": ""
    },
    "supportsIterations": "",
    "description": ""
}

operation: Create Pull Request

Input parameters

Parameter Description
Project Name Specify the Azure DevOps project associated with the repository under which the PR is to be created.
Repository Select the ID or name of the repository under which the PR is to be created.
Pull Request Title Specify a title for the pull request being created.
Source Branch Name Specify the name of the source branch for creating the PR.
Target Branch Name Specify the name of the target branch for creating the PR.
Pull Request Description (Optional) Specify a description for the pull request.
Reviewers (Optional) Specify IDs, display names, or email IDs as comma-separated values to add as reviewers for this pull request.
Supports Iterations (Optional) Select to enable reviewing of subsequent pushes individually.
Additional Inputs (Optional) Specify any other parameters, as JSON, of this pull request to be created. For example, { "isDraft": true }

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "title": "",
    "_links": {
        "self": {
            "href": ""
        },
        "statuses": {
            "href": ""
        },
        "createdBy": {
            "href": ""
        },
        "workItems": {
            "href": ""
        },
        "repository": {
            "href": ""
        },
        "sourceBranch": {
            "href": ""
        },
        "sourceCommit": {
            "href": ""
        },
        "targetBranch": {
            "href": ""
        },
        "targetCommit": {
            "href": ""
        }
    },
    "labels": [],
    "status": "",
    "isDraft": "",
    "mergeId": "",
    "createdBy": {
        "id": "",
        "url": "",
        "_links": {
            "avatar": {
                "href": ""
            }
        },
        "imageUrl": "",
        "descriptor": "",
        "uniqueName": "",
        "displayName": ""
    },
    "reviewers": [],
    "artifactId": "",
    "repository": {
        "id": "",
        "url": "",
        "name": "",
        "size": "",
        "sshUrl": "",
        "webUrl": "",
        "project": {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "description": "",
            "lastUpdateTime": ""
        },
        "remoteUrl": "",
        "isDisabled": "",
        "isInMaintenance": ""
    },
    "mergeStatus": "",
    "codeReviewId": "",
    "creationDate": "",
    "pullRequestId": "",
    "sourceRefName": "",
    "targetRefName": "",
    "lastMergeSourceCommit": {
        "url": "",
        "commitId": ""
    },
    "lastMergeTargetCommit": {
        "url": "",
        "commitId": ""
    },
    "supportsIterations": "",
    "description": ""
}

operation: Update Pull Request

Input parameters

Parameter Description
Project Name Specify the Azure DevOps project associated with the repository under which the PR is to be updated.
Repository Select the ID or name of the repository under which the PR is to be updated.
Pull Request ID Specify the ID of the pull request to update.
Pull Request Title Specify a title for the pull request to update.
Pull Request Description (Optional) Specify a new description for the pull request (up to 4000 characters).
Pull Request Status (Optional) Select the new status of the pull requests to update. You can choose from the following options:
  • Active
  • Abandoned
  • Completed
  • Not Set
Target Branch Name (Optional) Specify a different name of the target branch to update, if changing the target for the PR.
Additional Inputs Specify any other parameters, as JSON, of this pull request to be created. For example, { "isDraft": true }

Output

The output contains the following populated JSON schema:

{
    "url": "",
    "title": "",
    "_links": {
        "self": {
            "href": ""
        },
        "statuses": {
            "href": ""
        },
        "createdBy": {
            "href": ""
        },
        "workItems": {
            "href": ""
        },
        "iterations": {
            "href": ""
        },
        "repository": {
            "href": ""
        },
        "sourceBranch": {
            "href": ""
        },
        "sourceCommit": {
            "href": ""
        },
        "targetBranch": {
            "href": ""
        },
        "targetCommit": {
            "href": ""
        }
    },
    "status": "",
    "isDraft": "",
    "mergeId": "",
    "createdBy": {
        "id": "",
        "url": "",
        "_links": {
            "avatar": {
                "href": ""
            }
        },
        "imageUrl": "",
        "descriptor": "",
        "uniqueName": "",
        "displayName": ""
    },
    "reviewers": [],
    "artifactId": "",
    "repository": {
        "id": "",
        "url": "",
        "name": "",
        "size": "",
        "sshUrl": "",
        "webUrl": "",
        "project": {
            "id": "",
            "url": "",
            "name": "",
            "state": "",
            "revision": "",
            "visibility": "",
            "description": "",
            "lastUpdateTime": ""
        },
        "remoteUrl": "",
        "isDisabled": "",
        "isInMaintenance": ""
    },
    "mergeStatus": "",
    "codeReviewId": "",
    "creationDate": "",
    "pullRequestId": "",
    "sourceRefName": "",
    "targetRefName": "",
    "lastMergeCommit": {
        "url": "",
        "author": {
            "date": "",
            "name": "",
            "email": ""
        },
        "comment": "",
        "commitId": "",
        "committer": {
            "date": "",
            "name": "",
            "email": ""
        }
    },
    "lastMergeSourceCommit": {
        "url": "",
        "commitId": ""
    },
    "lastMergeTargetCommit": {
        "url": "",
        "commitId": ""
    },
    "supportsIterations": "",
    "description": ""
}

operation: Get Pull Request Reviewer List

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository whose PR reviewers are to be retrieved.
Repository Specify the ID or name of the repository where the pull request exists.
Pull Request ID Specify the ID of the pull request whose reviewers you want to retrieve.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "vote": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "isFlagged": "",
            "uniqueName": "",
            "displayName": "",
            "hasDeclined": "",
            "reviewerUrl": ""
        }
    ]
}

operation: Add Pull Request Reviewer

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository where PR reviewers are to be added.
Repository Specify the ID or name of the repository where the pull request exists.
Pull Request ID Specify the ID of the pull request to which the reviewer is to be added.
Reviewer Specify the ID, display name, or email address of the reviewer to be added to the pull request.
Required Reviewer (Optional) Select to mark the reviewer as required.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "id": "",
            "url": "",
            "vote": "",
            "_links": {
                "avatar": {
                    "href": ""
                }
            },
            "imageUrl": "",
            "isFlagged": "",
            "uniqueName": "",
            "displayName": "",
            "hasDeclined": "",
            "reviewerUrl": ""
        }
    ]
}

operation: Get Pull Request Commit List

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository whose PR commit list is to be retrieved. Specify the name of the Azure DevOps project associated with the repository.
Repository Specify the ID or name of the repository where the pull request exists.
Pull Request ID Specify the ID of the pull request for which the commits are to be listed.
Limit (Optional) Specify the maximum number of commits to return.
Continuation Token (Optional) Specify the continuation token from a previous request to retrieve the next page of results.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "author": {
                "date": "",
                "name": "",
                "email": ""
            },
            "comment": "",
            "commitId": "",
            "committer": {
                "date": "",
                "name": "",
                "email": ""
            }
        }
    ]
}

operation: Get Commit List

Input parameters

Parameter Description
Project Name Specify the name of the Azure DevOps project associated with the repository whose commits are to be retrieved.
Repository Specify the ID or name of the repository whose commit list is to be retrieved.
Search Options (Optional) Select the criteria to filter search results. You can choose from the following options:
  • Commit IDs: Select this option to specify exact commit IDs as comma-separated values in the Commit IDs field.
  • Other: Select to use additional filtering options by specifying values in the following fields:
    • Committer: (Optional) Specify the alias or display name of the committer.
    • From Commit ID: (Optional) Specify the lower bound commit ID for filtering commits.
    • To Commit ID: (Optional) Specify the upper bound commit ID for filtering commits.
    • From Date: (Optional) Specify the start date to include history entries created after this date.
    • To Date: (Optional) Specify the end date to include history entries created before this date.
    • Commit Author: (Optional) Specify the alias or display name of the author.
    • Exclude Deletes: (Optional) Specify whether to exclude delete entries for the specified path.
    • History Mode: (Optional) Specify the Git history mode to use.
    • Include Push Data: (Optional) Specify whether to include push information.
    • Show Oldest Commits First: (Optional) Specify whether to show the oldest commits first.
    • Search Criteria: Specify the search criteria to retrieve the commits from Azure DevOps. For example, you can include parameters like `fromCommitId`, `toCommitId`, `author`, and `fromDate`.
    • Offset: (Optional) Specify the number of records to skip.
    • Limit: (Optional) Specify the maximum number of commits to retrieve.

Output

The output contains the following populated JSON schema:

{
    "count": "",
    "value": [
        {
            "url": "",
            "author": {
                "date": "",
                "name": "",
                "email": ""
            },
            "comment": "",
            "commitId": "",
            "committer": {
                "date": "",
                "name": "",
                "email": ""
            },
            "remoteUrl": "",
            "changeCounts": {
                "Add": "",
                "Edit": "",
                "Delete": ""
            },
            "commentTruncated": ""
        }
    ]
}

operation: Run Pipeline

Input parameters

Parameter Description
Project Name Specify the name of the project under which the pipeline is to be run.
Pipeline ID Specify the ID of the pipeline to run.
Stages to Skip (Optional) Specify the pipeline stage names as comma-separated values that are to be skipped during execution.
Pipeline Version (Optional) Specify the pipeline version being run.
Preview Run (Optional) Select to return the final YAML document after parsing templates as a run preview.
Resources (Optional) Specify the resources required for the run.

Output

The output contains the following populated JSON schema:

Output schema when you choose Preview Run as false:

{
    "id": "",
    "url": "",
    "name": "",
    "state": "",
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "pipeline": {
            "href": ""
        },
        "pipeline.web": {
            "href": ""
        }
    },
    "pipeline": {
        "id": "",
        "url": "",
        "name": "",
        "folder": "",
        "revision": ""
    },
    "resources": {
        "repositories": {
            "self": {
                "refName": "",
                "version": "",
                "repository": {
                    "id": "",
                    "type": ""
                }
            }
        }
    },
    "createdDate": "",
    "templateParameters": {}
}

Output schema when you choose Preview Run as true:

{
    "id": "",
    "url": "",
    "name": "",
    "state": "",
    "_links": {
        "web": {
            "href": ""
        },
        "self": {
            "href": ""
        },
        "pipeline": {
            "href": ""
        },
        "pipeline.web": {
            "href": ""
        }
    },
    "pipeline": {
        "id": "",
        "url": "",
        "name": "",
        "folder": "",
        "revision": ""
    },
    "finalYaml": "",
    "templateParameters": {}
}

Included playbooks

The Sample - Azure DevOps - 1.0.0 playbook collection comes bundled with the Azure DevOps connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the Azure DevOps connector.

Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.

Getting Access Tokens

You can get authentication tokens to access the Azure DevOps APIs using two methods:

Getting Access Tokens using the On behalf of the User – Delegate Permission method

  1. Register your app. To register an app refer to https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app.
  2. Ensure that the required permissions are granted for the registration of the application. Select API Permissions > Add permission > Azure DevOps > Delegated Permissions.

    NOTE: The API Permission that should be granted to the registered application is mentioned in the Minimum permissions section required for the 'Delegate-type' permission table available in the Minimum Permissions section of this document.

  3. The Redirect URL can be directed to any web application in which you want to receive responses from Azure DevOps. If you are unsure about what to set as a redirect URL, you can use https://localhost/myapp.
  4. Copy the following URL and replace the TENANT_ID, CLIENT_ID, and REDIRECT_URI with your tenant ID, client ID, and the following redirect URL:

    https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize?client_id= CLIENT_ID& response_type=code&redirect_uri=REDIRECT_URL&response_mode=query&scope=https://app.vssps.visualstudio.com/.default%20offline_access

  5. Enter the above link with the replaced values and you will be prompted to grant permissions for your Azure Service Management. You will be automatically redirected to a link with the following structure:
    REDIRECT_URI?code=AUTH_CODE&session_state=SESSION_STATE
  6. Copy the AUTH_CODE (without the "code=" prefix) and paste it into your instance configuration in the Authorization Code parameter.
  7. Enter your client ID in the Client ID field.
  8. Enter your client secret in the Client Secret field.
  9. Enter your redirect URL in the Redirect URL field. By default, it is set to https://localhost/myapp.
  10. Enter your API version in the API Version field.
Previous
Next