GetRepositories

Use this data source to access information about an existing Git Repositories within Azure DevOps.

Example Usage

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var project = Output.Create(AzureDevOps.Core.GetProject.InvokeAsync(new AzureDevOps.Core.GetProjectArgs
        {
            ProjectName = "contoso-project",
        }));
        var allRepos = project.Apply(project => Output.Create(AzureDevOps.Repository.GetRepositories.InvokeAsync(new AzureDevOps.Repository.GetRepositoriesArgs
        {
            ProjectId = project.Id,
            IncludeHidden = true,
        })));
        var singleRepo = project.Apply(project => Output.Create(AzureDevOps.Repository.GetRepositories.InvokeAsync(new AzureDevOps.Repository.GetRepositoriesArgs
        {
            ProjectId = project.Id,
            Name = "contoso-repo",
        })));
    }

}
package main

import (
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        project, err := Core.LookupProject(ctx, &Core.LookupProjectArgs{
            ProjectName: "contoso-project",
        }, nil)
        if err != nil {
            return err
        }
        allRepos, err := Repository.LookupRepositories(ctx, &Repository.LookupRepositoriesArgs{
            ProjectId:     project.Id,
            IncludeHidden: true,
        }, nil)
        if err != nil {
            return err
        }
        singleRepo, err := Repository.LookupRepositories(ctx, &Repository.LookupRepositoriesArgs{
            ProjectId: project.Id,
            Name:      "contoso-repo",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azuredevops as azuredevops

project = azuredevops.Core.get_project(project_name="contoso-project")
all_repos = azuredevops.Repository.get_repositories(project_id=project.id,
    include_hidden=True)
single_repo = azuredevops.Repository.get_repositories(project_id=project.id,
    name="contoso-repo")
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const project = azuredevops.Core.getProject({
    projectName: "contoso-project",
});
const allRepos = project.then(project => azuredevops.Repository.getRepositories({
    projectId: project.id,
    includeHidden: true,
}));
const singleRepo = project.then(project => azuredevops.Repository.getRepositories({
    projectId: project.id,
    name: "contoso-repo",
}));

Using GetRepositories

function getRepositories(args: GetRepositoriesArgs, opts?: InvokeOptions): Promise<GetRepositoriesResult>
function  get_repositories(include_hidden=None, name=None, project_id=None, opts=None)
func GetRepositories(ctx *Context, args *GetRepositoriesArgs, opts ...InvokeOption) (*GetRepositoriesResult, error)
public static class GetRepositories {
    public static Task<GetRepositoriesResult> InvokeAsync(GetRepositoriesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

IncludeHidden bool
Name string
ProjectId string
IncludeHidden bool
Name string
ProjectId string
includeHidden boolean
name string
projectId string
include_hidden bool
name str
project_id str

GetRepositories Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Repositories List<Pulumi.AzureDevOps.Repository.Outputs.GetRepositoriesRepository>
IncludeHidden bool
Name string
ProjectId string
Id string

The provider-assigned unique ID for this managed resource.

Repositories []GetRepositoriesRepository
IncludeHidden bool
Name string
ProjectId string
id string

The provider-assigned unique ID for this managed resource.

repositories GetRepositoriesRepository[]
includeHidden boolean
name string
projectId string
id str

The provider-assigned unique ID for this managed resource.

repositories List[GetRepositoriesRepository]
include_hidden bool
name str
project_id str

Supporting Types

GetRepositoriesRepository

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

DefaultBranch string
Id string
Name string
ProjectId string
RemoteUrl string
Size int
SshUrl string
Url string
WebUrl string
DefaultBranch string
Id string
Name string
ProjectId string
RemoteUrl string
Size int
SshUrl string
Url string
WebUrl string
defaultBranch string
id string
name string
projectId string
remoteUrl string
size number
sshUrl string
url string
webUrl string
default_branch str
id str
name str
project_id str
remote_url str
size float
ssh_url str
url str
web_url str

Package Details

Repository
https://github.com/pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.