GetProjects
Use this data source to access information about existing Projects within Azure DevOps.
Relevant Links
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:
GetProjects Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Projects
List<Pulumi.
Azure Dev Ops. Core. Outputs. Get Projects Project> - Project
Name string - State string
- Id string
The provider-assigned unique ID for this managed resource.
- Projects
[]Get
Projects Project - Project
Name string - State string
- id string
The provider-assigned unique ID for this managed resource.
- projects
Get
Projects Project[] - project
Name string - state string
- id str
The provider-assigned unique ID for this managed resource.
- projects
List[Get
Projects Project] - 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuredevopsTerraform Provider.