We recommend using Azure Native.
published on Wednesday, Sep 2, 2026 by Pulumi
We recommend using Azure Native.
published on Wednesday, Sep 2, 2026 by Pulumi
Manages a Cognitive Services (Microsoft Foundry) Account Connection with API Key authentication.
Note: In the new Foundry portal experience, “Account Connections” are shown as “Tools” under the “Build” menu.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAccount = new azure.cognitive.Account("example", {
name: "example-aiservices",
location: example.location,
resourceGroupName: example.name,
kind: "AIServices",
skuName: "S0",
projectManagementEnabled: true,
customSubdomainName: "exampleaiservices",
identity: {
type: "SystemAssigned",
},
});
const openai = new azure.cognitive.Account("openai", {
name: "example-openai",
location: example.location,
resourceGroupName: example.name,
kind: "OpenAI",
skuName: "S0",
identity: {
type: "SystemAssigned",
},
});
const exampleAccountConnectionApiKey = new azure.cognitive.AccountConnectionApiKey("example", {
name: "example-connection",
cognitiveAccountId: exampleAccount.id,
category: "AzureOpenAI",
target: openai.endpoint,
apiKey: openai.primaryAccessKey,
metadata: {
ApiType: "Azure",
ResourceId: openai.id,
Location: openai.location,
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.cognitive.Account("example",
name="example-aiservices",
location=example.location,
resource_group_name=example.name,
kind="AIServices",
sku_name="S0",
project_management_enabled=True,
custom_subdomain_name="exampleaiservices",
identity={
"type": "SystemAssigned",
})
openai = azure.cognitive.Account("openai",
name="example-openai",
location=example.location,
resource_group_name=example.name,
kind="OpenAI",
sku_name="S0",
identity={
"type": "SystemAssigned",
})
example_account_connection_api_key = azure.cognitive.AccountConnectionApiKey("example",
name="example-connection",
cognitive_account_id=example_account.id,
category="AzureOpenAI",
target=openai.endpoint,
api_key=openai.primary_access_key,
metadata={
"ApiType": "Azure",
"ResourceId": openai.id,
"Location": openai.location,
})
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/cognitive"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := cognitive.NewAccount(ctx, "example", &cognitive.AccountArgs{
Name: pulumi.String("example-aiservices"),
Location: example.Location,
ResourceGroupName: example.Name,
Kind: pulumi.String("AIServices"),
SkuName: pulumi.String("S0"),
ProjectManagementEnabled: pulumi.Bool(true),
CustomSubdomainName: pulumi.String("exampleaiservices"),
Identity: &cognitive.AccountIdentityArgs{
Type: pulumi.String("SystemAssigned"),
},
})
if err != nil {
return err
}
openai, err := cognitive.NewAccount(ctx, "openai", &cognitive.AccountArgs{
Name: pulumi.String("example-openai"),
Location: example.Location,
ResourceGroupName: example.Name,
Kind: pulumi.String("OpenAI"),
SkuName: pulumi.String("S0"),
Identity: &cognitive.AccountIdentityArgs{
Type: pulumi.String("SystemAssigned"),
},
})
if err != nil {
return err
}
_, err = cognitive.NewAccountConnectionApiKey(ctx, "example", &cognitive.AccountConnectionApiKeyArgs{
Name: pulumi.String("example-connection"),
CognitiveAccountId: exampleAccount.ID().ToIDOutput().ToStringOutput(),
Category: pulumi.String("AzureOpenAI"),
Target: openai.Endpoint,
ApiKey: openai.PrimaryAccessKey,
Metadata: pulumi.StringMap{
"ApiType": pulumi.String("Azure"),
"ResourceId": openai.ID().ToIDOutput().ToStringOutput(),
"Location": openai.Location,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleAccount = new Azure.Cognitive.Account("example", new()
{
Name = "example-aiservices",
Location = example.Location,
ResourceGroupName = example.Name,
Kind = "AIServices",
SkuName = "S0",
ProjectManagementEnabled = true,
CustomSubdomainName = "exampleaiservices",
Identity = new Azure.Cognitive.Inputs.AccountIdentityArgs
{
Type = "SystemAssigned",
},
});
var openai = new Azure.Cognitive.Account("openai", new()
{
Name = "example-openai",
Location = example.Location,
ResourceGroupName = example.Name,
Kind = "OpenAI",
SkuName = "S0",
Identity = new Azure.Cognitive.Inputs.AccountIdentityArgs
{
Type = "SystemAssigned",
},
});
var exampleAccountConnectionApiKey = new Azure.Cognitive.AccountConnectionApiKey("example", new()
{
Name = "example-connection",
CognitiveAccountId = exampleAccount.Id,
Category = "AzureOpenAI",
Target = openai.Endpoint,
ApiKey = openai.PrimaryAccessKey,
Metadata =
{
{ "ApiType", "Azure" },
{ "ResourceId", openai.Id },
{ "Location", openai.Location },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.cognitive.Account;
import com.pulumi.azure.cognitive.AccountArgs;
import com.pulumi.azure.cognitive.inputs.AccountIdentityArgs;
import com.pulumi.azure.cognitive.AccountConnectionApiKey;
import com.pulumi.azure.cognitive.AccountConnectionApiKeyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("example-aiservices")
.location(example.location())
.resourceGroupName(example.name())
.kind("AIServices")
.skuName("S0")
.projectManagementEnabled(true)
.customSubdomainName("exampleaiservices")
.identity(AccountIdentityArgs.builder()
.type("SystemAssigned")
.build())
.build());
var openai = new Account("openai", AccountArgs.builder()
.name("example-openai")
.location(example.location())
.resourceGroupName(example.name())
.kind("OpenAI")
.skuName("S0")
.identity(AccountIdentityArgs.builder()
.type("SystemAssigned")
.build())
.build());
var exampleAccountConnectionApiKey = new AccountConnectionApiKey("exampleAccountConnectionApiKey", AccountConnectionApiKeyArgs.builder()
.name("example-connection")
.cognitiveAccountId(exampleAccount.id())
.category("AzureOpenAI")
.target(openai.endpoint())
.apiKey(openai.primaryAccessKey())
.metadata(Map.ofEntries(
Map.entry("ApiType", "Azure"),
Map.entry("ResourceId", openai.id()),
Map.entry("Location", openai.location())
))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:cognitive:Account
name: example
properties:
name: example-aiservices
location: ${example.location}
resourceGroupName: ${example.name}
kind: AIServices
skuName: S0
projectManagementEnabled: true
customSubdomainName: exampleaiservices
identity:
type: SystemAssigned
openai:
type: azure:cognitive:Account
properties:
name: example-openai
location: ${example.location}
resourceGroupName: ${example.name}
kind: OpenAI
skuName: S0
identity:
type: SystemAssigned
exampleAccountConnectionApiKey:
type: azure:cognitive:AccountConnectionApiKey
name: example
properties:
name: example-connection
cognitiveAccountId: ${exampleAccount.id}
category: AzureOpenAI
target: ${openai.endpoint}
apiKey: ${openai.primaryAccessKey}
metadata:
ApiType: Azure
ResourceId: ${openai.id}
Location: ${openai.location}
pulumi {
required_providers {
azure = {
source = "pulumi/azure"
}
}
}
resource "azure_core_resourcegroup" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azure_cognitive_account" "example" {
name = "example-aiservices"
location = azure_core_resourcegroup.example.location
resource_group_name = azure_core_resourcegroup.example.name
kind = "AIServices"
sku_name = "S0"
project_management_enabled = true
custom_subdomain_name = "exampleaiservices"
identity = {
type = "SystemAssigned"
}
}
resource "azure_cognitive_account" "openai" {
name = "example-openai"
location = azure_core_resourcegroup.example.location
resource_group_name = azure_core_resourcegroup.example.name
kind = "OpenAI"
sku_name = "S0"
identity = {
type = "SystemAssigned"
}
}
resource "azure_cognitive_accountconnectionapikey" "example" {
name = "example-connection"
cognitive_account_id = azure_cognitive_account.example.id
category = "AzureOpenAI"
target = azure_cognitive_account.openai.endpoint
api_key = azure_cognitive_account.openai.primary_access_key
metadata = {
"ApiType" = "Azure"
"ResourceId" = azure_cognitive_account.openai.id
"Location" = azure_cognitive_account.openai.location
}
}
API Providers
This resource uses the following Azure API Providers:
Microsoft.CognitiveServices- 2026-03-01
Create AccountConnectionApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccountConnectionApiKey(name: string, args: AccountConnectionApiKeyArgs, opts?: CustomResourceOptions);@overload
def AccountConnectionApiKey(resource_name: str,
args: AccountConnectionApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AccountConnectionApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_key: Optional[str] = None,
category: Optional[str] = None,
cognitive_account_id: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
target: Optional[str] = None)func NewAccountConnectionApiKey(ctx *Context, name string, args AccountConnectionApiKeyArgs, opts ...ResourceOption) (*AccountConnectionApiKey, error)public AccountConnectionApiKey(string name, AccountConnectionApiKeyArgs args, CustomResourceOptions? opts = null)
public AccountConnectionApiKey(String name, AccountConnectionApiKeyArgs args)
public AccountConnectionApiKey(String name, AccountConnectionApiKeyArgs args, CustomResourceOptions options)
type: azure:cognitive:AccountConnectionApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "azure_cognitive_account_connection_api_key" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args AccountConnectionApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AccountConnectionApiKeyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AccountConnectionApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccountConnectionApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccountConnectionApiKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var accountConnectionApiKeyResource = new Azure.Cognitive.AccountConnectionApiKey("accountConnectionApiKeyResource", new()
{
ApiKey = "string",
Category = "string",
CognitiveAccountId = "string",
Metadata =
{
{ "string", "string" },
},
Name = "string",
Target = "string",
});
example, err := cognitive.NewAccountConnectionApiKey(ctx, "accountConnectionApiKeyResource", &cognitive.AccountConnectionApiKeyArgs{
ApiKey: pulumi.String("string"),
Category: pulumi.String("string"),
CognitiveAccountId: pulumi.String("string"),
Metadata: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Target: pulumi.String("string"),
})
resource "azure_cognitive_account_connection_api_key" "accountConnectionApiKeyResource" {
lifecycle {
create_before_destroy = true
}
api_key = "string"
category = "string"
cognitive_account_id = "string"
metadata = {
"string" = "string"
}
name = "string"
target = "string"
}
var accountConnectionApiKeyResource = new AccountConnectionApiKey("accountConnectionApiKeyResource", AccountConnectionApiKeyArgs.builder()
.apiKey("string")
.category("string")
.cognitiveAccountId("string")
.metadata(Map.of("string", "string"))
.name("string")
.target("string")
.build());
account_connection_api_key_resource = azure.cognitive.AccountConnectionApiKey("accountConnectionApiKeyResource",
api_key="string",
category="string",
cognitive_account_id="string",
metadata={
"string": "string",
},
name="string",
target="string")
const accountConnectionApiKeyResource = new azure.cognitive.AccountConnectionApiKey("accountConnectionApiKeyResource", {
apiKey: "string",
category: "string",
cognitiveAccountId: "string",
metadata: {
string: "string",
},
name: "string",
target: "string",
});
type: azure:cognitive:AccountConnectionApiKey
properties:
apiKey: string
category: string
cognitiveAccountId: string
metadata:
string: string
name: string
target: string
AccountConnectionApiKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AccountConnectionApiKey resource accepts the following input properties:
- Api
Key string - The API key for authentication. This field is sensitive.
- Category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - Cognitive
Account stringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- Metadata Dictionary<string, string>
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- Name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- Target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- Api
Key string - The API key for authentication. This field is sensitive.
- Category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - Cognitive
Account stringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- Metadata map[string]string
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- Name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- Target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api_
key string - The API key for authentication. This field is sensitive.
- category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive_
account_ stringid - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata map(string)
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api
Key String - The API key for authentication. This field is sensitive.
- category String
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive
Account StringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata Map<String,String>
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name String
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target String
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api
Key string - The API key for authentication. This field is sensitive.
- category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive
Account stringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata {[key: string]: string}
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api_
key str - The API key for authentication. This field is sensitive.
- category str
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive_
account_ strid - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata Mapping[str, str]
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name str
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target str
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api
Key String - The API key for authentication. This field is sensitive.
- category String
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive
Account StringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata Map<String>
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name String
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target String
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccountConnectionApiKey resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AccountConnectionApiKey Resource
Get an existing AccountConnectionApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AccountConnectionApiKeyState, opts?: CustomResourceOptions): AccountConnectionApiKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_key: Optional[str] = None,
category: Optional[str] = None,
cognitive_account_id: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
target: Optional[str] = None) -> AccountConnectionApiKeyfunc GetAccountConnectionApiKey(ctx *Context, name string, id IDInput, state *AccountConnectionApiKeyState, opts ...ResourceOption) (*AccountConnectionApiKey, error)public static AccountConnectionApiKey Get(string name, Input<string> id, AccountConnectionApiKeyState? state, CustomResourceOptions? opts = null)public static AccountConnectionApiKey get(String name, Output<String> id, AccountConnectionApiKeyState state, CustomResourceOptions options)resources: _: type: azure:cognitive:AccountConnectionApiKey get: id: ${id}import {
to = azure_cognitive_account_connection_api_key.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Key string - The API key for authentication. This field is sensitive.
- Category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - Cognitive
Account stringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- Metadata Dictionary<string, string>
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- Name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- Target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- Api
Key string - The API key for authentication. This field is sensitive.
- Category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - Cognitive
Account stringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- Metadata map[string]string
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- Name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- Target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api_
key string - The API key for authentication. This field is sensitive.
- category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive_
account_ stringid - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata map(string)
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api
Key String - The API key for authentication. This field is sensitive.
- category String
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive
Account StringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata Map<String,String>
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name String
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target String
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api
Key string - The API key for authentication. This field is sensitive.
- category string
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive
Account stringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata {[key: string]: string}
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name string
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target string
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api_
key str - The API key for authentication. This field is sensitive.
- category str
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive_
account_ strid - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata Mapping[str, str]
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name str
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target str
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
- api
Key String - The API key for authentication. This field is sensitive.
- category String
- The category of the connection. Possible values are
AIServices,ApiKey,ApiManagement,AppConfig,AppInsights,AzureOpenAI,BingLLMSearch,CognitiveSearch,CognitiveService,GroundingWithBingSearch,GroundingWithCustomSearch,ModelGateway,OpenAI,Pinecone,Serp, andServerless. Changing this forces a new resource to be created. - cognitive
Account StringId - The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
- metadata Map<String>
A mapping of metadata key-value pairs for the connection.
Note: The
metadatamap must includeResourceIdwhencategoryisAIServices,ApiTypewhencategoryisAzureOpenAI,LocationwhencategoryisBingLLMSearch, andKindwhencategoryisCognitiveService. To check any additional metadata returned by Azure, create an equivalent connection in the Foundry portal and inspect it withaz rest --method get --url "{connection_resource_id}?api-version=2026-03-01".- name String
- The name of the Cognitive Services Account Connection. Changing this forces a new resource to be created.
- target String
The target endpoint or resource for the connection.
Note:
targetmust be specified unlesscategoryis set toOpenAI,Pinecone, orSerp.
Import
A Cognitive Services (Microsoft Foundry) Account Connection with API Key authentication can be imported using the resource id, e.g.
$ pulumi import azure:cognitive/accountConnectionApiKey:AccountConnectionApiKey example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.CognitiveServices/accounts/account1/connections/connection1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Wednesday, Sep 2, 2026 by Pulumi