1. Packages
  2. Azure Classic
  3. API Docs
  4. core
  5. getClientConfig

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 configuration of the AzureRM provider.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var current = Output.Create(Azure.Core.GetClientConfig.InvokeAsync());
            this.AccountId = current.Apply(current => current.ClientId);
        }
    
        [Output("accountId")]
        public Output<string> AccountId { get; set; }
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		current, err := core.GetClientConfig(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("accountId", current.ClientId)
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const current = azure.core.getClientConfig({});
    export const accountId = current.then(current => current.clientId);
    
    import pulumi
    import pulumi_azure as azure
    
    current = azure.core.get_client_config()
    pulumi.export("accountId", current.client_id)
    

    Example coming soon!

    Using getClientConfig

    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 getClientConfig(opts?: InvokeOptions): Promise<GetClientConfigResult>
    function getClientConfigOutput(opts?: InvokeOptions): Output<GetClientConfigResult>
    def get_client_config(opts: Optional[InvokeOptions] = None) -> GetClientConfigResult
    def get_client_config_output(opts: Optional[InvokeOptions] = None) -> Output[GetClientConfigResult]
    func GetClientConfig(ctx *Context, opts ...InvokeOption) (*GetClientConfigResult, error)
    func GetClientConfigOutput(ctx *Context, opts ...InvokeOption) GetClientConfigResultOutput

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

    public static class GetClientConfig 
    {
        public static Task<GetClientConfigResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetClientConfigResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetClientConfigResult> getClientConfig(InvokeOptions options)
    public static Output<GetClientConfigResult> getClientConfig(InvokeOptions options)
    
    fn::invoke:
      function: azure:core/getClientConfig:getClientConfig
      arguments:
        # arguments dictionary

    getClientConfig Result

    The following output properties are available:

    ClientId string
    Id string
    The provider-assigned unique ID for this managed resource.
    ObjectId string
    SubscriptionId string
    TenantId string
    ClientId string
    Id string
    The provider-assigned unique ID for this managed resource.
    ObjectId string
    SubscriptionId string
    TenantId string
    clientId String
    id String
    The provider-assigned unique ID for this managed resource.
    objectId String
    subscriptionId String
    tenantId String
    clientId string
    id string
    The provider-assigned unique ID for this managed resource.
    objectId string
    subscriptionId string
    tenantId string
    client_id str
    id str
    The provider-assigned unique ID for this managed resource.
    object_id str
    subscription_id str
    tenant_id str
    clientId String
    id String
    The provider-assigned unique ID for this managed resource.
    objectId String
    subscriptionId String
    tenantId 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.