1. Registry
  2. Packages
  3. Azure DevOps Provider
  4. API Docs
  5. getAgentQueue
Viewing docs for Azure DevOps v3.16.0
published on Friday, Jul 17, 2026 by Pulumi
azuredevops logo azuredevops logo
Viewing docs for Azure DevOps v3.16.0
published on Friday, Jul 17, 2026 by Pulumi

    Use this data source to access information about an existing Agent Queue within Azure DevOps.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const exampleProject = new azuredevops.Project("example", {
        name: "Example Project",
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Pulumi",
    });
    const example = azuredevops.getAgentQueueOutput({
        projectId: exampleProject.id,
        name: "Example Agent Queue",
    });
    export const name = example.apply(example => example.name);
    export const poolId = example.apply(example => example.agentPoolId);
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example_project = azuredevops.Project("example",
        name="Example Project",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Pulumi")
    example = azuredevops.get_agent_queue_output(project_id=example_project.id,
        name="Example Agent Queue")
    pulumi.export("name", example.name)
    pulumi.export("poolId", example.agent_pool_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleProject, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Pulumi"),
    		})
    		if err != nil {
    			return err
    		}
    		example := azuredevops.GetAgentQueueOutput(ctx, azuredevops.GetAgentQueueOutputArgs{
    			ProjectId: exampleProject.ID(),
    			Name:      pulumi.String("Example Agent Queue"),
    		}, nil)
    		ctx.Export("name", example.ApplyT(func(example azuredevops.GetAgentQueueResult) (*string, error) {
    			return example.Name, nil
    		}).(pulumi.StringPtrOutput))
    		ctx.Export("poolId", example.ApplyT(func(example azuredevops.GetAgentQueueResult) (*int, error) {
    			return example.AgentPoolId, nil
    		}).(pulumi.IntPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Pulumi",
        });
    
        var example = AzureDevOps.GetAgentQueue.Invoke(new()
        {
            ProjectId = exampleProject.Id,
            Name = "Example Agent Queue",
        });
    
        return new Dictionary<string, object?>
        {
            ["name"] = example.Apply(getAgentQueueResult => getAgentQueueResult.Name),
            ["poolId"] = example.Apply(getAgentQueueResult => getAgentQueueResult.AgentPoolId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.AzuredevopsFunctions;
    import com.pulumi.azuredevops.inputs.GetAgentQueueArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            var exampleProject = new Project("exampleProject", ProjectArgs.builder()
                .name("Example Project")
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Pulumi")
                .build());
    
            final var example = AzuredevopsFunctions.getAgentQueue(GetAgentQueueArgs.builder()
                .projectId(exampleProject.id())
                .name("Example Agent Queue")
                .build());
    
            ctx.export("name", example.applyValue(_example -> _example.name()));
            ctx.export("poolId", example.applyValue(_example -> _example.agentPoolId()));
        }
    }
    
    resources:
      exampleProject:
        type: azuredevops:Project
        name: example
        properties:
          name: Example Project
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Pulumi
    variables:
      example:
        fn::invoke:
          function: azuredevops:getAgentQueue
          arguments:
            projectId: ${exampleProject.id}
            name: Example Agent Queue
    outputs:
      name: ${example.name}
      poolId: ${example.agentPoolId}
    
    pulumi {
      required_providers {
        azuredevops = {
          source = "pulumi/azuredevops"
        }
      }
    }
    
    data "azuredevops_getagentqueue" "example" {
      project_id = azuredevops_project.example.id
      name       = "Example Agent Queue"
    }
    
    resource "azuredevops_project" "example" {
      name               = "Example Project"
      work_item_template = "Agile"
      version_control    = "Git"
      visibility         = "private"
      description        = "Managed by Pulumi"
    }
    output "name" {
      value = data.azuredevops_getagentqueue.example.name
    }
    output "poolId" {
      value = data.azuredevops_getagentqueue.example.agent_pool_id
    }
    

    Using getAgentQueue

    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 getAgentQueue(args: GetAgentQueueArgs, opts?: InvokeOptions): Promise<GetAgentQueueResult>
    function getAgentQueueOutput(args: GetAgentQueueOutputArgs, opts?: InvokeOutputOptions): Output<GetAgentQueueResult>
    def get_agent_queue(name: Optional[str] = None,
                        project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetAgentQueueResult
    def get_agent_queue_output(name: pulumi.Input[Optional[str]] = None,
                        project_id: pulumi.Input[Optional[str]] = None,
                        opts: Optional[InvokeOutputOptions] = None) -> Output[GetAgentQueueResult]
    func GetAgentQueue(ctx *Context, args *GetAgentQueueArgs, opts ...InvokeOption) (*GetAgentQueueResult, error)
    func GetAgentQueueOutput(ctx *Context, args *GetAgentQueueOutputArgs, opts ...InvokeOption) GetAgentQueueResultOutput

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

    public static class GetAgentQueue 
    {
        public static Task<GetAgentQueueResult> InvokeAsync(GetAgentQueueArgs args, InvokeOptions? opts = null)
        public static Output<GetAgentQueueResult> Invoke(GetAgentQueueInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetAgentQueueResult> Invoke(GetAgentQueueInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetAgentQueueResult> getAgentQueue(GetAgentQueueArgs args, InvokeOptions options)
    public static Output<GetAgentQueueResult> getAgentQueue(GetAgentQueueArgs args, InvokeOptions options)
    public static Output<GetAgentQueueResult> getAgentQueue(GetAgentQueueArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: azuredevops:index/getAgentQueue:getAgentQueue
      arguments:
        # arguments dictionary
    data "azuredevops_get_agent_queue" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    Name of the Agent Queue.
    ProjectId string
    The Project Id.
    Name string
    Name of the Agent Queue.
    ProjectId string
    The Project Id.
    name string
    Name of the Agent Queue.
    project_id string
    The Project Id.
    name String
    Name of the Agent Queue.
    projectId String
    The Project Id.
    name string
    Name of the Agent Queue.
    projectId string
    The Project Id.
    name str
    Name of the Agent Queue.
    project_id str
    The Project Id.
    name String
    Name of the Agent Queue.
    projectId String
    The Project Id.

    getAgentQueue Result

    The following output properties are available:

    AgentPoolId int
    The ID of the Agent pool to which the agent queue belongs.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the agent queue.
    ProjectId string
    The ID of the Project to which the agent queue belongs.
    AgentPoolId int
    The ID of the Agent pool to which the agent queue belongs.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the agent queue.
    ProjectId string
    The ID of the Project to which the agent queue belongs.
    agent_pool_id number
    The ID of the Agent pool to which the agent queue belongs.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the agent queue.
    project_id string
    The ID of the Project to which the agent queue belongs.
    agentPoolId Integer
    The ID of the Agent pool to which the agent queue belongs.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the agent queue.
    projectId String
    The ID of the Project to which the agent queue belongs.
    agentPoolId number
    The ID of the Agent pool to which the agent queue belongs.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the agent queue.
    projectId string
    The ID of the Project to which the agent queue belongs.
    agent_pool_id int
    The ID of the Agent pool to which the agent queue belongs.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the agent queue.
    project_id str
    The ID of the Project to which the agent queue belongs.
    agentPoolId Number
    The ID of the Agent pool to which the agent queue belongs.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the agent queue.
    projectId String
    The ID of the Project to which the agent queue belongs.

    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 azuredevops logo
    Viewing docs for Azure DevOps v3.16.0
    published on Friday, Jul 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial