get Account
Use this data source to access information about an existing Cognitive Services Account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const test = azure.cognitive.getAccount({
name: "example-account",
resourceGroupName: "cognitive_account_rg",
});
export const primaryAccessKey = test.then(test => test.primaryAccessKey);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
test = azure.cognitive.get_account(name="example-account",
resource_group_name="cognitive_account_rg")
pulumi.export("primaryAccessKey", test.primary_access_key)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var test = Azure.Cognitive.GetAccount.Invoke(new()
{
Name = "example-account",
ResourceGroupName = "cognitive_account_rg",
});
return new Dictionary<string, object?>
{
["primaryAccessKey"] = test.Apply(getAccountResult => getAccountResult.PrimaryAccessKey),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cognitive"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := cognitive.LookupAccount(ctx, &cognitive.LookupAccountArgs{
Name: "example-account",
ResourceGroupName: "cognitive_account_rg",
}, nil)
if err != nil {
return err
}
ctx.Export("primaryAccessKey", test.PrimaryAccessKey)
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.cognitive.CognitiveFunctions;
import com.pulumi.azure.cognitive.inputs.GetAccountArgs;
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 = CognitiveFunctions.getAccount(GetAccountArgs.builder()
.name("example-account")
.resourceGroupName("cognitive_account_rg")
.build());
ctx.export("primaryAccessKey", test.primaryAccessKey());
}
}
Content copied to clipboard
variables:
test:
fn::invoke:
function: azure:cognitive:getAccount
arguments:
name: example-account
resourceGroupName: cognitive_account_rg
outputs:
primaryAccessKey: ${test.primaryAccessKey}
Content copied to clipboard
API Providers
This data source uses the following Azure API Providers:
Microsoft.CognitiveServices
: 2024-10-01
Return
A collection of values returned by getAccount.
Parameters
argument
A collection of arguments for invoking getAccount.
suspend fun getAccount(name: String, resourceGroupName: String, tags: Map<String, String>? = null): GetAccountResult
Return
A collection of values returned by getAccount.
Parameters
name
Specifies the name of the Cognitive Services Account.
resource Group Name
Specifies the name of the resource group where the Cognitive Services Account resides.
tags
A mapping of tags to assigned to the resource.
See also
Return
A collection of values returned by getAccount.
Parameters
argument
Builder for com.pulumi.azure.cognitive.kotlin.inputs.GetAccountPlainArgs.