1. Packages
  2. Packages
  3. Azure DevOps Provider
  4. API Docs
  5. getEnvironment
Viewing docs for Azure DevOps v2.15.1 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azuredevops logo
Viewing docs for Azure DevOps v2.15.1 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to access information about an Environment.

    Using getEnvironment

    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 getEnvironment(args: GetEnvironmentArgs, opts?: InvokeOptions): Promise<GetEnvironmentResult>
    function getEnvironmentOutput(args: GetEnvironmentOutputArgs, opts?: InvokeOptions): Output<GetEnvironmentResult>
    def get_environment(environment_id: Optional[int] = None,
                        name: Optional[str] = None,
                        project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetEnvironmentResult
    def get_environment_output(environment_id: Optional[pulumi.Input[int]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        project_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentResult]
    func LookupEnvironment(ctx *Context, args *LookupEnvironmentArgs, opts ...InvokeOption) (*LookupEnvironmentResult, error)
    func LookupEnvironmentOutput(ctx *Context, args *LookupEnvironmentOutputArgs, opts ...InvokeOption) LookupEnvironmentResultOutput

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

    public static class GetEnvironment 
    {
        public static Task<GetEnvironmentResult> InvokeAsync(GetEnvironmentArgs args, InvokeOptions? opts = null)
        public static Output<GetEnvironmentResult> Invoke(GetEnvironmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnvironmentResult> getEnvironment(GetEnvironmentArgs args, InvokeOptions options)
    public static Output<GetEnvironmentResult> getEnvironment(GetEnvironmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azuredevops:index/getEnvironment:getEnvironment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    The ID of the project.
    EnvironmentId int
    The ID of the Environment.
    Name string

    Name of the Environment.

    NOTE: One of either environment_id or name must be specified.

    ProjectId string
    The ID of the project.
    EnvironmentId int
    The ID of the Environment.
    Name string

    Name of the Environment.

    NOTE: One of either environment_id or name must be specified.

    projectId String
    The ID of the project.
    environmentId Integer
    The ID of the Environment.
    name String

    Name of the Environment.

    NOTE: One of either environment_id or name must be specified.

    projectId string
    The ID of the project.
    environmentId number
    The ID of the Environment.
    name string

    Name of the Environment.

    NOTE: One of either environment_id or name must be specified.

    project_id str
    The ID of the project.
    environment_id int
    The ID of the Environment.
    name str

    Name of the Environment.

    NOTE: One of either environment_id or name must be specified.

    projectId String
    The ID of the project.
    environmentId Number
    The ID of the Environment.
    name String

    Name of the Environment.

    NOTE: One of either environment_id or name must be specified.

    getEnvironment Result

    The following output properties are available:

    Description string
    A description for the Environment.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the Environment.
    ProjectId string
    EnvironmentId int
    Description string
    A description for the Environment.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the Environment.
    ProjectId string
    EnvironmentId int
    description String
    A description for the Environment.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the Environment.
    projectId String
    environmentId Integer
    description string
    A description for the Environment.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the Environment.
    projectId string
    environmentId number
    description str
    A description for the Environment.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the Environment.
    project_id str
    environment_id int
    description String
    A description for the Environment.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the Environment.
    projectId String
    environmentId Number

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Viewing docs for Azure DevOps v2.15.1 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.