GetProjects

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

Example Usage

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

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(AzureDevOps.Core.GetProjects.InvokeAsync(new AzureDevOps.Core.GetProjectsArgs
        {
            ProjectName = "contoso",
            State = "wellFormed",
        }));
        this.ProjectId = test.Apply(test => test.Projects.Select(__item => __item.ProjectId).ToList());
        this.ProjectName = test.Apply(test => test.Projects.Select(__item => __item.Name).ToList());
        this.ProjectUrl = test.Apply(test => test.Projects.Select(__item => __item.ProjectUrl).ToList());
        this.State = test.Apply(test => test.Projects.Select(__item => __item.State).ToList());
    }

    [Output("projectId")]
    public Output<string> ProjectId { get; set; }
    [Output("projectName")]
    public Output<string> ProjectName { get; set; }
    [Output("projectUrl")]
    public Output<string> ProjectUrl { get; set; }
    [Output("state")]
    public Output<string> State { get; set; }
}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        test, err := Core.LookupProjects(ctx, &Core.LookupProjectsArgs{
            ProjectName: "contoso",
            State:       "wellFormed",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("projectId")
        ctx.Export("projectName")
        ctx.Export("projectUrl")
        ctx.Export("state")
        return nil
    })
}
import pulumi
import pulumi_azuredevops as azuredevops

test = azuredevops.Core.get_projects(project_name="contoso",
    state="wellFormed")
pulumi.export("projectId", [__item["project_id"] for __item in test.projects])
pulumi.export("projectName", [__item["name"] for __item in test.projects])
pulumi.export("projectUrl", [__item["projectUrl"] for __item in test.projects])
pulumi.export("state", [__item["state"] for __item in test.projects])
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const test = azuredevops.Core.getProjects({
    projectName: "contoso",
    state: "wellFormed",
});
export const projectId = test.then(test => test.projects.map(__item => __item.projectId));
export const projectName = test.then(test => test.projects.map(__item => __item.name));
export const projectUrl = test.then(test => test.projects.map(__item => __item.projectUrl));
export const state = test.then(test => test.projects.map(__item => __item.state));

Using GetProjects

function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
function  get_projects(project_name=None, state=None, opts=None)
func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
public static class GetProjects {
    public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ProjectName string
State string
ProjectName string
State string
projectName string
state string
project_name str
state str

GetProjects Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Projects List<Pulumi.AzureDevOps.Core.Outputs.GetProjectsProject>
ProjectName string
State string
Id string

The provider-assigned unique ID for this managed resource.

Projects []GetProjectsProject
ProjectName string
State string
id string

The provider-assigned unique ID for this managed resource.

projects GetProjectsProject[]
projectName string
state string
id str

The provider-assigned unique ID for this managed resource.

projects List[GetProjectsProject]
project_name str
state str

Supporting Types

GetProjectsProject

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Name string
ProjectId string
ProjectUrl string
State string
Name string
ProjectId string
ProjectUrl string
State string
name string
projectId string
projectUrl string
state string
name str
projectUrl str
project_id str
state 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.