# AzureOpenAISettings Properties

- Package: [Aspire.Azure.AI.OpenAI](/reference/api/csharp/aspire.azure.ai.openai.md)
- Type: [AzureOpenAISettings](/reference/api/csharp/aspire.azure.ai.openai/azureopenaisettings.md)
- Kind: `Properties`
- Members: `6`

The settings relevant to accessing Azure OpenAI or OpenAI.

## Credential

- Name: `Credential`
- Modifiers: `nullable` `get; set`
- Returns: `TokenCredential?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Components/Aspire.Azure.AI.OpenAI/AzureOpenAISettings.cs)

Gets or sets the credential used to authenticate to the Azure OpenAI resource.

```csharp
public TokenCredential? Credential { get; set; }
```

## DisableMetrics

- Name: `DisableMetrics`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Components/Aspire.Azure.AI.OpenAI/AzureOpenAISettings.cs)

Gets or sets a boolean value that indicates whether the OpenTelemetry metrics are enabled or not.

```csharp
public bool DisableMetrics { get; set; }
```

## Remarks

Telemetry is recorded by Microsoft.Extensions.AI.

## DisableTracing

- Name: `DisableTracing`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Components/Aspire.Azure.AI.OpenAI/AzureOpenAISettings.cs)

Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is disabled or not.

```csharp
public bool DisableTracing { get; set; }
```

## Remarks

Telemetry is recorded by Microsoft.Extensions.AI.

## EnableSensitiveTelemetryData

- Name: `EnableSensitiveTelemetryData`
- Modifiers: `get; set`
- Returns: `bool`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Components/Aspire.Azure.AI.OpenAI/AzureOpenAISettings.cs)

Gets or sets a boolean value indicating whether potentially sensitive information should be included in telemetry.

```csharp
public bool EnableSensitiveTelemetryData { get; set; }
```

## Remarks

By default, telemetry includes metadata, such as token counts, but not raw inputs and outputs, such as message content, function call arguments, and function call results. The default value can be overridden by setting the `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable to "true". Explicitly setting this property will override the environment variable.

## Endpoint

- Name: `Endpoint`
- Modifiers: `nullable` `get; set`
- Returns: `Uri?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Components/Aspire.Azure.AI.OpenAI/AzureOpenAISettings.cs)

Gets or sets a `Uri` referencing the Azure OpenAI endpoint. This is likely to be similar to "https://{account_name}.openai.azure.com".

```csharp
public Uri? Endpoint { get; set; }
```

## Remarks

Leave empty and provide a [AzureOpenAISettings.Key](/reference/api/csharp/aspire.azure.ai.openai/azureopenaisettings/properties.md#key) value to use a non-Azure OpenAI inference endpoint. Used along with [AzureOpenAISettings.Credential](/reference/api/csharp/aspire.azure.ai.openai/azureopenaisettings/properties.md#credential) or [AzureOpenAISettings.Key](/reference/api/csharp/aspire.azure.ai.openai/azureopenaisettings/properties.md#key) to establish the connection.

## Key

- Name: `Key`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Components/Aspire.Azure.AI.OpenAI/AzureOpenAISettings.cs)

Gets or sets the key to use to authenticate to the Azure OpenAI endpoint.

```csharp
public string? Key { get; set; }
```

## Remarks

When defined it will use an `ClientModel.ApiKeyCredential` instance instead of [AzureOpenAISettings.Credential](/reference/api/csharp/aspire.azure.ai.openai/azureopenaisettings/properties.md#credential).
