Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- [`repository`](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/repositories/list?view=azure-devops-rest-7.2&tabs=HTTP#gitrepository)
- [`branch`](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/refs/list?view=azure-devops-rest-7.1#gitref)
- [`repository-policy`](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/policy-configurations/get?view=azure-devops-rest-7.1#policyconfiguration)
- [`project`](https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=azure-devops-rest-7.1&tabs=HTTP#teamprojectreference)
- [`pull-request`](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/get-pull-requests?view=azure-devops-rest-7.1&tabs=HTTP#gitpullrequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,46 @@ Here is an example of the payload structure from Azure DevOps:

</details>

<details>
<summary><b>Branch response data (click to expand)</b></summary>

```json showLineNumbers
{
"name": "refs/heads/feature/new-feature",
"objectId": "ffe9cba521f00d7f60e322845072238635edb451",
"creator": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/ac5aaba6-a66a-4e1d-b508-b060ec624fa9",
"_links": {
"avatar": {
"href": "https://dev.azure.com/fabrikam/_apis/GraphProfile/MemberAvatars/aad.YmFjMGYyZDctNDA3ZC03OGRhLTlhMjUtNmJhZjUwMWFjY2U5"
}
},
"id": "ac5aaba6-a66a-4e1d-b508-b060ec624fa9",
"uniqueName": "[email protected]",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=ac5aaba6-a66a-4e1d-b508-b060ec624fa9",
"descriptor": "aad.YmFjMGYyZDctNDA3ZC03OGRhLTlhMjUtNmJhZjUwMWFjY2U5"
},
"url": "https://dev.azure.com/fabrikam/7484f783-66a3-4f27-b7cd-6b08b0b077ed/_apis/git/repositories/d3d1760b-311c-4175-a726-20dfc6a7f885/refs?filter=heads%2Ffeature%2Fnew-feature",
"__repository": {
"id": "d3d1760b-311c-4175-a726-20dfc6a7f885",
"name": "my-repository",
"url": "https://dev.azure.com/fabrikam/7484f783-66a3-4f27-b7cd-6b08b0b077ed/_apis/git/repositories/d3d1760b-311c-4175-a726-20dfc6a7f885",
"webUrl": "https://dev.azure.com/fabrikam/7484f783-66a3-4f27-b7cd-6b08b0b077ed/_git/my-repository",
"project": {
"id": "7484f783-66a3-4f27-b7cd-6b08b0b077ed",
"name": "My Project",
"url": "https://dev.azure.com/fabrikam/_apis/projects/7484f783-66a3-4f27-b7cd-6b08b0b077ed",
"state": "wellFormed",
"revision": 12,
"visibility": "public",
"lastUpdateTime": "2025-05-04T09:34:21.397Z"
}
}
}
```

</details>

### Mapping Result

Expand Down Expand Up @@ -1281,7 +1319,7 @@ The combination of the sample payload and the Ocean configuration generates the


<details>
<summary> Iteration entity in Port </summary>
<summary><b> Iteration entity in Port (Click to expand)</b></summary>

```json showLineNumbers
{
Expand All @@ -1301,8 +1339,26 @@ The combination of the sample payload and the Ocean configuration generates the

</details>

<details>
<summary><b>Branch entity in Port (Click to expand)</b></summary>

```json showLineNumbers
{
"identifier": "7b3d6f8480e87f728ebce5378322c6a77d3fv19d",
"title": "refs/heads/feature/new-feature",
"blueprint": "branch",
"properties": {
"repositoryName": "my-repository",
"projectName": "My Project",
"link": "https://dev.azure.com/fabrikam/7484f783-66a3-4f27-b7cd-6b08b0b077ed/_git/my-repository?version=GBrefs/heads/feature/new-feature"
},
"relations": {
"repository": "myproject/my-repository"
}
}
```

</details>

## Relevant Guides
For relevant guides and examples, see the [guides section](https://docs.port.io/guides?tags=AzureDevops).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<details>
<summary><b>Branch blueprint (click to expand)</b></summary>

```json showLineNumbers
{
"identifier": "branch",
"title": "Branch",
"icon": "AzureDevops",
"schema": {
"properties": {
"repositoryName": {
"title": "Repository Name",
"type": "string",
"icon": "AzureDevops",
"description": "The name of the repository that contains this branch"
},
"projectName": {
"title": "Project Name",
"type": "string",
"icon": "AzureDevops",
"description": "The name of the project that contains this branch"
},
"link": {
"title": "Link",
"type": "string",
"format": "url",
"icon": "Link",
"description": "Link to the branch in Azure DevOps"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"repository": {
"title": "Repository",
"target": "service",
"required": false,
"many": false
}
}
}
```

</details>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<details>
<summary><b>Integration mapping (click to expand)</b></summary>

```yaml showLineNumbers
resources:
- kind: repository
selector:
query: 'true'
port:
entity:
mappings:
identifier: >-
"\(.project.name | ascii_downcase | gsub("[ ();]"; ""))/\(.name | ascii_downcase | gsub("[ ();]"; ""))"
title: .name
blueprint: '"service"'
properties:
url: .remoteUrl
readme: file://README.md
id: .id
last_activity: .project.lastUpdateTime
relations:
project: .project.id | gsub(" "; "")
- kind: branch
selector:
query: 'true'
port:
entity:
mappings:
identifier: .objectId
title: .name
blueprint: '"branch"'
properties:
repositoryName: .__repository.name
projectName: .__repository.project.name
link: .__repository.webUrl + "?version=GB" + .name
relations:
repository: >-
"\(.__repository.project.name | ascii_downcase | gsub("[ ();]";
""))/\(.__repository.name | ascii_downcase | gsub("[ ();]"; ""))"

```

</details>
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ import PortPipelineRunAppConfig from './example-pipeline-run/\_azuredevops_expor
import IterationBlueprint from './example-iteration/\_azuredevops_exporter_example_iteration_blueprint.mdx'
import PortIterationAppConfig from './example-iteration/\_azuredevops_exporter_example_iteration_port_app_config.mdx'

import BranchBlueprint from './example-branch/\_azuredevops_exporter_example_branch_blueprint.mdx'
import PortBranchAppConfig from './example-branch/\_azuredevops_exporter_example_branch_port_app_config.mdx'

import EnvironmentBlueprint from './example-environment/\_azuredevops_exporter_example_environment_blueprint.mdx'
import PortEnvironmentAppConfig from './example-environment/\_azuredevops_exporter_example_environment_port_app_config.mdx'

Expand Down Expand Up @@ -212,6 +215,27 @@ You can use the following Port blueprint definitions and integration configurati

After creating the blueprints and saving the integration configuration, you will see new entities in Port matching your iterations.

## Mapping branches

The following example demonstrates how to ingest your Azure DevOps branches to Port.
You can use the following Port blueprint definitions and integration configuration:

<RepositoryBlueprint/>

<BranchBlueprint/>

<PortBranchAppConfig/>

:::tip To Learn more

- Refer to the [setup](azure-devops.md#setup) section to learn more about the integration configuration setup process.
- We leverage [JQ JSON processor](https://stedolan.github.io/jq/manual/) to map and transform Azure DevOps objects to Port entities.
- Click [Here](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/refs/list?view=azure-devops-rest-7.1#gitref) for the Azure DevOps refs object structure.

:::

After creating the blueprints and saving the integration configuration, you will see new entities in Port matching your branches.

## Mapping test runs
<Tabs groupId="config" queryString="parameter">

Expand Down