azuredevops logo
Azure DevOps v2.7.0, Mar 27 23

azuredevops.getProjects

Explore with Pulumi AI

Use this data source to access information about existing Projects within Azure DevOps.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

return await Deployment.RunAsync(() => 
{
    var example = AzureDevOps.GetProjects.Invoke(new()
    {
        Name = "Example Project",
        State = "wellFormed",
    });

    return new Dictionary<string, object?>
    {
        ["projectId"] = new[]
        {
            example.Apply(getProjectsResult => getProjectsResult.Projects),
        }.Select(__item => __item?.ProjectId).ToList(),
        ["name"] = new[]
        {
            example.Apply(getProjectsResult => getProjectsResult.Projects),
        }.Select(__item => __item?.Name).ToList(),
        ["projectUrl"] = new[]
        {
            example.Apply(getProjectsResult => getProjectsResult.Projects),
        }.Select(__item => __item?.ProjectUrl).ToList(),
        ["state"] = new[]
        {
            example.Apply(getProjectsResult => getProjectsResult.Projects),
        }.Select(__item => __item?.State).ToList(),
    };
});

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.AzuredevopsFunctions;
import com.pulumi.azuredevops.inputs.GetProjectsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = AzuredevopsFunctions.getProjects(GetProjectsArgs.builder()
            .name("Example Project")
            .state("wellFormed")
            .build());

        ctx.export("projectId", example.applyValue(getProjectsResult -> getProjectsResult.projects()).stream().map(element -> element.projectId()).collect(toList()));
        ctx.export("name", example.applyValue(getProjectsResult -> getProjectsResult.projects()).stream().map(element -> element.name()).collect(toList()));
        ctx.export("projectUrl", example.applyValue(getProjectsResult -> getProjectsResult.projects()).stream().map(element -> element.projectUrl()).collect(toList()));
        ctx.export("state", example.applyValue(getProjectsResult -> getProjectsResult.projects()).stream().map(element -> element.state()).collect(toList()));
    }
}
import pulumi
import pulumi_azuredevops as azuredevops

example = azuredevops.get_projects(name="Example Project",
    state="wellFormed")
pulumi.export("projectId", [__item.project_id for __item in [example.projects]])
pulumi.export("name", [__item.name for __item in [example.projects]])
pulumi.export("projectUrl", [__item.project_url for __item in [example.projects]])
pulumi.export("state", [__item.state for __item in [example.projects]])
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const example = azuredevops.getProjects({
    name: "Example Project",
    state: "wellFormed",
});
export const projectId = [example.then(example => example.projects)].map(__item => __item?.projectId);
export const name = [example.then(example => example.projects)].map(__item => __item?.name);
export const projectUrl = [example.then(example => example.projects)].map(__item => __item?.projectUrl);
export const state = [example.then(example => example.projects)].map(__item => __item?.state);

Coming soon!

Using getProjects

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>
def get_projects(name: Optional[str] = None,
                 state: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetProjectsResult
def get_projects_output(name: Optional[pulumi.Input[str]] = None,
                 state: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]
func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput

> Note: This function is named GetProjects in the Go SDK.

public static class GetProjects 
{
    public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azuredevops:index/getProjects:getProjects
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

Name of the Project, if not specified all projects will be returned.

State string

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

Name string

Name of the Project, if not specified all projects will be returned.

State string

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name String

Name of the Project, if not specified all projects will be returned.

state String

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name string

Name of the Project, if not specified all projects will be returned.

state string

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name str

Name of the Project, if not specified all projects will be returned.

state str

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name String

Name of the Project, if not specified all projects will be returned.

state String

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

getProjects Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Projects List<Pulumi.AzureDevOps.Outputs.GetProjectsProject>

A list of existing projects in your Azure DevOps Organization with details about every project which includes:

Name string

Project name.

State string

Project state.

Id string

The provider-assigned unique ID for this managed resource.

Projects []GetProjectsProject

A list of existing projects in your Azure DevOps Organization with details about every project which includes:

Name string

Project name.

State string

Project state.

id String

The provider-assigned unique ID for this managed resource.

projects List<GetProjectsProject>

A list of existing projects in your Azure DevOps Organization with details about every project which includes:

name String

Project name.

state String

Project state.

id string

The provider-assigned unique ID for this managed resource.

projects GetProjectsProject[]

A list of existing projects in your Azure DevOps Organization with details about every project which includes:

name string

Project name.

state string

Project state.

id str

The provider-assigned unique ID for this managed resource.

projects Sequence[GetProjectsProject]

A list of existing projects in your Azure DevOps Organization with details about every project which includes:

name str

Project name.

state str

Project state.

id String

The provider-assigned unique ID for this managed resource.

projects List<Property Map>

A list of existing projects in your Azure DevOps Organization with details about every project which includes:

name String

Project name.

state String

Project state.

Supporting Types

GetProjectsProject

Name string

Name of the Project, if not specified all projects will be returned.

ProjectId string

Project identifier.

ProjectUrl string

Url to the full version of the object.

State string

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

Name string

Name of the Project, if not specified all projects will be returned.

ProjectId string

Project identifier.

ProjectUrl string

Url to the full version of the object.

State string

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name String

Name of the Project, if not specified all projects will be returned.

projectId String

Project identifier.

projectUrl String

Url to the full version of the object.

state String

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name string

Name of the Project, if not specified all projects will be returned.

projectId string

Project identifier.

projectUrl string

Url to the full version of the object.

state string

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name str

Name of the Project, if not specified all projects will be returned.

project_id str

Project identifier.

project_url str

Url to the full version of the object.

state str

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

name String

Name of the Project, if not specified all projects will be returned.

projectId String

Project identifier.

projectUrl String

Url to the full version of the object.

state String

State of the Project, if not specified all projects will be returned. Valid values are all, deleting, new, wellFormed, createPending, unchanged,deleted.

Package Details

Repository
Azure DevOps pulumi/pulumi-azuredevops
License
Apache-2.0
Notes

This Pulumi package is based on the azuredevops Terraform Provider.