1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. getTrafficManager

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy.

    Example Usage

    World)

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var example = Output.Create(Azure.Network.GetTrafficManager.InvokeAsync(new Azure.Network.GetTrafficManagerArgs
            {
                Name = "World",
            }));
            this.LocationCode = example.Apply(example => example.Id);
        }
    
        [Output("locationCode")]
        public Output<string> LocationCode { get; set; }
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := network.GetTrafficManager(ctx, &network.GetTrafficManagerArgs{
    			Name: "World",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("locationCode", example.Id)
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.network.getTrafficManager({
        name: "World",
    });
    export const locationCode = example.then(example => example.id);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.network.get_traffic_manager(name="World")
    pulumi.export("locationCode", example.id)
    

    Example coming soon!

    Using getTrafficManager

    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 getTrafficManager(args: GetTrafficManagerArgs, opts?: InvokeOptions): Promise<GetTrafficManagerResult>
    function getTrafficManagerOutput(args: GetTrafficManagerOutputArgs, opts?: InvokeOptions): Output<GetTrafficManagerResult>
    def get_traffic_manager(name: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetTrafficManagerResult
    def get_traffic_manager_output(name: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetTrafficManagerResult]
    func GetTrafficManager(ctx *Context, args *GetTrafficManagerArgs, opts ...InvokeOption) (*GetTrafficManagerResult, error)
    func GetTrafficManagerOutput(ctx *Context, args *GetTrafficManagerOutputArgs, opts ...InvokeOption) GetTrafficManagerResultOutput

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

    public static class GetTrafficManager 
    {
        public static Task<GetTrafficManagerResult> InvokeAsync(GetTrafficManagerArgs args, InvokeOptions? opts = null)
        public static Output<GetTrafficManagerResult> Invoke(GetTrafficManagerInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTrafficManagerResult> getTrafficManager(GetTrafficManagerArgs args, InvokeOptions options)
    public static Output<GetTrafficManagerResult> getTrafficManager(GetTrafficManagerArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:network/getTrafficManager:getTrafficManager
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the Location, for example World, Europe or Germany.
    Name string
    Specifies the name of the Location, for example World, Europe or Germany.
    name String
    Specifies the name of the Location, for example World, Europe or Germany.
    name string
    Specifies the name of the Location, for example World, Europe or Germany.
    name str
    Specifies the name of the Location, for example World, Europe or Germany.
    name String
    Specifies the name of the Location, for example World, Europe or Germany.

    getTrafficManager Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    id String
    The provider-assigned unique ID for this managed resource.
    name String

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.