1. Packages
  2. Azure Classic
  3. API Docs
  4. connections
  5. getApiConnection

We recommend using Azure Native.

Azure v6.25.0 published on Wednesday, Aug 13, 2025 by Pulumi

azure.connections.getApiConnection

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.25.0 published on Wednesday, Aug 13, 2025 by Pulumi

    Use this data source to access information about an existing API Connection.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.connections.getApiConnection({
        name: "example-connection",
        resourceGroupName: "example-resources",
    });
    export const connectionId = example.then(example => example.id);
    export const connectionName = example.then(example => example.name);
    export const managedApiId = example.then(example => example.managedApiId);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.connections.get_api_connection(name="example-connection",
        resource_group_name="example-resources")
    pulumi.export("connectionId", example.id)
    pulumi.export("connectionName", example.name)
    pulumi.export("managedApiId", example.managed_api_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/connections"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := connections.LookupApiConnection(ctx, &connections.LookupApiConnectionArgs{
    			Name:              "example-connection",
    			ResourceGroupName: "example-resources",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("connectionId", example.Id)
    		ctx.Export("connectionName", example.Name)
    		ctx.Export("managedApiId", example.ManagedApiId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.Connections.GetApiConnection.Invoke(new()
        {
            Name = "example-connection",
            ResourceGroupName = "example-resources",
        });
    
        return new Dictionary<string, object?>
        {
            ["connectionId"] = example.Apply(getApiConnectionResult => getApiConnectionResult.Id),
            ["connectionName"] = example.Apply(getApiConnectionResult => getApiConnectionResult.Name),
            ["managedApiId"] = example.Apply(getApiConnectionResult => getApiConnectionResult.ManagedApiId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.connections.ConnectionsFunctions;
    import com.pulumi.azure.connections.inputs.GetApiConnectionArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            final var example = ConnectionsFunctions.getApiConnection(GetApiConnectionArgs.builder()
                .name("example-connection")
                .resourceGroupName("example-resources")
                .build());
    
            ctx.export("connectionId", example.id());
            ctx.export("connectionName", example.name());
            ctx.export("managedApiId", example.managedApiId());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: azure:connections:getApiConnection
          arguments:
            name: example-connection
            resourceGroupName: example-resources
    outputs:
      connectionId: ${example.id}
      connectionName: ${example.name}
      managedApiId: ${example.managedApiId}
    

    API Providers

    This data source uses the following Azure API Providers:

    • Microsoft.Web - 2016-06-01

    Using getApiConnection

    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 getApiConnection(args: GetApiConnectionArgs, opts?: InvokeOptions): Promise<GetApiConnectionResult>
    function getApiConnectionOutput(args: GetApiConnectionOutputArgs, opts?: InvokeOptions): Output<GetApiConnectionResult>
    def get_api_connection(name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetApiConnectionResult
    def get_api_connection_output(name: Optional[pulumi.Input[str]] = None,
                           resource_group_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetApiConnectionResult]
    func LookupApiConnection(ctx *Context, args *LookupApiConnectionArgs, opts ...InvokeOption) (*LookupApiConnectionResult, error)
    func LookupApiConnectionOutput(ctx *Context, args *LookupApiConnectionOutputArgs, opts ...InvokeOption) LookupApiConnectionResultOutput

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

    public static class GetApiConnection 
    {
        public static Task<GetApiConnectionResult> InvokeAsync(GetApiConnectionArgs args, InvokeOptions? opts = null)
        public static Output<GetApiConnectionResult> Invoke(GetApiConnectionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetApiConnectionResult> getApiConnection(GetApiConnectionArgs args, InvokeOptions options)
    public static Output<GetApiConnectionResult> getApiConnection(GetApiConnectionArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:connections/getApiConnection:getApiConnection
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the API Connection.
    ResourceGroupName string
    The name of the Resource Group where the API Connection exists.
    Name string
    The name of the API Connection.
    ResourceGroupName string
    The name of the Resource Group where the API Connection exists.
    name String
    The name of the API Connection.
    resourceGroupName String
    The name of the Resource Group where the API Connection exists.
    name string
    The name of the API Connection.
    resourceGroupName string
    The name of the Resource Group where the API Connection exists.
    name str
    The name of the API Connection.
    resource_group_name str
    The name of the Resource Group where the API Connection exists.
    name String
    The name of the API Connection.
    resourceGroupName String
    The name of the Resource Group where the API Connection exists.

    getApiConnection Result

    The following output properties are available:

    DisplayName string
    The display name of the API Connection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure Region where the API Connection exists.
    ManagedApiId string
    The ID of the Managed API that this connection is linked to.
    Name string
    ParameterValues Dictionary<string, string>
    A mapping of parameter names to their values for the API Connection.
    ResourceGroupName string
    Tags Dictionary<string, string>
    A mapping of tags assigned to the API Connection.
    DisplayName string
    The display name of the API Connection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The Azure Region where the API Connection exists.
    ManagedApiId string
    The ID of the Managed API that this connection is linked to.
    Name string
    ParameterValues map[string]string
    A mapping of parameter names to their values for the API Connection.
    ResourceGroupName string
    Tags map[string]string
    A mapping of tags assigned to the API Connection.
    displayName String
    The display name of the API Connection.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure Region where the API Connection exists.
    managedApiId String
    The ID of the Managed API that this connection is linked to.
    name String
    parameterValues Map<String,String>
    A mapping of parameter names to their values for the API Connection.
    resourceGroupName String
    tags Map<String,String>
    A mapping of tags assigned to the API Connection.
    displayName string
    The display name of the API Connection.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    The Azure Region where the API Connection exists.
    managedApiId string
    The ID of the Managed API that this connection is linked to.
    name string
    parameterValues {[key: string]: string}
    A mapping of parameter names to their values for the API Connection.
    resourceGroupName string
    tags {[key: string]: string}
    A mapping of tags assigned to the API Connection.
    display_name str
    The display name of the API Connection.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    The Azure Region where the API Connection exists.
    managed_api_id str
    The ID of the Managed API that this connection is linked to.
    name str
    parameter_values Mapping[str, str]
    A mapping of parameter names to their values for the API Connection.
    resource_group_name str
    tags Mapping[str, str]
    A mapping of tags assigned to the API Connection.
    displayName String
    The display name of the API Connection.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The Azure Region where the API Connection exists.
    managedApiId String
    The ID of the Managed API that this connection is linked to.
    name String
    parameterValues Map<String>
    A mapping of parameter names to their values for the API Connection.
    resourceGroupName String
    tags Map<String>
    A mapping of tags assigned to the API Connection.

    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.

    Azure v6.25.0 published on Wednesday, Aug 13, 2025 by Pulumi