layout | page_title | description |
---|---|---|
azuredevops |
AzureDevops: azuredevops_git_repositories |
Use this data source to access information about an existing Projects within Azure DevOps. |
Use this data source to access information about an existing Git Repositories within Azure DevOps.
# Load all projects of an organization, that are accessible by the current user
data "azuredevops_project" "p" {
project_name = "contoso-project"
}
# Load all Git repositories of a project, which are accessible for the current user
data "azuredevops_git_repositories" "all_repos" {
project_id = data.azuredevops_project.p.id
include_hidden = true
}
# Load a specific Git repository by name
data "azuredevops_git_repositories" "single_repo" {
project_id = data.azuredevops_project.p.id
name = "contoso-repo"
}
The following arguments are supported:
project_id
- (Optional) ID of project to list Git repositoriesname
- (Optional) Name of the Git repository to retrieve; requiresproject_id
to be specified as wellinclude_hidden
- (Optional, default: false)
DataSource without specifying any arguments will return all Git repositories of an organization.
The following attributes are exported:
-
repositories
- A list of existing projects in your Azure DevOps Organization with details about every project which includes:id
- Git repository identifier.name
- Git repository name.url
- Details REST API endpoint for the Git Repository.ssh_url
- SSH Url to clone the Git repositoryweb_url
- Url of the Git repository web viewremote_url
- HTTPS Url to clone the Git repositoryproject_id
- Project identifier to which the Git repository belongs.size
- Compressed size (bytes) of the repository.default_branch
- The ref of the default branch.