1836 references to IResourceBuilder
Aspire.Hosting (283)
ContainerResourceBuilderExtensions.cs (84)
20/// <returns>The <see cref="IResourceBuilder{T}"/> for chaining.</returns>
21public static IResourceBuilder<ContainerResource> AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image)
37/// <returns>The <see cref="IResourceBuilder{T}"/> for chaining.</returns>
38public static IResourceBuilder<ContainerResource> AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image, string tag)
58/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
59public static IResourceBuilder<T> WithVolume<T>(this IResourceBuilder<T> builder, string? name, string target, bool isReadOnly = false) where T : ContainerResource
74/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
75public static IResourceBuilder<T> WithVolume<T>(this IResourceBuilder<T> builder, string target) where T : ContainerResource
92/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
93public static IResourceBuilder<T> WithBindMount<T>(this IResourceBuilder<T> builder, string source, string target, bool isReadOnly = false) where T : ContainerResource
109/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
110public static IResourceBuilder<T> WithEntrypoint<T>(this IResourceBuilder<T> builder, string entrypoint) where T : ContainerResource
125/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
126public static IResourceBuilder<T> WithImageTag<T>(this IResourceBuilder<T> builder, string tag) where T : ContainerResource
146/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
147public static IResourceBuilder<T> WithImageRegistry<T>(this IResourceBuilder<T> builder, string? registry) where T : ContainerResource
167/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
168public static IResourceBuilder<T> WithImage<T>(this IResourceBuilder<T> builder, string image, string tag = "latest") where T : ContainerResource
193/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
194public static IResourceBuilder<T> WithImageSHA256<T>(this IResourceBuilder<T> builder, string sha256) where T : ContainerResource
212/// This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the <see cref="ResourceBuilderExtensions.WithArgs{T}(IResourceBuilder{T}, string[])"/> method.
217/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
218public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, params string[] args) where T : ContainerResource
229/// This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the <see cref="ResourceBuilderExtensions.WithArgs{T}(IResourceBuilder{T}, Action{CommandLineArgsCallbackContext})"/> method.
234/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
235public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Action<ContainerRuntimeArgsCallbackContext> callback) where T : ContainerResource
251/// This is intended to pass additional arguments to the underlying container runtime run command to enable advanced features such as exposing GPUs to the container. To pass runtime arguments to the actual container, use the <see cref="ResourceBuilderExtensions.WithArgs{T}(IResourceBuilder{T}, Func{CommandLineArgsCallbackContext, Task})"/> method.
256/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
257public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Func<ContainerRuntimeArgsCallbackContext, Task> callback) where T : ContainerResource
272/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
284public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder, ContainerLifetime lifetime) where T : ContainerResource
291private static IResourceBuilder<T> ThrowResourceIsNotContainer<T>(IResourceBuilder<T> builder) where T : ContainerResource
300/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
301public static IResourceBuilder<T> PublishAsContainer<T>(this IResourceBuilder<T> builder) where T : ContainerResource
312/// <param name="builder">The <see cref="IResourceBuilder{T}"/>.</param>
316/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
329/// When generating the manifest for deployment tools, the <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>
345public static IResourceBuilder<T> WithDockerfile<T>(this IResourceBuilder<T> builder, string contextPath, string? dockerfilePath = null, string? stage = null) where T : ContainerResource
382/// <returns>A <see cref="IResourceBuilder{ContainerResource}"/>.</returns>
405public static IResourceBuilder<ContainerResource> AddDockerfile(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, string? dockerfilePath = null, string? stage = null)
427/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
428public static IResourceBuilder<T> WithContainerName<T>(this IResourceBuilder<T> builder, string name) where T : ContainerResource
443/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
445/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, object)"/> is
446/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
450/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, object)"/> extension method
452/// <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
467public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, object value) where T : ContainerResource
492/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
494/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is
495/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
499/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method
501/// <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
518public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
539/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
541/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is
542/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
546/// The <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method
565public static IResourceBuilder<T> WithBuildSecret<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
ParameterResourceBuilderExtensions.cs (15)
25public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, bool secret = false)
45public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, string value, bool publishValueAsDefault = false, bool secret = false)
66public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, string name, Func<string> valueGetter, bool publishValueAsDefault = false, bool secret = false)
95public static IResourceBuilder<ParameterResource> AddParameterFromConfiguration(this IDistributedApplicationBuilder builder, string name, string configurationKey, bool secret = false)
122public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, ParameterDefault value, bool secret = false, bool persist = false)
149internal static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder,
210/// Adds a parameter to the distributed application but wrapped in a resource with a connection string for use with <see cref="ResourceBuilderExtensions.WithReference{TDestination}(IResourceBuilder{TDestination}, IResourceBuilder{IResourceWithConnectionString}, string?, bool)"/>
217public static IResourceBuilder<IResourceWithConnectionString> AddConnectionString(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? environmentVariableName = null)
222var parameterBuilder = builder.AddParameter(name, _ =>
238/// <returns>The configured <see cref="IResourceBuilder{T}"/>.</returns>
239public static IResourceBuilder<T> PublishAsConnectionString<T>(this IResourceBuilder<T> builder)
251/// <param name="builder">The <see cref="IResourceBuilder{T}"/>.</param>
252public static void ConfigureConnectionStringManifestPublisher(IResourceBuilder<IResourceWithConnectionString> builder)
ProjectResourceBuilderExtensions.cs (29)
28/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
61public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name) where TProject : IProjectMetadata, new()
75/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
94public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath)
111/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
141public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? launchProfileName) where TProject : IProjectMetadata, new()
160/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
179public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, string? launchProfileName)
199/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
228public static IResourceBuilder<ProjectResource> AddProject<TProject>(this IDistributedApplicationBuilder builder, [ResourceName] string name, Action<ProjectResourceOptions> configure) where TProject : IProjectMetadata, new()
250/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
268public static IResourceBuilder<ProjectResource> AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, Action<ProjectResourceOptions> configure)
287private static IResourceBuilder<ProjectResource> WithProjectDefaults(this IResourceBuilder<ProjectResource> builder, ProjectResourceOptions options)
541/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
546/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{ProjectResource}, int)"/> is
563public static IResourceBuilder<ProjectResource> WithReplicas(this IResourceBuilder<ProjectResource> builder, int replicas)
575/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
584/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{ProjectResource})"/>
597public static IResourceBuilder<ProjectResource> DisableForwardedHeaders(this IResourceBuilder<ProjectResource> builder)
611/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
612public static IResourceBuilder<ProjectResource> WithEndpointsInEnvironment(
613this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
644private static void SetAspNetCoreUrls(this IResourceBuilder<ProjectResource> builder)
691private static void SetBothPortsEnvVariables(this IResourceBuilder<ProjectResource> builder)
700private static void SetOnePortsEnvVariable(this IResourceBuilder<ProjectResource> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme)
735private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<ProjectResource> builder)
ResourceBuilderExtensions.cs (124)
29/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
30public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, string? value) where T : IResourceWithEnvironment
45/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
46public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, in ReferenceExpression.ExpressionInterpolatedStringHandler value)
67/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
68public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, ReferenceExpression value)
88/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
89public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, Func<string> callback) where T : IResourceWithEnvironment
104/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
105public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, Action<EnvironmentCallbackContext> callback) where T : IResourceWithEnvironment
119/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
120public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, Func<EnvironmentCallbackContext, Task> callback) where T : IResourceWithEnvironment
135/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
136public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, EndpointReference endpointReference) where T : IResourceWithEnvironment
155/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
156public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> parameter) where T : IResourceWithEnvironment
175/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
176public static IResourceBuilder<T> WithEnvironment<T>(
177this IResourceBuilder<T> builder,
179IResourceBuilder<IResourceWithConnectionString> resource)
198/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
199public static IResourceBuilder<T> WithArgs<T>(this IResourceBuilder<T> builder, params string[] args) where T : IResourceWithArgs
213/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
214public static IResourceBuilder<T> WithArgs<T>(this IResourceBuilder<T> builder, params object[] args) where T : IResourceWithArgs
228/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
229public static IResourceBuilder<T> WithArgs<T>(this IResourceBuilder<T> builder, Action<CommandLineArgsCallbackContext> callback) where T : IResourceWithArgs
247/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
248public static IResourceBuilder<T> WithArgs<T>(this IResourceBuilder<T> builder, Func<CommandLineArgsCallbackContext, Task> callback) where T : IResourceWithArgs
262/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
263public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Action<ManifestPublishingContext> callback) where T : IResource
278/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
279public static IResourceBuilder<T> WithManifestPublishingCallback<T>(this IResourceBuilder<T> builder, Func<ManifestPublishingContext, Task> callback) where T : IResource
294/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
295public static IResourceBuilder<T> WithConnectionStringRedirection<T>(this IResourceBuilder<T> builder, IResourceWithConnectionString resource) where T : IResourceWithConnectionString
343/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
344public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, IResourceBuilder<IResourceWithConnectionString> source, string? connectionName = null, bool optional = false)
370/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
371public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, IResourceBuilder<IResourceWithServiceDiscovery> source)
389/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
390public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, string name, Uri uri)
417/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
418public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, EndpointReference endpointReference)
428private static void ApplyEndpoints<T>(this IResourceBuilder<T> builder, IResourceWithEndpoints resourceWithEndpoints, string? endpointName = null)
469/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
471public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints
502/// Exposes an endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string)"/>.
514/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
517public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, int? port = null, int? targetPort = null, string? scheme = null, [EndpointName] string? name = null, string? env = null, bool isProxied = true, bool? isExternal = null) where T : IResourceWithEndpoints
552/// Exposes an HTTP endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string)"/>.
562/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
564public static IResourceBuilder<T> WithHttpEndpoint<T>(this IResourceBuilder<T> builder, int? port = null, int? targetPort = null, [EndpointName] string? name = null, string? env = null, bool isProxied = true) where T : IResourceWithEndpoints
572/// Exposes an HTTPS endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string)"/>.
582/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
584public static IResourceBuilder<T> WithHttpsEndpoint<T>(this IResourceBuilder<T> builder, int? port = null, int? targetPort = null, [EndpointName] string? name = null, string? env = null, bool isProxied = true) where T : IResourceWithEndpoints
596/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
597public static IResourceBuilder<T> WithExternalHttpEndpoints<T>(this IResourceBuilder<T> builder) where T : IResourceWithEndpoints
618/// Gets an <see cref="EndpointReference"/> by name from the resource. These endpoints are declared either using <see cref="WithEndpoint{T}(IResourceBuilder{T}, int?, int?, string?, string?, string?, bool, bool?)"/> or by launch settings (for project resources).
619/// The <see cref="EndpointReference"/> can be used to resolve the address of the endpoint in <see cref="WithEnvironment{T}(IResourceBuilder{T}, Action{EnvironmentCallbackContext})"/>.
625public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name) where T : IResourceWithEndpoints
637/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
638public static IResourceBuilder<T> AsHttp2Service<T>(this IResourceBuilder<T> builder) where T : IResourceWithEndpoints
650/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
651public static IResourceBuilder<T> ExcludeFromManifest<T>(this IResourceBuilder<T> builder) where T : IResource
664/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
669/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> also results
672/// <para>The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method can be used to associate
685public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency) where T : IResourceWithWaitSupport
705var parentBuilder = builder.ApplicationBuilder.CreateResourceBuilder(dependencyResourceWithParent.Parent);
721/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
740public static IResourceBuilder<T> WaitForCompletion<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, int exitCode = 0) where T : IResourceWithWaitSupport
766/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
769/// The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method is used in conjunction with
770/// the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> to associate a resource
771/// registered in the application hosts dependency injection container. The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/>
796public static IResourceBuilder<T> WithHealthCheck<T>(this IResourceBuilder<T> builder, string key) where T : IResource
819/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
840public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints
853internal static IResourceBuilder<T> WithHttpHealthCheckInternal<T>(this IResourceBuilder<T> builder, string desiredScheme, string endpointName, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints
914/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
935public static IResourceBuilder<T> WithHttpsHealthCheck<T>(this IResourceBuilder<T> builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints
977/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
983public static IResourceBuilder<T> WithCommand<T>(
984this IResourceBuilder<T> builder,
1034public static IResourceBuilder<T> WithRelationship<T>(
1035this IResourceBuilder<T> builder,
Aspire.Hosting.Azure (56)
AzureBicepResourceExtensions.cs (47)
22/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
23public static IResourceBuilder<AzureBicepResource> AddBicepTemplate(this IDistributedApplicationBuilder builder, [ResourceName] string name, string bicepFile)
39/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
40public static IResourceBuilder<AzureBicepResource> AddBicepTemplateString(this IDistributedApplicationBuilder builder, [ResourceName] string name, string bicepContent)
55public static BicepOutputReference GetOutput(this IResourceBuilder<AzureBicepResource> builder, string name)
66public static BicepSecretOutputReference GetSecretOutput(this IResourceBuilder<AzureBicepResource> builder, string name)
78/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
79public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, BicepOutputReference bicepOutputReference)
95/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
96public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, BicepSecretOutputReference bicepOutputReference)
111/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
112public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name)
127/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
128public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, string value)
143/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
144public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, IEnumerable<string> value)
159/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
160public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, JsonNode value)
175/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
176public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, Func<object?> valueCallback)
191/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
192public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value)
205/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
206public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, ParameterResource value)
221/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
222public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<IResourceWithConnectionString> value)
237/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
238public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, BicepOutputReference value)
253/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
254public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, ReferenceExpression value)
269/// <returns>An <see cref="IResourceBuilder{T}"/>.</returns>
270public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, EndpointReference value)
Aspire.Hosting.Azure.AppConfiguration (2)
Aspire.Hosting.Azure.AppContainers (16)
ContainerAppExtensions.cs (12)
26/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> extension method
28/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> method is used
29/// in conjunction with the <see cref="AzureContainerAppContainerExtensions.PublishAsAzureContainerApp{T}(IResourceBuilder{T}, Action{AzureResourceInfrastructure, ContainerApp})"/>
31/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> method takes
43/// passing them to the <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/>
44/// method via the <see cref="AzureContainerAppContainerExtensions.PublishAsAzureContainerApp{T}(IResourceBuilder{T}, Action{AzureResourceInfrastructure, ContainerApp})"/>
58public static void ConfigureCustomDomain(this ContainerApp app, IResourceBuilder<ParameterResource> customDomain, IResourceBuilder<ParameterResource> certificateName)
Aspire.Hosting.Azure.ApplicationInsights (5)
Aspire.Hosting.Azure.CognitiveServices (5)
Aspire.Hosting.Azure.CosmosDB (17)
Aspire.Hosting.Azure.EventHubs (15)
Aspire.Hosting.Azure.Functions (11)
Aspire.Hosting.Azure.KeyVault (2)
Aspire.Hosting.Azure.OperationalInsights (2)
Aspire.Hosting.Azure.PostgreSQL (30)
Aspire.Hosting.Azure.Redis (21)
Aspire.Hosting.Azure.Search (2)
Aspire.Hosting.Azure.ServiceBus (9)
Aspire.Hosting.Azure.SignalR (2)
Aspire.Hosting.Azure.Sql (23)
Aspire.Hosting.Azure.Storage (28)
AzureStorageExtensions.cs (28)
27public static IResourceBuilder<AzureStorageResource> AddAzureStorage(this IDistributedApplicationBuilder builder, [ResourceName] string name)
88/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
89public static IResourceBuilder<AzureStorageResource> RunAsEmulator(this IResourceBuilder<AzureStorageResource> builder, Action<IResourceBuilder<AzureStorageEmulatorResource>>? configureContainer = null)
132var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
158public static IResourceBuilder<AzureStorageEmulatorResource> WithDataBindMount(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? path = null, bool isReadOnly = false)
168public static IResourceBuilder<AzureStorageEmulatorResource> WithDataVolume(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? name = null, bool isReadOnly = false)
177public static IResourceBuilder<AzureStorageEmulatorResource> WithBlobPort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
191public static IResourceBuilder<AzureStorageEmulatorResource> WithQueuePort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
205public static IResourceBuilder<AzureStorageEmulatorResource> WithTablePort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
216/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
218/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureBlobStorageResource"/>.</returns>
219public static IResourceBuilder<AzureBlobStorageResource> AddBlobs(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
228/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
230/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureTableStorageResource"/>.</returns>
231public static IResourceBuilder<AzureTableStorageResource> AddTables(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
240/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
242/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureQueueStorageResource"/>.</returns>
243public static IResourceBuilder<AzureQueueStorageResource> AddQueues(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
Aspire.Hosting.Azure.Tests (168)
AzureBicepResourceTests.cs (83)
31var bicepResource = builder.AddBicepTemplateString("mytemplate", "content")
40public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensions =>
43private static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> CreateAllAzureExtensions(string resourceName)
82public void AzureExtensionsAutomaticallyAddAzureProvisioning(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource)
94public void BicepResourcesAreIdempotent(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource)
97var azureResourceBuilder = addAzureResource(builder);
110public static TheoryData<Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>>> AzureExtensionsWithHyphen =>
115public void AzureResourcesProduceValidBicep(Func<IDistributedApplicationBuilder, IResourceBuilder<IResource>> addAzureResource)
118var azureResourceBuilder = addAzureResource(builder);
136var bicepResource = builder.AddBicepTemplateString("templ", "content");
148var bicepResource = builder.AddBicepTemplateString("templ", "content");
160var bicepResource = builder.AddBicepTemplateString("templ", "content");
170var bicepResource = builder.AddBicepTemplateString("templ", "content");
180var param = builder.AddParameter("p1");
182var b2 = builder.AddBicepTemplateString("temp2", "content");
224var cosmos = builder.AddAzureCosmosDB("cosmos").RunAsEmulator(e =>
246var cosmos = builder.AddAzureCosmosDB("cosmos")
340var cosmos = builder.AddAzureCosmosDB("cosmos")
433var appConfig = builder.AddAzureAppConfiguration("appConfig");
499var appInsights = builder.AddAzureApplicationInsights("appInsights");
556var appInsights = builder.AddAzureApplicationInsights("appInsights");
621var law = builder.AddAzureLogAnalyticsWorkspace("mylaw");
622var appInsights = builder.AddAzureApplicationInsights("appInsights", law);
679var logAnalyticsWorkspace = builder.AddAzureLogAnalyticsWorkspace("logAnalyticsWorkspace");
721var appInsights = builder.AddAzureApplicationInsights("ai");
725var serviceA = builder.AddProject<ProjectA>("serviceA", o => o.ExcludeLaunchProfile = true)
738var infrastructure1 = builder.AddAzureInfrastructure("infrastructure1", (infrastructure) =>
760var skuName = builder.AddParameter("skuName");
763var infrastructure1 = builder.AddAzureInfrastructure("infrastructure1", (infrastructure) =>
799var skuName = builder.AddParameter("skuName");
802var infrastructure1 = builder.AddAzureInfrastructure("infrastructure1", (infrastructure) =>
838var redis = builder.AddRedis("cache")
905var mykv = builder.AddAzureKeyVault("mykv");
967var mykv = builder.AddAzureKeyVault("mykv");
1029var signalr = builder.AddAzureSignalR("signalr");
1102var sql = builder.AddSqlServer("sql").AsAzureSqlDatabase();
1196var sql = builder.AddSqlServer("sql").AsAzureSqlDatabase();
1279var usr = builder.AddParameter("usr");
1280var pwd = builder.AddParameter("pwd", secret: true);
1283var postgres = builder.AddPostgres("postgres", usr, pwd).AsAzurePostgresFlexibleServer();
1397var usr = builder.AddParameter("usr");
1398var pwd = builder.AddParameter("pwd", secret: true);
1401var postgres = builder.AddPostgres("postgres", usr, pwd).AsAzurePostgresFlexibleServer();
1506var usr = builder.AddParameter("usr");
1507var pwd = builder.AddParameter("pwd", secret: true);
1510var postgres = builder.AddPostgres("postgres", usr, pwd).PublishAsAzurePostgresFlexibleServer();
1543var postgres = builder.AddPostgres("postgres1")
1561var param = builder.AddParameter("param");
1605var serviceBus = builder.AddAzureServiceBus("sb");
1705var wps = builder.AddAzureWebPubSub("wps1");
1772var wps = builder.AddAzureWebPubSub("wps1")
1840var storage = builder.AddAzureStorage("storage").RunAsEmulator(e =>
1849var blob = storage.AddBlobs("blob");
1850var queue = storage.AddQueues("queue");
1851var table = storage.AddTables("table");
1878var storagesku = builder.AddParameter("storagesku");
1879var storage = builder.AddAzureStorage("storage")
1986var blob = storage.AddBlobs("blob");
2001var queue = storage.AddQueues("queue");
2016var table = storage.AddTables("table");
2036var storagesku = builder.AddParameter("storagesku");
2037var storage = builder.AddAzureStorage("storage")
2145var blob = storage.AddBlobs("blob");
2160var queue = storage.AddQueues("queue");
2175var table = storage.AddTables("table");
2195var storagesku = builder.AddParameter("storagesku");
2196var storage = builder.AddAzureStorage("storage")
2303var blob = storage.AddBlobs("blob");
2318var queue = storage.AddQueues("queue");
2333var table = storage.AddTables("table");
2353var storagesku = builder.AddParameter("storagesku");
2354var storage = builder.AddAzureStorage("storage")
2462var blob = storage.AddBlobs("blob");
2477var queue = storage.AddQueues("queue");
2492var table = storage.AddTables("table");
2513var sku = builder.AddParameter("searchSku");
2514var search = builder.AddAzureSearch("search")
2608var ai = builder.AddAzureApplicationInsights("ai").PublishAsConnectionString();
2609var serviceBus = builder.AddAzureServiceBus("servicebus").PublishAsConnectionString();
2611var serviceA = builder.AddProject<ProjectA>("serviceA", o => o.ExcludeLaunchProfile = true)
2636var openai = builder.AddAzureOpenAI("openai")
2752var provisioningResource = builder.AddAzureInfrastructure("infrastructure", r =>
2766var provisioningResource = builder.AddAzureInfrastructure("infrastructure", r =>
Aspire.Hosting.Azure.WebPubSub (9)
Aspire.Hosting.Containers.Tests (32)
WithDockerfileTests.cs (20)
28var parameter = builder.AddParameter("secret", secret: true);
164var parameter = builder.AddParameter("message");
167var container = builder.AddContainer("testcontainer", "testimage")
212var parameter = builder.AddParameter("message");
215var container = builder.AddDockerfile("testcontainer", tempContextPath, tempDockerfilePath, "runner")
259var parameter = builder.AddParameter("secret", secret: true);
262var container = builder.AddContainer("testcontainer", "testimage")
305var parameter = builder.AddParameter("secret", secret: true);
308var container = builder.AddDockerfile("testcontainer", tempContextPath, tempDockerfilePath)
348var parameter = builder.AddParameter("message");
419var parameter = builder.AddParameter("message");
596var container = builder.AddContainer("mycontainer", "myimage");
617var container = builder.AddContainer("mycontainer", "myimage")
633var container = builder.AddDockerfile("mycontainer", tempContextPath);
648var container = builder.AddContainer("mycontainer", "myimage")
664var container = builder.AddDockerfile("mycontainer", tempContextPath, "Dockerfile");
679var container = builder.AddContainer("mycontainer", "myimage")
695var container = builder.AddDockerfile("mycontainer", tempContextPath, "Otherdockerfile");
710var container = builder.AddContainer("mycontainer", "myimage")
726var container = builder.AddDockerfile("mycontainer", tempContextPath, tempDockerfilePath);
Aspire.Hosting.Dapr (20)
Aspire.Hosting.Dapr.Tests (3)
Aspire.Hosting.Elasticsearch (9)
Aspire.Hosting.Elasticsearch.Tests (14)
Aspire.Hosting.Garnet (20)
GarnetBuilderExtensions.cs (20)
54/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
55public static IResourceBuilder<GarnetResource> AddGarnet(this IDistributedApplicationBuilder builder, [ResourceName] string name,
89/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.:
102/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
103public static IResourceBuilder<GarnetResource> WithDataVolume(this IResourceBuilder<GarnetResource> builder,
122/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.:
135/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
136public static IResourceBuilder<GarnetResource> WithDataBindMount(this IResourceBuilder<GarnetResource> builder,
155/// Use with <see cref="WithDataBindMount(IResourceBuilder{GarnetResource}, string, bool)"/>
156/// or <see cref="WithDataVolume(IResourceBuilder{GarnetResource}, string?, bool)"/> to persist Garnet data across sessions with custom persistence configuration, e.g.:
166/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
168public static IResourceBuilder<GarnetResource> WithPersistence(this IResourceBuilder<GarnetResource> builder,
176/// Use with <see cref="WithDataBindMount(IResourceBuilder{GarnetResource}, string, bool)"/>
177/// or <see cref="WithDataVolume(IResourceBuilder{GarnetResource}, string?, bool)"/> to persist Garnet data across sessions with custom persistence configuration, e.g.:
186/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
187public static IResourceBuilder<GarnetResource> WithPersistence(this IResourceBuilder<GarnetResource> builder,
Aspire.Hosting.Garnet.Tests (18)
Aspire.Hosting.Kafka (16)
Aspire.Hosting.Kafka.Tests (14)
Aspire.Hosting.Keycloak (13)
Aspire.Hosting.Keycloak.Tests (13)
Aspire.Hosting.Milvus (20)
MilvusBuilderExtensions.cs (20)
41/// <returns>A reference to the <see cref="IResourceBuilder{MilvusServerResource}"/>.</returns>
42public static IResourceBuilder<MilvusServerResource> AddMilvus(this IDistributedApplicationBuilder builder,
44IResourceBuilder<ParameterResource>? apiKey = null,
93/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
94public static IResourceBuilder<MilvusDatabaseResource> AddDatabase(this IResourceBuilder<MilvusServerResource> builder, [ResourceName] string name, string? databaseName = null)
129/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
130public static IResourceBuilder<T> WithAttu<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<AttuResource>>? configureContainer = null, string? containerName = null) where T : MilvusServerResource
137var resourceBuilder = builder.ApplicationBuilder.AddResource(attuContainer)
155/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
156public static IResourceBuilder<MilvusServerResource> WithDataVolume(this IResourceBuilder<MilvusServerResource> builder, string? name = null, bool isReadOnly = false)
168/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
169public static IResourceBuilder<MilvusServerResource> WithDataBindMount(this IResourceBuilder<MilvusServerResource> builder, string source, bool isReadOnly = false)
181/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
182public static IResourceBuilder<MilvusServerResource> WithConfigurationBindMount(this IResourceBuilder<MilvusServerResource> builder, string configurationFilePath)
Aspire.Hosting.Milvus.Tests (33)
Aspire.Hosting.MongoDB (25)
MongoDBBuilderExtensions.cs (25)
33/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
34public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port)
47/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
48public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistributedApplicationBuilder builder,
51IResourceBuilder<ParameterResource>? userName = null,
52IResourceBuilder<ParameterResource>? password = null)
95/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
96public static IResourceBuilder<MongoDBDatabaseResource> AddDatabase(this IResourceBuilder<MongoDBServerResource> builder, [ResourceName] string name, string? databaseName = null)
135/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
136public static IResourceBuilder<T> WithMongoExpress<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<MongoExpressContainerResource>>? configureContainer = null, string? containerName = null) where T : MongoDBServerResource
143var resourceBuilder = builder.ApplicationBuilder.AddResource(mongoExpressContainer)
161public static IResourceBuilder<MongoExpressContainerResource> WithHostPort(this IResourceBuilder<MongoExpressContainerResource> builder, int? port)
177/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
178public static IResourceBuilder<MongoDBServerResource> WithDataVolume(this IResourceBuilder<MongoDBServerResource> builder, string? name = null, bool isReadOnly = false)
191/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
192public static IResourceBuilder<MongoDBServerResource> WithDataBindMount(this IResourceBuilder<MongoDBServerResource> builder, string source, bool isReadOnly = false)
206/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
207public static IResourceBuilder<MongoDBServerResource> WithInitBindMount(this IResourceBuilder<MongoDBServerResource> builder, string source, bool isReadOnly = true)
Aspire.Hosting.MongoDB.Tests (29)
Aspire.Hosting.MySql (22)
MySqlBuilderExtensions.cs (22)
28/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
29public static IResourceBuilder<MySqlServerResource> AddMySql(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder<ParameterResource>? password = null, int? port = null)
70/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
71public static IResourceBuilder<MySqlDatabaseResource> AddDatabase(this IResourceBuilder<MySqlServerResource> builder, [ResourceName] string name, string? databaseName = null)
93/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
94public static IResourceBuilder<T> WithPhpMyAdmin<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<PhpMyAdminContainerResource>>? configureContainer = null, string? containerName = null) where T : MySqlServerResource
108var phpMyAdminContainerBuilder = builder.ApplicationBuilder.AddResource(phpMyAdminContainer)
185public static IResourceBuilder<PhpMyAdminContainerResource> WithHostPort(this IResourceBuilder<PhpMyAdminContainerResource> builder, int? port)
201/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
202public static IResourceBuilder<MySqlServerResource> WithDataVolume(this IResourceBuilder<MySqlServerResource> builder, string? name = null, bool isReadOnly = false)
215/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
216public static IResourceBuilder<MySqlServerResource> WithDataBindMount(this IResourceBuilder<MySqlServerResource> builder, string source, bool isReadOnly = false)
230/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
231public static IResourceBuilder<MySqlServerResource> WithInitBindMount(this IResourceBuilder<MySqlServerResource> builder, string source, bool isReadOnly = true)
Aspire.Hosting.MySql.Tests (39)
Aspire.Hosting.Nats (18)
NatsBuilderExtensions.cs (18)
30/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
31public static IResourceBuilder<NatsServerResource> AddNats(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port)
44/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
45public static IResourceBuilder<NatsServerResource> AddNats(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null,
46IResourceBuilder<ParameterResource>? userName = null,
47IResourceBuilder<ParameterResource>? password = null)
109/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
111public static IResourceBuilder<NatsServerResource> WithJetStream(this IResourceBuilder<NatsServerResource> builder, string? srcMountPath = null)
128/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
129public static IResourceBuilder<NatsServerResource> WithJetStream(this IResourceBuilder<NatsServerResource> builder)
142/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
143public static IResourceBuilder<NatsServerResource> WithDataVolume(this IResourceBuilder<NatsServerResource> builder, string? name = null, bool isReadOnly = false)
158/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
159public static IResourceBuilder<NatsServerResource> WithDataBindMount(this IResourceBuilder<NatsServerResource> builder, string source, bool isReadOnly = false)
Aspire.Hosting.Nats.Tests (29)
Aspire.Hosting.NodeJs (6)
Aspire.Hosting.NodeJs.Tests (4)
Aspire.Hosting.Oracle (18)
Aspire.Hosting.Oracle.Tests (26)
Aspire.Hosting.Orleans (20)
Aspire.Hosting.PostgreSQL (39)
PostgresBuilderExtensions.cs (39)
30/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
34/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
40public static IResourceBuilder<PostgresServerResource> AddPostgres(this IDistributedApplicationBuilder builder,
42IResourceBuilder<ParameterResource>? userName = null,
43IResourceBuilder<ParameterResource>? password = null,
97/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
101/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
105/// Note that by default calling <see cref="AddDatabase(IResourceBuilder{PostgresServerResource}, string, string?)"/>
107/// will create the database. As a result if <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
111public static IResourceBuilder<PostgresDatabaseResource> AddDatabase(this IResourceBuilder<PostgresServerResource> builder, [ResourceName] string name, string? databaseName = null)
133/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
134public static IResourceBuilder<T> WithPgAdmin<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<PgAdminContainerResource>>? configureContainer = null, string? containerName = null) where T : PostgresServerResource
140var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgAdminResource);
149var pgAdminContainerBuilder = builder.ApplicationBuilder.AddResource(pgAdminContainer)
221public static IResourceBuilder<PgAdminContainerResource> WithHostPort(this IResourceBuilder<PgAdminContainerResource> builder, int? port)
237public static IResourceBuilder<PgWebContainerResource> WithHostPort(this IResourceBuilder<PgWebContainerResource> builder, int? port)
269/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
270public static IResourceBuilder<PostgresServerResource> WithPgWeb(this IResourceBuilder<PostgresServerResource> builder, Action<IResourceBuilder<PgWebContainerResource>>? configureContainer = null, string? containerName = null)
274var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgWebResource);
283var pgwebContainerBuilder = builder.ApplicationBuilder.AddResource(pgwebContainer)
358/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
359public static IResourceBuilder<PostgresServerResource> WithDataVolume(this IResourceBuilder<PostgresServerResource> builder, string? name = null, bool isReadOnly = false)
373/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
374public static IResourceBuilder<PostgresServerResource> WithDataBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = false)
388/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
389public static IResourceBuilder<PostgresServerResource> WithInitBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = true)
Aspire.Hosting.PostgreSQL.Tests (54)
Aspire.Hosting.Python (10)
Aspire.Hosting.Python.Tests (4)
Aspire.Hosting.Qdrant (13)
Aspire.Hosting.Qdrant.Tests (25)
Aspire.Hosting.RabbitMQ (20)
Aspire.Hosting.RabbitMQ.Tests (23)
Aspire.Hosting.Redis (39)
RedisBuilderExtensions.cs (39)
29/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
33/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
39public static IResourceBuilder<RedisResource> AddRedis(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null)
73/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="RedisResource"/>.</param>
77public static IResourceBuilder<RedisResource> WithRedisCommander(this IResourceBuilder<RedisResource> builder, Action<IResourceBuilder<RedisCommanderResource>>? configureContainer = null, string? containerName = null)
83var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource);
92var resourceBuilder = builder.ApplicationBuilder.AddResource(resource)
140/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="RedisResource"/>.</param>
144public static IResourceBuilder<RedisResource> WithRedisInsight(this IResourceBuilder<RedisResource> builder, Action<IResourceBuilder<RedisInsightResource>>? configureContainer = null, string? containerName = null)
150var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource);
159var resourceBuilder = builder.ApplicationBuilder.AddResource(resource)
327public static IResourceBuilder<RedisCommanderResource> WithHostPort(this IResourceBuilder<RedisCommanderResource> builder, int? port)
343public static IResourceBuilder<RedisInsightResource> WithHostPort(this IResourceBuilder<RedisInsightResource> builder, int? port)
357/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.:
370/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
371public static IResourceBuilder<RedisResource> WithDataVolume(this IResourceBuilder<RedisResource> builder, string? name = null, bool isReadOnly = false)
387/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.:
400/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
401public static IResourceBuilder<RedisResource> WithDataBindMount(this IResourceBuilder<RedisResource> builder, string source, bool isReadOnly = false)
418/// Use with <see cref="WithDataBindMount(IResourceBuilder{RedisResource}, string, bool)"/>
419/// or <see cref="WithDataVolume(IResourceBuilder{RedisResource}, string?, bool)"/> to persist Redis data across sessions with custom persistence configuration, e.g.:
429/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
430public static IResourceBuilder<RedisResource> WithPersistence(this IResourceBuilder<RedisResource> builder, TimeSpan? interval = null, long keysChangedThreshold = 1)
449/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
451public static IResourceBuilder<RedisInsightResource> WithDataVolume(this IResourceBuilder<RedisInsightResource> builder, string? name = null)
463/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
464public static IResourceBuilder<RedisInsightResource> WithDataBindMount(this IResourceBuilder<RedisInsightResource> builder, string source)
Aspire.Hosting.Redis.Tests (42)
Aspire.Hosting.Seq (7)
Aspire.Hosting.SqlServer (12)
Aspire.Hosting.SqlServer.Tests (28)
Aspire.Hosting.Testing (4)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (181)
Dcp\ApplicationExecutorTests.cs (13)
108var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
140var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
172var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
205var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
365(Action<IResourceBuilder<ExecutableResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [
394var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo");
809(Action<IResourceBuilder<ContainerResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [
833var ctr = builder.AddContainer("database", "image");
976var container = builder.AddContainer("database", "image");
977var exe = builder.AddExecutable("node", "node.exe", ".");
978var project = builder.AddProject<TestProject>("project");
996var parentResource = builder.AddContainer("database", "image");
997var childResource = builder.AddResource(new CustomChildResource("child", parentResource.Resource));
ResourceExtensionsTests.cs (22)
16var parent = builder.AddResource(new ParentResource("parent"));
27var parent = builder.AddResource(new ParentResource("parent"))
39var parent = builder.AddResource(new ParentResource("parent"))
51var parent = builder.AddResource(new ParentResource("parent"))
63var parent = builder.AddResource(new ParentResource("parent"));
74var parent = builder.AddResource(new ParentResource("parent"))
86var parent = builder.AddResource(new ParentResource("parent"))
89var child = builder.AddResource(new ChildResource("child", parent.Resource))
101var parent = builder.AddResource(new ParentResource("parent"))
104var child = builder.AddResource(new ChildResource("child", parent.Resource));
115var parent = builder.AddResource(new ParentResource("parent"))
118var child = builder.AddResource(new ChildResource("child", parent.Resource))
130var parent = builder.AddResource(new ParentResource("parent"))
133var child = builder.AddResource(new ChildResource("child", parent: parent.Resource))
136var grandchild = builder.AddResource(new ChildResource("grandchild", parent: child.Resource))
148var container = builder.AddContainer("grafana", "grafana/grafana", "latest").WithImageSHA256("1adbcc2df3866ff5ec1d836e9d2220c904c7f98901b918d3cc5e1118ab1af991");
158var container = builder.AddContainer("grafana", "grafana/grafana", "10.3.1");
168var container = builder.AddContainer("elasticsearch", "library/elasticsearch", "8.14.0")
202var passwordParameter = builder.AddParameter("ElasticPassword");
204var container = builder.AddContainer("elasticsearch", "library/elasticsearch", "8.14.0")
235var passwordParameter = builder.AddParameter("ElasticPassword");
237var container = builder.AddContainer("elasticsearch", "library/elasticsearch", "8.14.0")
WaitForTests.cs (21)
20var throwingResource = builder.AddContainer("throwingresource", "doesnotmatter")
22var dependingContainerResource = builder.AddContainer("dependingcontainerresource", "doesnotmatter")
24var dependingExecutableResource = builder.AddExecutable("dependingexecutableresource", "doesnotmatter", "alsodoesntmatter")
43var resource = builder.AddResource(new CustomResource("test"));
64var parentResourceBuilder = builder.AddResource(new CustomResource("parent"));
65var childResourceBuilder = builder.AddResource(new CustomChildResource("child", parentResourceBuilder.Resource));
88var dependency = builder.AddResource(new CustomResource("test"));
89var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
129var dependency = builder.AddResource(new CustomResource("test"));
130var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
177var dependency = builder.AddResource(new CustomResource("test"));
178var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
225var dependency = builder.AddResource(new CustomResource("test"));
226var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
272var dependency = builder.AddResource(new CustomResource("test"))
275var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
307var dependency = builder.AddResource(new CustomResource("test"));
309var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
347var parentResource = builder.AddResource(new CustomResource("parent"));
348var childResource = builder.AddResource(new CustomChildResource("child", parentResource.Resource));
349var containerResource = builder.AddContainer("container", "image", "tag")
WithEndpointTests.cs (19)
22var projectA = builder.AddProject<ProjectA>("projecta")
39var projectA = builder.AddProject<ProjectA>("projecta")
74var projectA = builder.AddProject<ProjectA>("projecta")
111var projectA = builder.AddProject<ProjectA>("projecta")
129var projectA = builder.AddProject<ProjectA>("projecta")
146var projectA = builder.AddProject<ProjectA>("projecta").WithEndpoint("mybinding", endpoint =>
230var container = builder.AddContainer("app", "image")
248var container = builder.AddContainer("app", "image")
269var container = builder.AddContainer("app", "image")
297var container = builder.AddContainer("app", "image")
324var container = builder.AddContainer("app", "image")
351var container = builder.AddContainer("app", "image")
378var container = builder.AddContainer("app", "image")
405var container = builder.AddContainer("app", "image")
432var container = builder.AddContainer("app", "image")
459var project = builder.AddProject<TestProject>("proj")
521var project = builder.AddProject<TestProject>("proj")
557var container0 = builder.AddContainer("app0", "image")
560var container1 = builder.AddContainer("app1", "image")
Aspire.Hosting.Valkey (15)
ValkeyBuilderExtensions.cs (15)
54/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
55public static IResourceBuilder<ValkeyResource> AddValkey(this IDistributedApplicationBuilder builder,
94/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.:
101/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
102public static IResourceBuilder<ValkeyResource> WithDataVolume(this IResourceBuilder<ValkeyResource> builder,
125/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.:
132/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
133public static IResourceBuilder<ValkeyResource> WithDataBindMount(this IResourceBuilder<ValkeyResource> builder,
152/// Use with <see cref="WithDataBindMount(IResourceBuilder{ValkeyResource}, string, bool)"/>
153/// or <see cref="WithDataVolume(IResourceBuilder{ValkeyResource}, string?, bool)"/> to persist Valkey data across sessions with custom persistence configuration, e.g.:
160/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
161public static IResourceBuilder<ValkeyResource> WithPersistence(this IResourceBuilder<ValkeyResource> builder,
Aspire.Hosting.Valkey.Tests (14)
Aspire.Playground.Tests (1)
AzureContainerApps.AppHost (6)
AzureFunctionsEndToEnd.AppHost (5)
AzureSearch.AppHost (1)
AzureStorageEndToEnd.AppHost (3)
BicepSample.AppHost (19)
CdkSample.AppHost (19)
CosmosEndToEnd.AppHost (1)
CustomResources.AppHost (2)
Dapr.AppHost (3)
DatabaseMigration.AppHost (1)
Elasticsearch.AppHost (1)
EventHubs.AppHost (2)
KafkaBasic.AppHost (1)
Keycloak.AppHost (2)
MilvusPlayground.AppHost (1)
Mongo.AppHost (1)
MySqlDb.AppHost (1)
Nats.AppHost (1)
OpenAIEndToEnd.AppHost (1)
OracleEndToEnd.AppHost (2)
Orleans.AppHost (3)
ParameterEndToEnd.AppHost (2)
PostgresEndToEnd.AppHost (13)
ProxylessEndToEnd.AppHost (1)
Qdrant.AppHost (1)
Redis.AppHost (3)
Seq.AppHost (1)
SignalR.AppHost (1)
SqlServerEndToEnd.AppHost (5)
Stress.AppHost (13)
TestProject.AppHost (8)
TestShop.AppHost (6)
WaitForSandbox.AppHost (3)
WebPubSub.AppHost (2)
WithDockerfile.AppHost (2)