# ResourceBuilderExtensions

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ResourceBuilderExtensions.cs)

Provides extension methods for configuring resources with environment variables.

## Definition

```csharp
namespace Aspire.Hosting;

public static class ResourceBuilderExtensions
{
    // ...
}
```

## Methods

- [AsHttp2Service(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#ashttp2service-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Configures a resource to mark all endpoints' transport as HTTP/2. This is useful for HTTP/2 services that need prior knowledge.
- [ClearContainerFilesSources(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#clearcontainerfilessources-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Removes any container files source annotation from the resource being built.
- [ExcludeFromManifest(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#excludefrommanifest-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Excludes a resource from being published to the manifest.
- [ExcludeFromMcp(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#excludefrommcp-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Exclude the resource from MCP operations using the Aspire MCP server. The resource is excluded from results that return resources, console logs and telemetry.
- [GetConnectionProperty(IResourceWithConnectionString, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getconnectionproperty-iresourcewithconnectionstring-string) : [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) `extension` `ats export` -- Retrieves the value of a specified connection property from the resource's connection properties.
- [GetEndpoint(IResourceBuilder<T>, string, NetworkIdentifier)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getendpoint-iresourcebuilder-t-string-networkidentifier) : [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) `extension` `ats ignored` -- Gets an [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) by name from the resource. These endpoints are declared either using [ResourceBuilderExtensions.WithEndpoint(IResourceBuilder<T>, string, Action<EndpointAnnotation>, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withendpoint-iresourcebuilder-t-string-action-endpointannotation-bool) or by launch settings (for project resources). The [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) can be used to resolve the address of the endpoint in [ResourceBuilderExtensions.WithEnvironment(IResourceBuilder<T>, string, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-string).
- [GetEndpoint(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getendpoint-iresourcebuilder-t-string) : [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) `extension` `ats export` -- Gets an [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) by name from the resource. These endpoints are declared either using [ResourceBuilderExtensions.WithEndpoint(IResourceBuilder<T>, string, Action<EndpointAnnotation>, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withendpoint-iresourcebuilder-t-string-action-endpointannotation-bool) or by launch settings (for project resources). The [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md) can be used to resolve the address of the endpoint in [ResourceBuilderExtensions.WithEnvironment(IResourceBuilder<T>, string, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-string).
- [PublishWithContainerFiles(IResourceBuilder<T>, IResourceBuilder<IResourceWithContainerFiles>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#publishwithcontainerfiles-iresourcebuilder-t-iresourcebuilder-iresourcewithcontainerfiles-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Configures the resource to copy container files from the specified source resource during publishing.
- [SubscribeHttpsEndpointsUpdate(IResourceBuilder<TResource>, Action<HttpsEndpointUpdateCallbackContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#subscribehttpsendpointsupdate-iresourcebuilder-tresource-action-httpsendpointupdatecallbackcontext) : `IResourceBuilder<TResource>` `extension` `experimental` `ats ignored` -- Subscribes to the [BeforeStartEvent](/reference/api/csharp/aspire.hosting/beforestartevent.md) and invokes the specified callback when an HTTPS certificate is determined to be available for the resource. This is used to conditionally update endpoint URI schemes or perform other HTTPS-related configuration at startup.
- [WaitFor(IResourceBuilder<T>, IResourceBuilder<IResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#waitfor-iresourcebuilder-t-iresourcebuilder-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Waits for the dependency resource to enter the Running state before starting the resource.
- [WaitFor(IResourceBuilder<T>, IResourceBuilder<IResource>, WaitBehavior)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#waitfor-iresourcebuilder-t-iresourcebuilder-iresource-waitbehavior) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Waits for the dependency resource to enter the Running state before starting the resource.
- [WaitForCompletion(IResourceBuilder<T>, IResourceBuilder<IResource>, int)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#waitforcompletion-iresourcebuilder-t-iresourcebuilder-iresource-int) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Waits for the dependency resource to enter the Exited or Finished state before starting the resource.
- [WaitForStart(IResourceBuilder<T>, IResourceBuilder<IResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#waitforstart-iresourcebuilder-t-iresourcebuilder-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Waits for the dependency resource to enter the Running state before starting the resource.
- [WaitForStart(IResourceBuilder<T>, IResourceBuilder<IResource>, WaitBehavior)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#waitforstart-iresourcebuilder-t-iresourcebuilder-iresource-waitbehavior) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Waits for the dependency resource to enter the Running state before starting the resource.
- [WithArgs(IResourceBuilder<T>, string[])](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withargs-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds arguments to be passed to a resource that supports arguments when it is launched.
- [WithArgs(IResourceBuilder<T>, object[])](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withargs-iresourcebuilder-t-object) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds arguments to be passed to a resource that supports arguments when it is launched.
- [WithArgs(IResourceBuilder<T>, Action<CommandLineArgsCallbackContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withargs-iresourcebuilder-t-action-commandlineargscallbackcontext) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a callback to be executed with a list of command-line arguments when a resource is started.
- [WithArgs(IResourceBuilder<T>, Func<CommandLineArgsCallbackContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withargs-iresourcebuilder-t-func-commandlineargscallbackcontext-task) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an asynchronous callback to be executed with a list of command-line arguments when a resource is started.
- [WithCertificateAuthorityCollection(IResourceBuilder<TResource>, IResourceBuilder<CertificateAuthorityCollection>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcertificateauthoritycollection-iresourcebuilder-tresource-iresourcebuilder-certificateauthoritycollection) : `IResourceBuilder<TResource>` `extension` `ats ignored` -- Adds a [CertificateAuthorityCollectionAnnotation](/reference/api/csharp/aspire.hosting/certificateauthoritycollectionannotation.md) to the resource annotations to associate a certificate authority collection with the resource. This is used to configure additional trusted certificate authorities for the resource. Custom certificate trust is only applied in run mode; in publish mode resources will use their default certificate trust behavior.
- [WithCertificateTrustConfiguration(IResourceBuilder<TResource>, Func<CertificateTrustConfigurationCallbackAnnotationContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcertificatetrustconfiguration-iresourcebuilder-tresource-func-certificatetrustconfigurationcallbackannotationcontext-task) : `IResourceBuilder<TResource>` `extension` `ats ignored` -- Adds a [CertificateTrustConfigurationCallbackAnnotation](/reference/api/csharp/aspire.hosting/certificatetrustconfigurationcallbackannotation.md) to the resource annotations to associate a callback that is invoked when a resource needs to configure itself for custom certificate trust. May be called multiple times to register additional callbacks to append additional configuration. Custom certificate trust is only applied in run mode; in publish mode resources will use their default certificate trust behavior.
- [WithCertificateTrustScope(IResourceBuilder<TResource>, CertificateTrustScope)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcertificatetrustscope-iresourcebuilder-tresource-certificatetrustscope) : `IResourceBuilder<TResource>` `extension` `ats export` -- Sets the [CertificateTrustScope](/reference/api/csharp/aspire.hosting/certificatetrustscope.md) for custom certificate authorities associated with the resource. The scope specifies how custom certificate authorities should be applied to a resource at run time in local development scenarios. Custom certificate trust is only applied in run mode; in publish mode resources will use their default certificate trust behavior.
- [WithChildRelationship(IResourceBuilder<T>, IResourceBuilder<IResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withchildrelationship-iresourcebuilder-t-iresourcebuilder-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a parent-child relationship.
- [WithChildRelationship(IResourceBuilder<T>, IResource)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withchildrelationship-iresourcebuilder-t-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a parent-child relationship.
- [WithCommand(IResourceBuilder<T>, string, string, Func<ExecuteCommandContext, Task<ExecuteCommandResult>>, CommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcommand-iresourcebuilder-t-string-string-func-executecommandcontext-task-executecommandresult-commandoptions) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a [ResourceCommandAnnotation](/reference/api/csharp/aspire.hosting/resourcecommandannotation.md) to the resource annotations to add a resource command.
- [WithCommand(IResourceBuilder<T>, string, string, Func<ExecuteCommandContext, Task<ExecuteCommandResult>>, Func<UpdateCommandStateContext, ResourceCommandState>, string?, object?, string?, string?, IconVariant?, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcommand-iresourcebuilder-t-string-string-func-executecommandcontext-task-executecommandresult-func-updatecommandstatecontext-resourcecommandstate-string-object-string-string-iconvariant-bool) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `obsolete` -- Adds a [ResourceCommandAnnotation](/reference/api/csharp/aspire.hosting/resourcecommandannotation.md) to the resource annotations to add a resource command.
- [WithComputeEnvironment(IResourceBuilder<T>, IResourceBuilder<IComputeEnvironmentResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcomputeenvironment-iresourcebuilder-t-iresourcebuilder-icomputeenvironmentresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Configures the compute environment for the compute resource.
- [WithConnectionProperty(IResourceBuilder<T>, string, ReferenceExpression)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withconnectionproperty-iresourcebuilder-t-string-referenceexpression) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a connection property annotation to the resource being built. Any resource referencing this resource will get this connection property included in its environment variables.
- [WithConnectionProperty(IResourceBuilder<T>, string, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withconnectionproperty-iresourcebuilder-t-string-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a connection property annotation to the resource being built. Any resource referencing this resource will get this connection property included in its environment variables.
- [WithConnectionStringRedirection(IResourceBuilder<T>, IResourceWithConnectionString)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withconnectionstringredirection-iresourcebuilder-t-iresourcewithconnectionstring) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Registers a callback which is invoked when a connection string is requested for a resource.
- [WithContainerFilesSource(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withcontainerfilessource-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a container files source annotation to the resource being built, specifying the path to the container files source.
- [WithDebugSupport(IResourceBuilder<T>, Func<string, TLaunchConfiguration>, string, Action<CommandLineArgsCallbackContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withdebugsupport-iresourcebuilder-t-func-string-tlaunchconfiguration-string-action-commandlineargscallbackcontext) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats ignored` -- Adds support for debugging the resource in VS Code when running in an extension host.
- [WithDeveloperCertificateTrust(IResourceBuilder<TResource>, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withdevelopercertificatetrust-iresourcebuilder-tresource-bool) : `IResourceBuilder<TResource>` `extension` `ats export` -- Indicates whether developer certificates should be treated as trusted certificate authorities for the resource at run time. Currently this indicates trust for the ASP.NET Core developer certificate. The developer certificate will only be trusted when running in local development scenarios; in publish mode resources will use their default certificate trust.
- [WithEndpoint(IResourceBuilder<T>, string, Action<EndpointAnnotation>, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withendpoint-iresourcebuilder-t-string-action-endpointannotation-bool) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Changes an existing endpoint or creates a new endpoint if it doesn't exist and invokes callback to modify the defaults.
- [WithEndpoint(IResourceBuilder<T>, int?, int?, string?, string?, string?, bool, bool?, ProtocolType?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withendpoint-iresourcebuilder-t-int-int-string-string-string-bool-bool-protocoltype) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Exposes an endpoint on a resource. A reference to this endpoint can be retrieved using [ResourceBuilderExtensions.GetEndpoint(IResourceBuilder<T>, string, NetworkIdentifier)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getendpoint-iresourcebuilder-t-string-networkidentifier). The endpoint name will be the scheme name if not specified.
- [WithEndpoint(IResourceBuilder<T>, int?, int?, string?, string?, string?, bool, bool?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withendpoint-iresourcebuilder-t-int-int-string-string-string-bool-bool) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Exposes an endpoint on a resource. This endpoint reference can be retrieved using [ResourceBuilderExtensions.GetEndpoint(IResourceBuilder<T>, string, NetworkIdentifier)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getendpoint-iresourcebuilder-t-string-networkidentifier). The endpoint name will be the scheme name if not specified.
- [WithEnvironment(IResourceBuilder<T>, string, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource.
- [WithEnvironment(IResourceBuilder<T>, string, ExpressionInterpolatedStringHandler)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-expressioninterpolatedstringhandler) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource.
- [WithEnvironment(IResourceBuilder<T>, string, ReferenceExpression)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-referenceexpression) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with a reference expression value.
- [WithEnvironment(IResourceBuilder<T>, string, Func<string>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-func-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource.
- [WithEnvironment(IResourceBuilder<T>, Action<EnvironmentCallbackContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-action-environmentcallbackcontext) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Allows for the population of environment variables on a resource.
- [WithEnvironment(IResourceBuilder<T>, Func<EnvironmentCallbackContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-func-environmentcallbackcontext-task) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Allows for the population of environment variables on a resource.
- [WithEnvironment(IResourceBuilder<T>, string, EndpointReference)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-endpointreference) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with the endpoint for `endpointReference`.
- [WithEnvironment(IResourceBuilder<T>, string, IResourceBuilder<ExternalServiceResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-iresourcebuilder-externalserviceresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with the URL from the [ExternalServiceResource](/reference/api/csharp/aspire.hosting/externalserviceresource.md).
- [WithEnvironment(IResourceBuilder<T>, string, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-iresourcebuilder-parameterresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with the value from `parameter`.
- [WithEnvironment(IResourceBuilder<T>, string, IResourceBuilder<IResourceWithConnectionString>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-iresourcebuilder-iresourcewithconnectionstring) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with the connection string from the referenced resource.
- [WithEnvironment(IResourceBuilder<T>, string, IExpressionValue)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-iexpressionvalue) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with a value that provides both a runtime value and a manifest expression.
- [WithEnvironment(IResourceBuilder<T>, string, TValue)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withenvironment-iresourcebuilder-t-string-tvalue) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds an environment variable to the resource with a value that implements both [IValueProvider](/reference/api/csharp/aspire.hosting/ivalueprovider.md) and [IManifestExpressionProvider](/reference/api/csharp/aspire.hosting/imanifestexpressionprovider.md).
- [WithExplicitStart(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withexplicitstart-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a [ExplicitStartupAnnotation](/reference/api/csharp/aspire.hosting/explicitstartupannotation.md) annotation to the resource so it doesn't automatically start with the app host startup.
- [WithExternalHttpEndpoints(IResourceBuilder<T>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withexternalhttpendpoints-iresourcebuilder-t) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Marks existing http or https endpoints on a resource as external.
- [WithHealthCheck(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhealthcheck-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a [HealthCheckAnnotation](/reference/api/csharp/aspire.hosting/healthcheckannotation.md) to the resource annotations to associate a resource with a named health check managed by the health check service.
- [WithHttpCommand(IResourceBuilder<TResource>, string, string, string?, string?, HttpCommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpcommand-iresourcebuilder-tresource-string-string-string-string-httpcommandoptions) : `IResourceBuilder<TResource>` `extension` `ats ignored` -- Adds a command to the resource that when invoked sends an HTTP request to the specified endpoint and path.
- [WithHttpCommand(IResourceBuilder<TResource>, string, string, Func<EndpointReference>, string?, HttpCommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpcommand-iresourcebuilder-tresource-string-string-func-endpointreference-string-httpcommandoptions) : `IResourceBuilder<TResource>` `extension` `ats ignored` -- Adds a command to the resource that when invoked sends an HTTP request to the specified endpoint and path.
- [WithHttpEndpoint(IResourceBuilder<T>, int?, int?, string?, string?, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpendpoint-iresourcebuilder-t-int-int-string-string-bool) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Exposes an HTTP endpoint on a resource, or updates the existing HTTP endpoint if one with the same name already exists. This endpoint reference can be retrieved using [ResourceBuilderExtensions.GetEndpoint(IResourceBuilder<T>, string, NetworkIdentifier)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getendpoint-iresourcebuilder-t-string-networkidentifier). The endpoint name will be "http" if not specified.
- [WithHttpHealthCheck(IResourceBuilder<T>, string?, int?, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttphealthcheck-iresourcebuilder-t-string-int-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a health check to the resource which is mapped to a specific endpoint.
- [WithHttpHealthCheck(IResourceBuilder<T>, Func<EndpointReference>, string?, int?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttphealthcheck-iresourcebuilder-t-func-endpointreference-string-int) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a health check to the resource which is mapped to a specific endpoint.
- [WithHttpProbe(IResourceBuilder<T>, ProbeType, string?, int?, int?, int?, int?, int?, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpprobe-iresourcebuilder-t-probetype-string-int-int-int-int-int-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats ignored` -- Adds a HTTP probe to the resource.
- [WithHttpProbe(IResourceBuilder<T>, ProbeType, Func<EndpointReference>, string?, int?, int?, int?, int?, int?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpprobe-iresourcebuilder-t-probetype-func-endpointreference-string-int-int-int-int-int) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats ignored` -- Adds a HTTP probe to the resource.
- [WithHttpsCertificate(IResourceBuilder<TResource>, X509Certificate2, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpscertificate-iresourcebuilder-tresource-x509certificate2-iresourcebuilder-parameterresource) : `IResourceBuilder<TResource>` `extension` `experimental` `ats ignored` -- Adds a [HttpsCertificateAnnotation](/reference/api/csharp/aspire.hosting/httpscertificateannotation.md) to the resource annotations to associate an X.509 certificate key pair with the resource. This is used to configure the certificate presented by the resource for HTTPS/TLS endpoints.
- [WithHttpsCertificateConfiguration(IResourceBuilder<TResource>, Func<HttpsCertificateConfigurationCallbackAnnotationContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpscertificateconfiguration-iresourcebuilder-tresource-func-httpscertificateconfigurationcallbackannotationcontext-task) : `IResourceBuilder<TResource>` `extension` `experimental` `ats ignored` -- Adds a callback that allows configuring the resource to use a specific HTTPS/TLS certificate key pair for server authentication.
- [WithHttpsDeveloperCertificate(IResourceBuilder<TResource>, IResourceBuilder<ParameterResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpsdevelopercertificate-iresourcebuilder-tresource-iresourcebuilder-parameterresource) : `IResourceBuilder<TResource>` `extension` `experimental` `ats export` -- Indicates that a resource should use the developer certificate key pair for HTTPS endpoints at run time. Currently this indicates use of the ASP.NET Core developer certificate. The developer certificate will only be used when running in local development scenarios; in publish mode resources will use their default certificate configuration.
- [WithHttpsEndpoint(IResourceBuilder<T>, int?, int?, string?, string?, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpsendpoint-iresourcebuilder-t-int-int-string-string-bool) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Exposes an HTTPS endpoint on a resource, or updates the existing HTTPS endpoint if one with the same name already exists. This endpoint reference can be retrieved using [ResourceBuilderExtensions.GetEndpoint(IResourceBuilder<T>, string, NetworkIdentifier)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#getendpoint-iresourcebuilder-t-string-networkidentifier). The endpoint name will be "https" if not specified.
- [WithHttpsHealthCheck(IResourceBuilder<T>, string?, int?, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withhttpshealthcheck-iresourcebuilder-t-string-int-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `obsolete` -- Adds a health check to the resource which is mapped to a specific endpoint.
- [WithIconName(IResourceBuilder<T>, string, IconVariant)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withiconname-iresourcebuilder-t-string-iconvariant) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Specifies the icon to use when displaying the resource in the dashboard.
- [WithImagePushOptions(IResourceBuilder<T>, Action<ContainerImagePushOptionsCallbackContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withimagepushoptions-iresourcebuilder-t-action-containerimagepushoptionscallbackcontext) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats ignored` -- Adds a callback to configure container image push options for the resource.
- [WithImagePushOptions(IResourceBuilder<T>, Func<ContainerImagePushOptionsCallbackContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withimagepushoptions-iresourcebuilder-t-func-containerimagepushoptionscallbackcontext-task) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats export` -- Adds an asynchronous callback to configure container image push options for the resource.
- [WithManifestPublishingCallback(IResourceBuilder<T>, Action<ManifestPublishingContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withmanifestpublishingcallback-iresourcebuilder-t-action-manifestpublishingcontext) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Registers a callback which is invoked when manifest is generated for the app model.
- [WithManifestPublishingCallback(IResourceBuilder<T>, Func<ManifestPublishingContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withmanifestpublishingcallback-iresourcebuilder-t-func-manifestpublishingcontext-task) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Registers an async callback which is invoked when manifest is generated for the app model.
- [WithoutHttpsCertificate(IResourceBuilder<TResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withouthttpscertificate-iresourcebuilder-tresource) : `IResourceBuilder<TResource>` `extension` `experimental` `ats export` -- Disable HTTPS/TLS server certificate configuration for the resource. No HTTPS/TLS termination configuration will be applied.
- [WithParentRelationship(IResourceBuilder<T>, IResourceBuilder<IResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withparentrelationship-iresourcebuilder-t-iresourcebuilder-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a parent-child relationship.
- [WithParentRelationship(IResourceBuilder<T>, IResource)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withparentrelationship-iresourcebuilder-t-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a parent-child relationship.
- [WithReference(IResourceBuilder<TDestination>, IResourceBuilder<IResourceWithConnectionString>, string?, bool)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreference-iresourcebuilder-tdestination-iresourcebuilder-iresourcewithconnectionstring-string-bool) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Injects a connection string as an environment variable from the source resource into the destination resource, using the source resource's name as the connection string name (if not overridden). The format of the environment variable will be "ConnectionStrings__{sourceResourceName}={connectionString}". Each resource defines the format of the connection string value. The underlying connection string value can be retrieved using [IResourceWithConnectionString.GetConnectionStringAsync(CancellationToken)](/reference/api/csharp/aspire.hosting/iresourcewithconnectionstring/methods.md#getconnectionstringasync-cancellationtoken). Connection strings are also resolved by the configuration system (appSettings.json in the AppHost project, or environment variables). If a connection string is not found on the resource, the configuration system will be queried for a connection string using the resource's name.
- [WithReference(IResourceBuilder<TDestination>, IResourceBuilder<IResourceWithServiceDiscovery>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreference-iresourcebuilder-tdestination-iresourcebuilder-iresourcewithservicediscovery) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Injects service discovery and endpoint information as environment variables from the source resource into the destination resource, using the source resource's name as the service name. Each non-excluded endpoint (where [EndpointAnnotation.ExcludeReferenceEndpoint](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#excludereferenceendpoint) is `false`) defined on the source resource will be injected using the format defined by the [ReferenceEnvironmentInjectionAnnotation](/reference/api/csharp/aspire.hosting/referenceenvironmentinjectionannotation.md) on the destination resource, i.e. either "services__{sourceResourceName}__{endpointScheme}__{endpointIndex}={uriString}" for .NET service discovery, or "{RESOURCE_ENDPOINT}={uri}" for endpoint injection.
- [WithReference(IResourceBuilder<TDestination>, IResourceBuilder<IResourceWithServiceDiscovery>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreference-iresourcebuilder-tdestination-iresourcebuilder-iresourcewithservicediscovery-string) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Injects service discovery and endpoint information as environment variables from the source resource into the destination resource, using the source resource's name as the service name. Each non-excluded endpoint (where [EndpointAnnotation.ExcludeReferenceEndpoint](/reference/api/csharp/aspire.hosting/endpointannotation/properties.md#excludereferenceendpoint) is `false`) defined on the source resource will be injected using the format defined by the [ReferenceEnvironmentInjectionAnnotation](/reference/api/csharp/aspire.hosting/referenceenvironmentinjectionannotation.md) on the destination resource, i.e. either "services__{name}__{endpointScheme}__{endpointIndex}={uriString}" for .NET service discovery, or "{name}_{ENDPOINT}={uri}" for endpoint injection.
- [WithReference(IResourceBuilder<TDestination>, string, Uri)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreference-iresourcebuilder-tdestination-string-uri) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Injects service discovery and endpoint information as environment variables from the uri into the destination resource, using the name as the service name. The uri will be injected using the format defined by the [ReferenceEnvironmentInjectionAnnotation](/reference/api/csharp/aspire.hosting/referenceenvironmentinjectionannotation.md) on the destination resource, i.e. either "services__{name}__default__0={uri}" for .NET service discovery, or "{name}={uri}" for endpoint injection.
- [WithReference(IResourceBuilder<TDestination>, IResourceBuilder<ExternalServiceResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreference-iresourcebuilder-tdestination-iresourcebuilder-externalserviceresource) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Injects service discovery information as environment variables from the [ExternalServiceResource](/reference/api/csharp/aspire.hosting/externalserviceresource.md) into the destination resource, using the name as the service name. The uri will be injected using the format "services__{name}__default__0={uri}."
- [WithReference(IResourceBuilder<TDestination>, EndpointReference)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreference-iresourcebuilder-tdestination-endpointreference) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Injects service discovery and endpoint information from the specified endpoint into the project resource using the source resource's name as the service name. Each endpoint uri will be injected using the format defined by the [ReferenceEnvironmentInjectionAnnotation](/reference/api/csharp/aspire.hosting/referenceenvironmentinjectionannotation.md) on the destination resource, i.e. either "services__{name}__{endpointScheme}__{endpointIndex}={uriString}" for .NET service discovery, or "{NAME}_{ENDPOINT}={uri}" for endpoint injection.
- [WithReferenceEnvironment(IResourceBuilder<TDestination>, ReferenceEnvironmentInjectionFlags)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreferenceenvironment-iresourcebuilder-tdestination-referenceenvironmentinjectionflags) : `IResourceBuilder<TDestination>` `extension` `ats ignored` -- Configures how information is injected into environment variables when the resource references other resources.
- [WithReferenceRelationship(IResourceBuilder<T>, IResource)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreferencerelationship-iresourcebuilder-t-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a reference to another resource.
- [WithReferenceRelationship(IResourceBuilder<T>, ReferenceExpression)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreferencerelationship-iresourcebuilder-t-referenceexpression) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Walks the reference expression and adds [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) s for all resources found in the expression.
- [WithReferenceRelationship(IResourceBuilder<T>, IResourceBuilder<IResource>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withreferencerelationship-iresourcebuilder-t-iresourcebuilder-iresource) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a reference to another resource.
- [WithRelationship(IResourceBuilder<T>, IResource, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withrelationship-iresourcebuilder-t-iresource-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a [ResourceRelationshipAnnotation](/reference/api/csharp/aspire.hosting/resourcerelationshipannotation.md) to the resource annotations to add a relationship.
- [WithRelationship(IResourceBuilder<T>, IResourceBuilder<IResource>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withrelationship-iresourcebuilder-t-iresourcebuilder-iresource-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Adds a relationship to another resource using its builder.
- [WithRemoteImageName(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withremoteimagename-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats export` -- Sets the remote image name (without registry endpoint or tag) for container push operations.
- [WithRemoteImageTag(IResourceBuilder<T>, string)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withremoteimagetag-iresourcebuilder-t-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `experimental` `ats export` -- Sets the remote image tag for container push operations.
- [WithUrl(IResourceBuilder<T>, string, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurl-iresourcebuilder-t-string-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a URL to be displayed for the resource.
- [WithUrl(IResourceBuilder<T>, ExpressionInterpolatedStringHandler, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurl-iresourcebuilder-t-expressioninterpolatedstringhandler-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a URL to be displayed for the resource.
- [WithUrl(IResourceBuilder<T>, ReferenceExpression, string?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurl-iresourcebuilder-t-referenceexpression-string) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Adds a URL to be displayed for the resource.
- [WithUrlForEndpoint(IResourceBuilder<T>, string, Action<ResourceUrlAnnotation>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurlforendpoint-iresourcebuilder-t-string-action-resourceurlannotation) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Registers a callback to update the URL displayed for the endpoint with the specified name.
- [WithUrlForEndpoint(IResourceBuilder<T>, string, Func<EndpointReference, ResourceUrlAnnotation>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurlforendpoint-iresourcebuilder-t-string-func-endpointreference-resourceurlannotation) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Registers a callback to add a URL for the endpoint with the specified name.
- [WithUrls(IResourceBuilder<T>, Action<ResourceUrlsCallbackContext>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurls-iresourcebuilder-t-action-resourceurlscallbackcontext) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats export` -- Registers a callback to customize the URLs displayed for the resource.
- [WithUrls(IResourceBuilder<T>, Func<ResourceUrlsCallbackContext, Task>)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withurls-iresourcebuilder-t-func-resourceurlscallbackcontext-task) : [IResourceBuilder<T>](/reference/api/csharp/aspire.hosting/iresourcebuilder-1.md) `extension` `ats ignored` -- Registers an async callback to customize the URLs displayed for the resource.
