Orchard Core AI Connection Management
A connection stores the endpoint and credentials for one provider account. Deployments name a connection
through ConnectionName; profiles name deployments. This skill covers the connection layer only; for
deployments and capabilities see orchardcore-ai and orchardcore-ai-model-capabilities.
Guidelines
- Enable
CrestApps.OrchardCore.AI.ConnectionManagementto get the **Artificial Intelligence > Provider
Connections** screen, the provider connection editors and the AIProviderConnections recipe step. The
step is registered only while this feature is enabled.
- Install each provider package (
CrestApps.OrchardCore.OpenAI,CrestApps.OrchardCore.OpenAI.Azure,
CrestApps.OrchardCore.AzureAIInference, CrestApps.OrchardCore.Ollama) in the web/startup project and
enable its feature.
- API keys are encrypted at rest with ASP.NET Core data protection (protector name
AIProviderConnection).
Data protection keys must be shared across nodes and preserved across deployments, or stored keys cannot
be decrypted.
- Creating, editing or deleting a connection releases the tenant shell so clients pick up the change.
ManageProviderConnections(granted to Administrator) controls the screen.- Connections defined in
appsettings.jsonare listed separately and are read-only. - Never commit API keys. Prefer managed identity on Azure.
Features and providers
| Provider | Feature ID | Source / ClientName | Metadata object in Properties | Authentication |
| --- | --- | --- | --- | --- |
| OpenAI and OpenAI-compatible | CrestApps.OrchardCore.OpenAI | OpenAI | OpenAIConnectionMetadata (Endpoint, ApiKey) | API key |
| Azure OpenAI | CrestApps.OrchardCore.OpenAI.Azure | Azure | AzureConnectionMetadata (Endpoint, AuthenticationType, ApiKey, IdentityId) | Default, ManagedIdentity, ApiKey |
| Azure AI Inference (GitHub Models) | CrestApps.OrchardCore.AzureAIInference | AzureAIInference | AzureAIInferenceConnectionMetadata (same keys as Azure) | Default, ManagedIdentity, ApiKey |
| Ollama | CrestApps.OrchardCore.Ollama | Ollama | none; a plain Endpoint key | none |
| Custom LLM (WebSocket) | CrestApps.OrchardCore.AI.CustomLlm | CustomLlm | none; plain Endpoint (wss://, or https:// used as wss://) and optional ApiKey keys read through GetEndpoint() / GetApiKey() | optional API key, sent as a bearer token |
ElevenLabs, Cartesia and Azure AI Speech deployments carry their own connection (API key and endpoint on the
deployment) and need no provider connection; see orchardcore-ai-providers.
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.AI.ConnectionManagement",
"CrestApps.OrchardCore.OpenAI"
],
"disable": []
}
]
}
Admin UI
Artificial Intelligence > Provider Connections (/Admin/ai/provider/connections) lists stored
connections in Orchard Core's AdminList (list name AIProviderConnections) with search, bulk Delete
and the List or Grid layout. Configuration-backed connections appear below in a read-only list
(AIProviderConnectionsReadOnly) without select, edit or delete. Add Connection asks for the provider
first, then shows that provider's editor. To add a column or row action, use IAdminListColumnsProvider or
a SummaryAdminGrid placement (see orchardcore-admin-lists).
A missing API key on an OpenAI connection is reported under API key (it used to show under Endpoint).
Each deployment that uses the connection can carry its prices on its Pricing card, for estimated costs in
the usage report (see orchardcore-ai-usage-analytics). Editor buttons sit in Orchard Core's sticky bottom
action bar.
Connections by recipe
The step matches an existing connection by ItemId, or by Name plus Source, and creates it otherwise.
{
"steps": [
{
"name": "AIProviderConnections",
"Connections": [
{
"Source": "OpenAI",
"Name": "openai-cloud",
"DisplayText": "OpenAI",
"Properties": {
"OpenAIConnectionMetadata": {
"Endpoint": "https://api.openai.com/v1",
"ApiKey": "{{OpenAIApiKey}}"
}
}
},
{
"Source": "Azure",
"Name": "azure-openai",
"DisplayText": "Azure OpenAI (managed identity)",
"Properties": {
"AzureConnectionMetadata": {
"Endpoint": "https://my-resource.openai.azure.com/",
"AuthenticationType": "ManagedIdentity",
"IdentityId": "optional-user-assigned-client-id"
}
}
},
{
"Source": "AzureAIInference",
"Name": "github-models",
"DisplayText": "GitHub Models",
"Properties": {
"AzureAIInferenceConnectionMetadata": {
"Endpoint": "https://models.inference.ai.azure.com",
"AuthenticationType": "ApiKey",
"ApiKey": "{{GitHubToken}}"
}
}
},
{
"Source": "Ollama",
"Name": "local-ollama",
"DisplayText": "Local Ollama",
"Properties": {
"Endpoint": "http://localhost:11434"
}
}
]
}
]
}
AuthenticationType: "ApiKey"requiresApiKey;ManagedIdentitywithoutIdentityIduses the
system-assigned identity; Default uses the Azure default credential chain.
- For an OpenAI-compatible service (DeepSeek, Gemini, Together AI, vLLM, LM Studio) use
Source: "OpenAI"
with that service's Endpoint.
- An unknown
Sourcestops the step with "Unable to find a connection-source that can handle the source". - Follow the connection with an
AIDeploymentstep that names it inConnectionName.
Connections in appsettings.json
{
"OrchardCore": {
"CrestApps": {
"AI": {
"Connections": [
{
"Name": "azure-openai",
"ClientName": "Azure",
"Endpoint": "https://my-resource.openai.azure.com/",
"AuthenticationType": "ApiKey",
"ApiKey": "<from a secret store>"
},
{
"Name": "local-ollama",
"ClientName": "Ollama",
"Endpoint": "http://localhost:11434"
}
]
}
}
}
}
Configuration connections use flat keys and ClientName. Entries are addressed by index, so
OrchardCore__CrestApps__AI__Connections__0__ApiKey replaces the key of the first entry; use a high index
(for example __90__) to add a connection beside existing ones. The older CrestApps_AI:Providers shape is
still read. Both stored and configured connections appear in deployment editors.
Export connections
The AI Provider Connections deployment step (AIProviderConnectionDeploymentStep) exports all
connections (IncludeAll) or selected ones (ConnectionIds) as an AIProviderConnections recipe step.
API keys are written as empty strings, so re-enter them after import through the admin, a follow-up
recipe, or configuration.
Troubleshooting
| Symptom | Check |
| --- | --- |
| Recipe step AIProviderConnections is unknown | Enable CrestApps.OrchardCore.AI.ConnectionManagement before the step runs |
| Provider missing from Add Connection | Enable the provider feature |
| Stored key fails after redeploy or on another node | Data protection keys were not shared or persisted |
| A configuration connection cannot be edited | It is read-only by design; change configuration instead |
| A deployment cannot find its connection | ConnectionName must match the connection Name exactly |
Related skills
orchardcore-ai-providersfor per-provider setup, deployments and the Azure Speech deployment.orchardcore-aifor deployments, profiles and AI settings.orchardcore-ai-model-capabilitiesfor what deployments declare.orchardcore-deploymentsandorchardcore-recipesfor deployment plans and recipe mechanics.