1. Packages
  2. Azure Classic
  3. API Docs
  4. appconfiguration
  5. getConfigurationKey

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.appconfiguration.getConfigurationKey

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Use this data source to access information about an existing Azure App Configuration Key.

    Note: App Configuration Keys are provisioned using a Data Plane API which requires the role App Configuration Data Owner on either the App Configuration or a parent scope (such as the Resource Group/Subscription). More information can be found in the Azure Documentation for App Configuration.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const test = azure.appconfiguration.getConfigurationKey({
        configurationStoreId: appconf.id,
        key: "appConfKey1",
        label: "somelabel",
    });
    export const value = test.then(test => test.value);
    
    import pulumi
    import pulumi_azure as azure
    
    test = azure.appconfiguration.get_configuration_key(configuration_store_id=appconf["id"],
        key="appConfKey1",
        label="somelabel")
    pulumi.export("value", test.value)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appconfiguration"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		test, err := appconfiguration.LookupConfigurationKey(ctx, &appconfiguration.LookupConfigurationKeyArgs{
    			ConfigurationStoreId: appconf.Id,
    			Key:                  "appConfKey1",
    			Label:                pulumi.StringRef("somelabel"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("value", test.Value)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Azure.AppConfiguration.GetConfigurationKey.Invoke(new()
        {
            ConfigurationStoreId = appconf.Id,
            Key = "appConfKey1",
            Label = "somelabel",
        });
    
        return new Dictionary<string, object?>
        {
            ["value"] = test.Apply(getConfigurationKeyResult => getConfigurationKeyResult.Value),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.appconfiguration.AppconfigurationFunctions;
    import com.pulumi.azure.appconfiguration.inputs.GetConfigurationKeyArgs;
    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 test = AppconfigurationFunctions.getConfigurationKey(GetConfigurationKeyArgs.builder()
                .configurationStoreId(appconf.id())
                .key("appConfKey1")
                .label("somelabel")
                .build());
    
            ctx.export("value", test.applyValue(getConfigurationKeyResult -> getConfigurationKeyResult.value()));
        }
    }
    
    variables:
      test:
        fn::invoke:
          Function: azure:appconfiguration:getConfigurationKey
          Arguments:
            configurationStoreId: ${appconf.id}
            key: appConfKey1
            label: somelabel
    outputs:
      value: ${test.value}
    

    Using getConfigurationKey

    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 getConfigurationKey(args: GetConfigurationKeyArgs, opts?: InvokeOptions): Promise<GetConfigurationKeyResult>
    function getConfigurationKeyOutput(args: GetConfigurationKeyOutputArgs, opts?: InvokeOptions): Output<GetConfigurationKeyResult>
    def get_configuration_key(configuration_store_id: Optional[str] = None,
                              key: Optional[str] = None,
                              label: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetConfigurationKeyResult
    def get_configuration_key_output(configuration_store_id: Optional[pulumi.Input[str]] = None,
                              key: Optional[pulumi.Input[str]] = None,
                              label: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetConfigurationKeyResult]
    func LookupConfigurationKey(ctx *Context, args *LookupConfigurationKeyArgs, opts ...InvokeOption) (*LookupConfigurationKeyResult, error)
    func LookupConfigurationKeyOutput(ctx *Context, args *LookupConfigurationKeyOutputArgs, opts ...InvokeOption) LookupConfigurationKeyResultOutput

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

    public static class GetConfigurationKey 
    {
        public static Task<GetConfigurationKeyResult> InvokeAsync(GetConfigurationKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetConfigurationKeyResult> Invoke(GetConfigurationKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetConfigurationKeyResult> getConfigurationKey(GetConfigurationKeyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:appconfiguration/getConfigurationKey:getConfigurationKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ConfigurationStoreId string
    Specifies the id of the App Configuration.
    Key string
    The name of the App Configuration Key.
    Label string
    The label of the App Configuration Key.
    ConfigurationStoreId string
    Specifies the id of the App Configuration.
    Key string
    The name of the App Configuration Key.
    Label string
    The label of the App Configuration Key.
    configurationStoreId String
    Specifies the id of the App Configuration.
    key String
    The name of the App Configuration Key.
    label String
    The label of the App Configuration Key.
    configurationStoreId string
    Specifies the id of the App Configuration.
    key string
    The name of the App Configuration Key.
    label string
    The label of the App Configuration Key.
    configuration_store_id str
    Specifies the id of the App Configuration.
    key str
    The name of the App Configuration Key.
    label str
    The label of the App Configuration Key.
    configurationStoreId String
    Specifies the id of the App Configuration.
    key String
    The name of the App Configuration Key.
    label String
    The label of the App Configuration Key.

    getConfigurationKey Result

    The following output properties are available:

    ConfigurationStoreId string
    ContentType string
    The content type of the App Configuration Key.
    Etag string
    The ETag of the key.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    Locked bool
    Is this App Configuration Key be Locked to prevent changes.
    Tags Dictionary<string, string>
    A mapping of tags assigned to the resource.
    Type string
    The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.
    Value string
    The value of the App Configuration Key.
    VaultKeyReference string
    The ID of the vault secret this App Configuration Key refers to, when type is vault.
    Label string
    ConfigurationStoreId string
    ContentType string
    The content type of the App Configuration Key.
    Etag string
    The ETag of the key.
    Id string
    The provider-assigned unique ID for this managed resource.
    Key string
    Locked bool
    Is this App Configuration Key be Locked to prevent changes.
    Tags map[string]string
    A mapping of tags assigned to the resource.
    Type string
    The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.
    Value string
    The value of the App Configuration Key.
    VaultKeyReference string
    The ID of the vault secret this App Configuration Key refers to, when type is vault.
    Label string
    configurationStoreId String
    contentType String
    The content type of the App Configuration Key.
    etag String
    The ETag of the key.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    locked Boolean
    Is this App Configuration Key be Locked to prevent changes.
    tags Map<String,String>
    A mapping of tags assigned to the resource.
    type String
    The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.
    value String
    The value of the App Configuration Key.
    vaultKeyReference String
    The ID of the vault secret this App Configuration Key refers to, when type is vault.
    label String
    configurationStoreId string
    contentType string
    The content type of the App Configuration Key.
    etag string
    The ETag of the key.
    id string
    The provider-assigned unique ID for this managed resource.
    key string
    locked boolean
    Is this App Configuration Key be Locked to prevent changes.
    tags {[key: string]: string}
    A mapping of tags assigned to the resource.
    type string
    The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.
    value string
    The value of the App Configuration Key.
    vaultKeyReference string
    The ID of the vault secret this App Configuration Key refers to, when type is vault.
    label string
    configuration_store_id str
    content_type str
    The content type of the App Configuration Key.
    etag str
    The ETag of the key.
    id str
    The provider-assigned unique ID for this managed resource.
    key str
    locked bool
    Is this App Configuration Key be Locked to prevent changes.
    tags Mapping[str, str]
    A mapping of tags assigned to the resource.
    type str
    The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.
    value str
    The value of the App Configuration Key.
    vault_key_reference str
    The ID of the vault secret this App Configuration Key refers to, when type is vault.
    label str
    configurationStoreId String
    contentType String
    The content type of the App Configuration Key.
    etag String
    The ETag of the key.
    id String
    The provider-assigned unique ID for this managed resource.
    key String
    locked Boolean
    Is this App Configuration Key be Locked to prevent changes.
    tags Map<String>
    A mapping of tags assigned to the resource.
    type String
    The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.
    value String
    The value of the App Configuration Key.
    vaultKeyReference String
    The ID of the vault secret this App Configuration Key refers to, when type is vault.
    label 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.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi