AzureOpenAIProviderOptions
AgentPrism.Azure.dllAgentPrism’s Azure OpenAI provider options.
public sealed class AzureOpenAIProviderOptionsInheritance
Section titled “Inheritance”object ← AzureOpenAIProviderOptions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”This type is deliberately a class, not a record: the
ToString a record generates writes every property, and a
single log line would expose the API key.
Validation is done by hand inside AzureOpenAIProviderOptionsValidator;
DataAnnotations relies on reflection and breaks AOT compatibility.
Constructors
Section titled “Constructors”AzureOpenAIProviderOptions()
Section titled “ AzureOpenAIProviderOptions()”public AzureOpenAIProviderOptions()Fields
Section titled “Fields”SectionName
Section titled “ SectionName”The full path of the configuration section options are read from.
public const string SectionName = "AgentPrism:Providers:AzureOpenAI"Field Value
Section titled “Field Value”Properties
Section titled “Properties”ApiKey
Section titled “ ApiKey”The Azure OpenAI resource’s API key.
public string? ApiKey { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”This value is a secret and is not written to a file. Use
dotnet user-secrets, an environment variable, or a secret manager.
When AzureOpenAIProviderOptions.CredentialFactory is given, this field is not used. At least one of the two must be filled in.
Audience
Section titled “ Audience”The token scope (audience) requested with the Entra credential. The Azure public cloud is used when null.
public string? Audience { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Affects only the AzureOpenAIProviderOptions.CredentialFactory path; it is not used on the API key path. Sovereign clouds (Azure Government, Azure China) require a different scope.
Public cloud value: https://cognitiveservices.azure.com/.default.
Azure Government: https://cognitiveservices.azure.us/.default.
CredentialFactory
Section titled “ CredentialFactory”The factory that produces a Microsoft Entra credential. When given, this is used instead of the API key.
public Func<TokenCredential>? CredentialFactory { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The factory deliberately comes from the consumer. The
DefaultAzureCredential type needed for a managed credential lives
in the Azure.Identity package; that package is not small and pulls
in the Microsoft.Identity.Client chain too. AgentPrism.Azure
does not take it as a dependency; it only binds to the Azure.Core
abstraction and leaves the credential choice to the consumer.
// In the consumer's project: <PackageReference Include="Azure.Identity" />options.CredentialFactory = static () => new DefaultAzureCredential();The factory is called once while the client is built. The returned TokenCredential manages token renewal itself.
DefaultDeployment
Section titled “ DefaultDeployment”The deployment name used when ModelBinding.Model is left empty.
public string? DefaultDeployment { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”What Azure calls is not a model name, it is a deployment name. The same model can be deployed under different names, and the person who sets up the resource chooses the deployment name. Detail: AzureOpenAIChatClientFactory.
Endpoint
Section titled “ Endpoint”The Azure OpenAI resource’s address. Example:
https://my-resource.openai.azure.com/.
public Uri? Endpoint { get; set; }Property Value
Section titled “Property Value”Uri?
Remarks
Section titled “Remarks”Required; Azure has no single global address, each resource has its own. The address is not a secret, but it exposes an organization’s topology; it is not shown in error messages or health-check detail.
Models
Section titled “ Models”The model catalog shown to the UI. Each entry’s Name field is the
deployment name.
public IList<ModelDescriptor> Models { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”AgentPrism carries no built-in model list; the catalog comes entirely from here. This list is not a validation list: a deployment name absent from it can still be used.
Timeout
Section titled “ Timeout”The upper time limit for a single request. The library default is used when null.
public TimeSpan? Timeout { get; set; }