# CertificateTrustConfigurationCallbackAnnotationContext Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [CertificateTrustConfigurationCallbackAnnotationContext](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext.md)
- Kind: `Properties`
- Members: `8`

Context provided to a [CertificateTrustConfigurationCallbackAnnotation](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotation.md) callback.

## Arguments

- Name: `Arguments`
- Modifiers: `get; init`
- Returns: `List<object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

Gets the command line arguments associated with the callback context. Values can be either a string or a path value provider such as [CertificateTrustConfigurationCallbackAnnotationContext.CertificateBundlePath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatebundlepath) or [CertificateTrustConfigurationCallbackAnnotationContext.CertificateDirectoriesPath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatedirectoriespath).

```csharp
public List<object> Arguments { get; init; }
```

## Remarks

```csharp
builder.AddContainer("my-resource", "my-image:latest")
   .WithCertificateTrustConfigurationCallback(ctx =>
   {
       ctx.Arguments.Add("--use-system-ca");
       return Task.CompletedTask;
   });
```

## CancellationToken

- Name: `CancellationToken`
- Modifiers: `get; init`
- Returns: `CancellationToken`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

Gets the [CertificateTrustConfigurationCallbackAnnotationContext.CancellationToken](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#cancellationtoken) that can be used to cancel the operation.

```csharp
public CancellationToken CancellationToken { get; init; }
```

## CertificateBundlePath

- Name: `CertificateBundlePath`
- Modifiers: `get; init`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

A value provider that will resolve to a path to a custom certificate bundle.

```csharp
public ReferenceExpression CertificateBundlePath { get; init; }
```

## CertificateDirectoriesPath

- Name: `CertificateDirectoriesPath`
- Modifiers: `get; init`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

A value provider that will resolve to paths containing individual certificates.

```csharp
public ReferenceExpression CertificateDirectoriesPath { get; init; }
```

## EnvironmentVariables

- Name: `EnvironmentVariables`
- Modifiers: `get; init`
- Returns: `Dictionary<string, object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

Gets the environment variables required to configure certificate trust for the resource. The dictionary key is the environment variable name; the value can be either a string or a path value provider such as [CertificateTrustConfigurationCallbackAnnotationContext.CertificateBundlePath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatebundlepath) or [CertificateTrustConfigurationCallbackAnnotationContext.CertificateDirectoriesPath](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotationcontext/properties.md#certificatedirectoriespath). By default the environment will always include an entry for `SSL_CERT_DIR` and may include `SSL_CERT_FILE` if [CertificateTrustScope.Override](/reference/api/csharp/aspire.hosting/certificatetrustscope/fields.md) or [CertificateTrustScope.System](/reference/api/csharp/aspire.hosting/certificatetrustscope/fields.md) is configured.

```csharp
public Dictionary<string, object> EnvironmentVariables { get; init; }
```

## Remarks

```csharp
builder.AddContainer("my-resource", "my-image:latest")
    .WithCertificateTrustConfigurationCallback(ctx =>
    {
        ctx.EnvironmentVariables["MY_CUSTOM_CERT_VAR"] = ctx.CertificateBundlePath;
        ctx.EnvironmentVariables["CERTS_DIR"] = ctx.CertificateDirectoriesPath;
        return Task.CompletedTask;
    });
```

## ExecutionContext

- Name: `ExecutionContext`
- Modifiers: `get; init`
- Returns: [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

Gets the [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md) for this session.

```csharp
public DistributedApplicationExecutionContext ExecutionContext { get; init; }
```

## Resource

- Name: `Resource`
- Modifiers: `get; init`
- Returns: [IResource](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

Gets the resource to which the annotation is applied.

```csharp
public IResource Resource { get; init; }
```

## Scope

- Name: `Scope`
- Modifiers: `get; init`
- Returns: [CertificateTrustScope](/reference/api/csharp/aspire.hosting/certificatetrustscope.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CertificateTrustConfigurationCallbackAnnotation.cs)

Gets the [CertificateTrustScope](/reference/api/csharp/aspire.hosting/certificatetrustscope.md) for the resource.

```csharp
public CertificateTrustScope Scope { get; init; }
```
