2077 references to IResourceBuilder
Aspire.Hosting (306)
ContainerResourceBuilderExtensions.cs (87)
21/// <returns>The <see cref="IResourceBuilder{T}"/> for chaining.</returns>
22public static IResourceBuilder<ContainerResource> AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image)
40/// <returns>The <see cref="IResourceBuilder{T}"/> for chaining.</returns>
41public static IResourceBuilder<ContainerResource> AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image, string tag)
55/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
56public static IResourceBuilder<T> WithVolume<T>(this IResourceBuilder<T> builder, string? name, string target, bool isReadOnly = false) where T : ContainerResource
71/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
72public static IResourceBuilder<T> WithVolume<T>(this IResourceBuilder<T> builder, string target) where T : ContainerResource
89/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
90public static IResourceBuilder<T> WithBindMount<T>(this IResourceBuilder<T> builder, string source, string target, bool isReadOnly = false) where T : ContainerResource
106/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
107public static IResourceBuilder<T> WithEntrypoint<T>(this IResourceBuilder<T> builder, string entrypoint) where T : ContainerResource
122/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
123public static IResourceBuilder<T> WithImageTag<T>(this IResourceBuilder<T> builder, string tag) where T : ContainerResource
143/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
144public static IResourceBuilder<T> WithImageRegistry<T>(this IResourceBuilder<T> builder, string? registry) where T : ContainerResource
164/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
165public static IResourceBuilder<T> WithImage<T>(this IResourceBuilder<T> builder, string image, string? tag = null) where T : ContainerResource
221/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
222public static IResourceBuilder<T> WithImageSHA256<T>(this IResourceBuilder<T> builder, string sha256) where T : ContainerResource
240/// 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.
245/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
246public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, params string[] args) where T : ContainerResource
257/// 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.
262/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
263public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Action<ContainerRuntimeArgsCallbackContext> callback) where T : ContainerResource
279/// 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.
284/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
285public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Func<ContainerRuntimeArgsCallbackContext, Task> callback) where T : ContainerResource
300/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
312public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder, ContainerLifetime lifetime) where T : ContainerResource
319private static IResourceBuilder<T> ThrowResourceIsNotContainer<T>(IResourceBuilder<T> builder) where T : ContainerResource
328/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
329public static IResourceBuilder<T> PublishAsContainer<T>(this IResourceBuilder<T> builder) where T : ContainerResource
340/// <param name="builder">The <see cref="IResourceBuilder{T}"/>.</param>
344/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
357/// When generating the manifest for deployment tools, the <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>
373public static IResourceBuilder<T> WithDockerfile<T>(this IResourceBuilder<T> builder, string contextPath, string? dockerfilePath = null, string? stage = null) where T : ContainerResource
400/// <returns>A <see cref="IResourceBuilder{ContainerResource}"/>.</returns>
423public static IResourceBuilder<ContainerResource> AddDockerfile(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, string? dockerfilePath = null, string? stage = null)
445/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
446public static IResourceBuilder<T> WithContainerName<T>(this IResourceBuilder<T> builder, string name) where T : ContainerResource
461/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
463/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, object)"/> is
464/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
468/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, object)"/> extension method
470/// <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
485public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, object? value) where T : ContainerResource
509/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
511/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is
512/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
516/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method
518/// <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
535public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
556/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
558/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is
559/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
563/// The <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method
582public static IResourceBuilder<T> WithBuildSecret<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
607/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
615public static IResourceBuilder<T> WithEndpointProxySupport<T>(this IResourceBuilder<T> builder, bool proxyEnabled) where T : ContainerResource
ExecutableResourceBuilderExtensions.cs (15)
22/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
23public static IResourceBuilder<ExecutableResource> AddExecutable(this IDistributedApplicationBuilder builder, [ResourceName] string name, string command, string workingDirectory, params string[]? args)
41/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
42public static IResourceBuilder<ExecutableResource> AddExecutable(this IDistributedApplicationBuilder builder, [ResourceName] string name, string command, string workingDirectory, params object[]? args)
67/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
68public static IResourceBuilder<T> PublishAsDockerFile<T>(this IResourceBuilder<T> builder) where T : ExecutableResource
81/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
82public static IResourceBuilder<T> PublishAsDockerFile<T>(this IResourceBuilder<T> builder, IEnumerable<DockerBuildArg>? buildArgs) where T : ExecutableResource
108/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
109public static IResourceBuilder<T> PublishAsDockerFile<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<ContainerResource>>? configure)
127var cb = builder.ApplicationBuilder.AddResource(container);
ParameterResourceBuilderExtensions.cs (14)
25public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, bool secret = false)
50public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, string value, bool publishValueAsDefault = false, bool secret = false)
71public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, string name, Func<string> valueGetter, bool publishValueAsDefault = false, bool secret = false)
104public static IResourceBuilder<ParameterResource> AddParameterFromConfiguration(this IDistributedApplicationBuilder builder, string name, string configurationKey, bool secret = false)
132public static IResourceBuilder<ParameterResource> AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, ParameterDefault value, bool secret = false, bool persist = false)
159internal static IResourceBuilder<T> AddParameter<T>(this IDistributedApplicationBuilder builder,
214/// 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)"/>
221public static IResourceBuilder<IResourceWithConnectionString> AddConnectionString(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? environmentVariableName = null)
240/// <returns>The configured <see cref="IResourceBuilder{T}"/>.</returns>
241public static IResourceBuilder<T> PublishAsConnectionString<T>(this IResourceBuilder<T> builder)
253/// <param name="builder">The <see cref="IResourceBuilder{T}"/>.</param>
254public static void ConfigureConnectionStringManifestPublisher(IResourceBuilder<IResourceWithConnectionString> builder)
ProjectResourceBuilderExtensions.cs (34)
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)
542/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
547/// reverse proxy for each process. When <see cref="WithReplicas(IResourceBuilder{ProjectResource}, int)"/> is
564public static IResourceBuilder<ProjectResource> WithReplicas(this IResourceBuilder<ProjectResource> builder, int replicas)
576/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
585/// into the project and set to true. If the <see cref="DisableForwardedHeaders(IResourceBuilder{ProjectResource})"/>
598public static IResourceBuilder<ProjectResource> DisableForwardedHeaders(this IResourceBuilder<ProjectResource> builder)
612/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
613public static IResourceBuilder<ProjectResource> WithEndpointsInEnvironment(
614this IResourceBuilder<ProjectResource> builder, Func<EndpointAnnotation, bool> filter)
637/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
638public static IResourceBuilder<T> PublishAsDockerFile<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<ContainerResource>>? configure = null)
656var cb = builder.ApplicationBuilder.AddResource(container);
694private static void SetAspNetCoreUrls(this IResourceBuilder<ProjectResource> builder)
741private static void SetBothPortsEnvVariables(this IResourceBuilder<ProjectResource> builder)
750private static void SetOnePortsEnvVariable(this IResourceBuilder<ProjectResource> builder, EnvironmentCallbackContext context, string portEnvVariable, string scheme)
785private static void SetKestrelUrlOverrideEnvVariables(this IResourceBuilder<ProjectResource> builder)
ResourceBuilderExtensions.cs (130)
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>
472/// The <see cref="WithEndpoint{T}(IResourceBuilder{T}, string, Action{EndpointAnnotation}, bool)"/> method allows
493public static IResourceBuilder<T> WithEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string endpointName, Action<EndpointAnnotation> callback, bool createIfNotExists = true) where T : IResourceWithEndpoints
524/// Exposes an endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string)"/>.
536/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
539public 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
574/// Exposes an HTTP endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string)"/>.
584/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
586public 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
594/// Exposes an HTTPS endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string)"/>.
604/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
606public 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
618/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
619public static IResourceBuilder<T> WithExternalHttpEndpoints<T>(this IResourceBuilder<T> builder) where T : IResourceWithEndpoints
640/// 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).
641/// The <see cref="EndpointReference"/> can be used to resolve the address of the endpoint in <see cref="WithEnvironment{T}(IResourceBuilder{T}, Action{EnvironmentCallbackContext})"/>.
647public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name) where T : IResourceWithEndpoints
659/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
660public static IResourceBuilder<T> AsHttp2Service<T>(this IResourceBuilder<T> builder) where T : IResourceWithEndpoints
672/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
673public static IResourceBuilder<T> ExcludeFromManifest<T>(this IResourceBuilder<T> builder) where T : IResource
686/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
691/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> also results
694/// <para>The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method can be used to associate
707public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency) where T : IResourceWithWaitSupport
727var parentBuilder = builder.ApplicationBuilder.CreateResourceBuilder(dependencyResourceWithParent.Parent);
742/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
757public static IResourceBuilder<T> WithExplicitStart<T>(this IResourceBuilder<T> builder) where T : IResource
769/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
788public static IResourceBuilder<T> WaitForCompletion<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, int exitCode = 0) where T : IResourceWithWaitSupport
814/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
817/// The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method is used in conjunction with
818/// the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> to associate a resource
819/// registered in the application hosts dependency injection container. The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/>
844public static IResourceBuilder<T> WithHealthCheck<T>(this IResourceBuilder<T> builder, string key) where T : IResource
867/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
888public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints
901internal static IResourceBuilder<T> WithHttpHealthCheckInternal<T>(this IResourceBuilder<T> builder, string desiredScheme, string endpointName, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints
962/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
983public static IResourceBuilder<T> WithHttpsHealthCheck<T>(this IResourceBuilder<T> builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints
1025/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
1031public static IResourceBuilder<T> WithCommand<T>(
1032this IResourceBuilder<T> builder,
1082public static IResourceBuilder<T> WithRelationship<T>(
1083this IResourceBuilder<T> builder,
1117public static IResourceBuilder<T> WithParentRelationship<T>(
1118this IResourceBuilder<T> builder,
Aspire.Hosting.Azure (64)
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 (18)
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 (36)
AzureCosmosDBExtensions.cs (34)
30/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
31public static IResourceBuilder<AzureCosmosDBResource> AddAzureCosmosDB(this IDistributedApplicationBuilder builder, [ResourceName] string name)
46/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
52public static IResourceBuilder<AzureCosmosDBResource> RunAsEmulator(this IResourceBuilder<AzureCosmosDBResource> builder, Action<IResourceBuilder<AzureCosmosDBEmulatorResource>>? configureContainer = null)
61/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
66public static IResourceBuilder<AzureCosmosDBResource> RunAsPreviewEmulator(this IResourceBuilder<AzureCosmosDBResource> builder, Action<IResourceBuilder<AzureCosmosDBEmulatorResource>>? configureContainer = null)
69private static IResourceBuilder<AzureCosmosDBResource> RunAsEmulator(this IResourceBuilder<AzureCosmosDBResource> builder, Action<IResourceBuilder<AzureCosmosDBEmulatorResource>>? configureContainer, bool useVNextPreview)
131var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
165public static IResourceBuilder<AzureCosmosDBEmulatorResource> WithDataVolume(this IResourceBuilder<AzureCosmosDBEmulatorResource> builder, string? name = null)
179public static IResourceBuilder<AzureCosmosDBEmulatorResource> WithGatewayPort(this IResourceBuilder<AzureCosmosDBEmulatorResource> builder, int? port)
196public static IResourceBuilder<AzureCosmosDBEmulatorResource> WithPartitionCount(this IResourceBuilder<AzureCosmosDBEmulatorResource> builder, int count)
216/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
218public static IResourceBuilder<AzureCosmosDBResource> AddDatabase(this IResourceBuilder<AzureCosmosDBResource> builder, string databaseName)
231/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
232public static IResourceBuilder<AzureCosmosDBDatabaseResource> AddCosmosDatabase(this IResourceBuilder<AzureCosmosDBResource> builder, [ResourceName] string name, string? databaseName = null)
253/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
254public static IResourceBuilder<AzureCosmosDBContainerResource> AddContainer(this IResourceBuilder<AzureCosmosDBDatabaseResource> builder, [ResourceName] string name, string partitionKeyPath, string? containerName = null)
279public static IResourceBuilder<AzureCosmosDBEmulatorResource> WithDataExplorer(this IResourceBuilder<AzureCosmosDBEmulatorResource> builder, int? port = null)
298/// <returns>A reference to the <see cref="IResourceBuilder{T}"/> builder.</returns>
313public static IResourceBuilder<AzureCosmosDBResource> WithAccessKeyAuthentication(
314this IResourceBuilder<AzureCosmosDBResource> builder)
Aspire.Hosting.Azure.EventHubs (30)
AzureEventHubsExtensions.cs (28)
27/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
28public static IResourceBuilder<AzureEventHubsResource> AddAzureEventHubs(
97/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
99public static IResourceBuilder<AzureEventHubsResource> AddEventHub(this IResourceBuilder<AzureEventHubsResource> builder, [ResourceName] string name)
113/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
114public static IResourceBuilder<AzureEventHubsResource> WithHub(this IResourceBuilder<AzureEventHubsResource> builder, [ResourceName] string name, Action<EventHub>? configure = null)
137/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
157public static IResourceBuilder<AzureEventHubsResource> RunAsEmulator(this IResourceBuilder<AzureEventHubsResource> builder, Action<IResourceBuilder<AzureEventHubsEmulatorResource>>? configureContainer = null)
185var storageResource = builder.ApplicationBuilder
234var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
334public static IResourceBuilder<AzureEventHubsEmulatorResource> WithDataBindMount(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string? path = null)
343public static IResourceBuilder<AzureEventHubsEmulatorResource> WithDataVolume(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string? name = null)
353public static IResourceBuilder<AzureEventHubsEmulatorResource> WithGatewayPort(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, int? port)
364public static IResourceBuilder<AzureEventHubsEmulatorResource> WithHostPort(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, int? port)
377/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
378public static IResourceBuilder<AzureEventHubsEmulatorResource> WithConfigurationFile(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string path)
395/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
396public static IResourceBuilder<AzureEventHubsEmulatorResource> WithConfiguration(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, Action<JsonNode> configJson)
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 (37)
AzureServiceBusExtensions.cs (33)
28/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
29public static IResourceBuilder<AzureServiceBusResource> AddAzureServiceBus(this IDistributedApplicationBuilder builder, [ResourceName] string name)
111/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
113public static IResourceBuilder<AzureServiceBusResource> AddQueue(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name)
124/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
125public static IResourceBuilder<AzureServiceBusResource> WithQueue(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name, Action<ServiceBusQueue>? configure = null)
145public static IResourceBuilder<AzureServiceBusResource> AddTopic(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name)
157public static IResourceBuilder<AzureServiceBusResource> AddTopic(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name, string[] subscriptions)
177/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
178public static IResourceBuilder<AzureServiceBusResource> WithTopic(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name, Action<ServiceBusTopic>? configure = null)
198/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
200public static IResourceBuilder<AzureServiceBusResource> AddSubscription(this IResourceBuilder<AzureServiceBusResource> builder, string topicName, string subscriptionName)
221/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
238public static IResourceBuilder<AzureServiceBusResource> RunAsEmulator(this IResourceBuilder<AzureServiceBusResource> builder, Action<IResourceBuilder<AzureServiceBusEmulatorResource>>? configureContainer = null)
264var sqlEdgeResource = builder.ApplicationBuilder
291var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
419/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
420public static IResourceBuilder<AzureServiceBusEmulatorResource> WithConfigurationFile(this IResourceBuilder<AzureServiceBusEmulatorResource> builder, string path)
437/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
452public static IResourceBuilder<AzureServiceBusEmulatorResource> WithConfiguration(this IResourceBuilder<AzureServiceBusEmulatorResource> builder, Action<JsonNode> configJson)
467/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
468public static IResourceBuilder<AzureServiceBusEmulatorResource> WithHostPort(this IResourceBuilder<AzureServiceBusEmulatorResource> builder, int? port)
Aspire.Hosting.Azure.SignalR (9)
Aspire.Hosting.Azure.Sql (23)
Aspire.Hosting.Azure.Storage (31)
AzureStorageExtensions.cs (31)
29public static IResourceBuilder<AzureStorageResource> AddAzureStorage(this IDistributedApplicationBuilder builder, [ResourceName] string name)
96/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
97public static IResourceBuilder<AzureStorageResource> RunAsEmulator(this IResourceBuilder<AzureStorageResource> builder, Action<IResourceBuilder<AzureStorageEmulatorResource>>? configureContainer = null)
169public static IResourceBuilder<AzureStorageEmulatorResource> WithDataBindMount(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? path = null, bool isReadOnly = false)
179public static IResourceBuilder<AzureStorageEmulatorResource> WithDataVolume(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? name = null, bool isReadOnly = false)
188public static IResourceBuilder<AzureStorageEmulatorResource> WithBlobPort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
202public static IResourceBuilder<AzureStorageEmulatorResource> WithQueuePort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
215/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureStorageEmulatorResource"/>.</returns>
216public static IResourceBuilder<AzureStorageEmulatorResource> WithTablePort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
229/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureStorageEmulatorResource"/>.</returns>
230public static IResourceBuilder<AzureStorageEmulatorResource> WithApiVersionCheck(this IResourceBuilder<AzureStorageEmulatorResource> builder, bool enable = true)
251/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
253/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureBlobStorageResource"/>.</returns>
254public static IResourceBuilder<AzureBlobStorageResource> AddBlobs(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
263/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
265/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureTableStorageResource"/>.</returns>
266public static IResourceBuilder<AzureTableStorageResource> AddTables(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
275/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
277/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureQueueStorageResource"/>.</returns>
278public static IResourceBuilder<AzureQueueStorageResource> AddQueues(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
Aspire.Hosting.Azure.Tests (265)
AzureBicepResourceTests.cs (88)
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")
251var db = cosmos.AddCosmosDatabase("db", databaseName: "mydatabase");
358var cosmos = builder.AddAzureCosmosDB("cosmos")
363var db = cosmos.AddCosmosDatabase("mydatabase");
480var cosmos = builder.AddAzureCosmosDB("cosmos")
485var db = cosmos.AddCosmosDatabase("mydatabase");
592var cosmos = builder.AddAzureCosmosDB("cosmos")
597var db = cosmos.AddCosmosDatabase("mydatabase");
711var appConfig = builder.AddAzureAppConfiguration("appConfig");
777var appInsights = builder.AddAzureApplicationInsights("appInsights");
834var appInsights = builder.AddAzureApplicationInsights("appInsights");
899var law = builder.AddAzureLogAnalyticsWorkspace("mylaw");
900var appInsights = builder.AddAzureApplicationInsights("appInsights", law);
957var logAnalyticsWorkspace = builder.AddAzureLogAnalyticsWorkspace("logAnalyticsWorkspace");
999var appInsights = builder.AddAzureApplicationInsights("ai");
1003var serviceA = builder.AddProject<ProjectA>("serviceA", o => o.ExcludeLaunchProfile = true)
1016var infrastructure1 = builder.AddAzureInfrastructure("infrastructure1", (infrastructure) =>
1038var skuName = builder.AddParameter("skuName");
1041var infrastructure1 = builder.AddAzureInfrastructure("infrastructure1", (infrastructure) =>
1077var skuName = builder.AddParameter("skuName");
1080var infrastructure1 = builder.AddAzureInfrastructure("infrastructure1", (infrastructure) =>
1116var redis = builder.AddRedis("cache")
1184var mykv = builder.AddAzureKeyVault("mykv");
1246var mykv = builder.AddAzureKeyVault("mykv");
1309var sql = builder.AddSqlServer("sql").AsAzureSqlDatabase();
1403var sql = builder.AddSqlServer("sql").AsAzureSqlDatabase();
1486var usr = builder.AddParameter("usr");
1487var pwd = builder.AddParameter("pwd", secret: true);
1490var postgres = builder.AddPostgres("postgres", usr, pwd).AsAzurePostgresFlexibleServer();
1604var usr = builder.AddParameter("usr");
1605var pwd = builder.AddParameter("pwd", secret: true);
1608var postgres = builder.AddPostgres("postgres", usr, pwd).AsAzurePostgresFlexibleServer();
1713var usr = builder.AddParameter("usr");
1714var pwd = builder.AddParameter("pwd", secret: true);
1717var postgres = builder.AddPostgres("postgres", usr, pwd).PublishAsAzurePostgresFlexibleServer();
1750var postgres = builder.AddPostgres("postgres1")
1768var param = builder.AddParameter("param");
1814var serviceBus = builder.AddAzureServiceBus("sb");
1928var wps = builder.AddAzureWebPubSub("wps1");
1995var wps = builder.AddAzureWebPubSub("wps1")
2063var storage = builder.AddAzureStorage("storage").RunAsEmulator(e =>
2072var blob = storage.AddBlobs("blob");
2073var queue = storage.AddQueues("queue");
2074var table = storage.AddTables("table");
2101var storagesku = builder.AddParameter("storagesku");
2102var storage = builder.AddAzureStorage("storage")
2209var blob = storage.AddBlobs("blob");
2224var queue = storage.AddQueues("queue");
2239var table = storage.AddTables("table");
2259var storagesku = builder.AddParameter("storagesku");
2260var storage = builder.AddAzureStorage("storage")
2368var blob = storage.AddBlobs("blob");
2383var queue = storage.AddQueues("queue");
2398var table = storage.AddTables("table");
2418var storagesku = builder.AddParameter("storagesku");
2419var storage = builder.AddAzureStorage("storage")
2526var blob = storage.AddBlobs("blob");
2541var queue = storage.AddQueues("queue");
2556var table = storage.AddTables("table");
2576var storagesku = builder.AddParameter("storagesku");
2577var storage = builder.AddAzureStorage("storage")
2685var blob = storage.AddBlobs("blob");
2700var queue = storage.AddQueues("queue");
2715var table = storage.AddTables("table");
2736var sku = builder.AddParameter("searchSku");
2737var search = builder.AddAzureSearch("search")
2831var ai = builder.AddAzureApplicationInsights("ai").PublishAsConnectionString();
2832var serviceBus = builder.AddAzureServiceBus("servicebus").PublishAsConnectionString();
2834var serviceA = builder.AddProject<ProjectA>("serviceA", o => o.ExcludeLaunchProfile = true)
2859var openai = builder.AddAzureOpenAI("openai")
2975var provisioningResource = builder.AddAzureInfrastructure("infrastructure", r =>
2989var provisioningResource = builder.AddAzureInfrastructure("infrastructure", r =>
ExistingAzureResourceExtensionsTests.cs (19)
17var nameParameter = builder.AddParameter("name", "existingName");
18var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
20var serviceBus = builder.AddAzureServiceBus("sb")
31var nameParameter = builder.AddParameter("name", "existingName");
32var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
34var serviceBus = builder.AddAzureServiceBus("sb")
47var nameParameter = builder.AddParameter("name", "existingName");
48var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
49var nameParameter1 = builder.AddParameter("name1", "existingName");
50var resourceGroupParameter1 = builder.AddParameter("resourceGroup1", "existingResourceGroup");
52var serviceBus = builder.AddAzureServiceBus("sb")
66var nameParameter = builder.AddParameter("name", "existingName");
67var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
69var serviceBus = builder.AddAzureServiceBus("sb")
82var nameParameter = builder.AddParameter("name", "existingName");
83var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
84var nameParameter1 = builder.AddParameter("name1", "existingName");
85var resourceGroupParameter1 = builder.AddParameter("resourceGroup1", "existingResourceGroup");
87var serviceBus = builder.AddAzureServiceBus("sb")
Aspire.Hosting.Azure.WebPubSub (9)
Aspire.Hosting.Containers.Tests (41)
ContainerResourceBuilderTests.cs (19)
16var redis = builder.AddContainer("redis", "redis").WithImage("redis-stack");
24var redis = builder.AddContainer("redis", "redis").WithImage("redis-stack", "1.0.0");
33var container = builder.AddContainer("app", "some-image");
45var container = builder.AddContainer("app", "some-image");
57var redis = builder.AddContainer("redis", "redis").WithImageTag("7.1");
65var redis = builder.AddContainer("redis", "redis").WithImageRegistry("myregistry.azurecr.io");
73var redis = builder.AddContainer("redis", "redis").WithImageSHA256("42b5c726e719639fcc1e9dbc13dd843f567dcd37911d0e1abb9f47f2cc1c95cd");
81var container = builder.AddResource(new TestContainerResource("testcontainer"));
91var container = builder.AddResource(new TestContainerResource("testcontainer"));
101var container = builder.AddResource(new TestContainerResource("testcontainer"));
119var container = builder.AddResource(new TestContainerResource("testcontainer"));
130var container = builder.AddResource(new TestContainerResource("testcontainer"));
139var container = builder.AddResource(new TestContainerResource("testcontainer"));
148var redis = builder
160var redis = builder
172var redis = builder
185var redis = builder
196var redis = builder
204private static void AssertImageComponents<T>(IResourceBuilder<T> builder, string? expectedRegistry, string expectedImage, string? expectedTag, string? expectedSha256)
WithDockerfileTests.cs (20)
29var parameter = builder.AddParameter("secret", secret: true);
164var parameter = builder.AddParameter("message");
166var container = builder.AddContainer("testcontainer", "testimage")
212var parameter = builder.AddParameter("message");
214var container = builder.AddDockerfile("testcontainer", tempContextPath, tempDockerfilePath, "runner")
259var parameter = builder.AddParameter("secret", secret: true);
261var container = builder.AddContainer("testcontainer", "testimage")
305var parameter = builder.AddParameter("secret", secret: true);
307var container = builder.AddDockerfile("testcontainer", tempContextPath, tempDockerfilePath)
348var parameter = builder.AddParameter("message");
419var parameter = builder.AddParameter("message");
514var container = builder.AddContainer("mycontainer", "myimage");
535var container = builder.AddContainer("mycontainer", "myimage")
551var container = builder.AddDockerfile("mycontainer", tempContextPath);
566var container = builder.AddContainer("mycontainer", "myimage")
582var container = builder.AddDockerfile("mycontainer", tempContextPath, "Dockerfile");
597var container = builder.AddContainer("mycontainer", "myimage")
613var container = builder.AddDockerfile("mycontainer", tempContextPath, "Otherdockerfile");
628var container = builder.AddContainer("mycontainer", "myimage")
644var container = builder.AddDockerfile("mycontainer", tempContextPath, tempDockerfilePath);
Aspire.Hosting.Dapr (20)
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,
90/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.:
104/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
105public static IResourceBuilder<GarnetResource> WithDataVolume(this IResourceBuilder<GarnetResource> builder,
125/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.:
139/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
140public static IResourceBuilder<GarnetResource> WithDataBindMount(this IResourceBuilder<GarnetResource> builder,
159/// Use with <see cref="WithDataBindMount(IResourceBuilder{GarnetResource}, string, bool)"/>
160/// or <see cref="WithDataVolume(IResourceBuilder{GarnetResource}, string?, bool)"/> to persist Garnet data across sessions with custom persistence configuration, e.g.:
170/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
172public static IResourceBuilder<GarnetResource> WithPersistence(this IResourceBuilder<GarnetResource> builder,
181/// Use with <see cref="WithDataBindMount(IResourceBuilder{GarnetResource}, string, bool)"/>
182/// or <see cref="WithDataVolume(IResourceBuilder{GarnetResource}, string?, bool)"/> to persist Garnet data across sessions with custom persistence configuration, e.g.:
192/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
193public 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 (14)
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,
94/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
95public static IResourceBuilder<MilvusDatabaseResource> AddDatabase(this IResourceBuilder<MilvusServerResource> builder, [ResourceName] string name, string? databaseName = null)
130/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
131public static IResourceBuilder<T> WithAttu<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<AttuResource>>? configureContainer = null, string? containerName = null) where T : MilvusServerResource
138var resourceBuilder = builder.ApplicationBuilder.AddResource(attuContainer)
156/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
157public static IResourceBuilder<MilvusServerResource> WithDataVolume(this IResourceBuilder<MilvusServerResource> builder, string? name = null, bool isReadOnly = false)
169/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
170public static IResourceBuilder<MilvusServerResource> WithDataBindMount(this IResourceBuilder<MilvusServerResource> builder, string source, bool isReadOnly = false)
182/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
183public static IResourceBuilder<MilvusServerResource> WithConfigurationBindMount(this IResourceBuilder<MilvusServerResource> builder, string configurationFilePath)
Aspire.Hosting.Milvus.Tests (33)
AddMilvusTests.cs (13)
21var pass = appBuilder.AddParameter("apikey", "pass");
51var pass = appBuilder.AddParameter("apikey", "pass");
81var pass = appBuilder.AddParameter("apikey", "pass");
83var milvus = appBuilder.AddMilvus("my-milvus", pass)
97var pass = appBuilder.AddParameter("apikey", "pass");
99var milvus = appBuilder.AddMilvus("my-milvus", pass)
102var projectA = appBuilder.AddProject<ProjectA>("projecta", o => o.ExcludeLaunchProfile = true)
113var container1 = appBuilder.AddContainer("container1", "fake")
129var pass = appBuilder.AddParameter("apikey", "pass");
130var milvus = appBuilder.AddMilvus("milvus", pass);
131var db1 = milvus.AddDatabase("db1");
179var pass = builder.AddParameter("apikey", "pass");
181var milvus = builder.AddMilvus("my-milvus", grpcPort: 5503, apiKey: pass);
Aspire.Hosting.MongoDB (25)
MongoDBBuilderExtensions.cs (25)
34/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
35public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port)
48/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
49public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistributedApplicationBuilder builder,
52IResourceBuilder<ParameterResource>? userName = null,
53IResourceBuilder<ParameterResource>? password = null)
101/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
102public static IResourceBuilder<MongoDBDatabaseResource> AddDatabase(this IResourceBuilder<MongoDBServerResource> builder, [ResourceName] string name, string? databaseName = null)
148/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
149public static IResourceBuilder<T> WithMongoExpress<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<MongoExpressContainerResource>>? configureContainer = null, string? containerName = null) where T : MongoDBServerResource
156var resourceBuilder = builder.ApplicationBuilder.AddResource(mongoExpressContainer)
175public static IResourceBuilder<MongoExpressContainerResource> WithHostPort(this IResourceBuilder<MongoExpressContainerResource> builder, int? port)
191/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
192public static IResourceBuilder<MongoDBServerResource> WithDataVolume(this IResourceBuilder<MongoDBServerResource> builder, string? name = null, bool isReadOnly = false)
205/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
206public static IResourceBuilder<MongoDBServerResource> WithDataBindMount(this IResourceBuilder<MongoDBServerResource> builder, string source, bool isReadOnly = false)
220/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
221public 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)
47/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
48public static IResourceBuilder<NatsServerResource> AddNats(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null,
49IResourceBuilder<ParameterResource>? userName = null,
50IResourceBuilder<ParameterResource>? password = null)
112/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
114public static IResourceBuilder<NatsServerResource> WithJetStream(this IResourceBuilder<NatsServerResource> builder, string? srcMountPath = null)
131/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
132public static IResourceBuilder<NatsServerResource> WithJetStream(this IResourceBuilder<NatsServerResource> builder)
145/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
146public static IResourceBuilder<NatsServerResource> WithDataVolume(this IResourceBuilder<NatsServerResource> builder, string? name = null, bool isReadOnly = false)
161/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
162public 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)
369/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
370public static IResourceBuilder<PostgresServerResource> WithDataVolume(this IResourceBuilder<PostgresServerResource> builder, string? name = null, bool isReadOnly = false)
384/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
385public static IResourceBuilder<PostgresServerResource> WithDataBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = false)
399/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
400public static IResourceBuilder<PostgresServerResource> WithInitBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = true)
Aspire.Hosting.PostgreSQL.Tests (54)
PostgresFunctionalTests.cs (17)
43var postgres = builder.AddPostgres("postgres")
46var dependentResource = builder.AddPostgres("dependentresource")
82IResourceBuilder<PgAdminContainerResource>? adminBuilder = null;
83var redis = builder.AddPostgres("postgres").WithPgAdmin(c => adminBuilder = c);
112var postgres = builder.AddPostgres("pg").WithEnvironment("POSTGRES_DB", postgresDbName);
113var db = postgres.AddDatabase(postgresDbName);
151IResourceBuilder<PgWebContainerResource>? pgWebBuilder = null;
153var pg = builder.AddPostgres("pg1");
154var db = pg.AddDatabase(dbName);
211var usernameParameter = builder1.AddParameter("user", username);
212var passwordParameter = builder1.AddParameter("pwd", password, secret: true);
213var postgres1 = builder1.AddPostgres("pg", usernameParameter, passwordParameter).WithEnvironment("POSTGRES_DB", postgresDbName);
215var db1 = postgres1.AddDatabase(postgresDbName);
284var postgres2 = builder2.AddPostgres("pg", usernameParameter, passwordParameter);
285var db2 = postgres2.AddDatabase(postgresDbName);
389var postgres = builder.AddPostgres("pg").WithEnvironment("POSTGRES_DB", postgresDbName);
390var db = postgres.AddDatabase(postgresDbName);
Aspire.Hosting.Python (10)
Aspire.Hosting.Python.Tests (4)
Aspire.Hosting.Qdrant (14)
Aspire.Hosting.Qdrant.Tests (25)
AddQdrantTests.cs (13)
23var qd = appBuilder.AddQdrant("qd");
33var qd = appBuilder.AddQdrant("qd");
113var pass = appBuilder.AddParameter("pass", "pass");
154var pass = appBuilder.AddParameter("pass", "pass");
156var qdrant = appBuilder.AddQdrant("my-qdrant", pass)
170var pass = appBuilder.AddParameter("pass", "pass");
172var qdrant = appBuilder.AddQdrant("my-qdrant", pass)
176var projectA = appBuilder.AddProject<ProjectA>("projecta", o => o.ExcludeLaunchProfile = true)
188var container1 = appBuilder.AddContainer("container1", "fake")
205var qdrant = appBuilder.AddQdrant("qdrant");
242var apiKeyParameter = appBuilder.AddParameter("QdrantApiKey");
243var qdrant = appBuilder.AddQdrant("qdrant", apiKeyParameter);
280var qdrant = builder.AddQdrant("my-qdrant", grpcPort: 5503, httpPort: 5504);
Aspire.Hosting.RabbitMQ (20)
Aspire.Hosting.RabbitMQ.Tests (23)
Aspire.Hosting.Redis (46)
RedisBuilderExtensions.cs (46)
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<RedisResource> AddRedis(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port)
52/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
56/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
62public static IResourceBuilder<RedisResource> AddRedis(
66IResourceBuilder<ParameterResource>? password = null)
98private static IResourceBuilder<RedisResource> EnsureCommandLineCallback(this IResourceBuilder<RedisResource> builder)
131/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="RedisResource"/>.</param>
135public static IResourceBuilder<RedisResource> WithRedisCommander(this IResourceBuilder<RedisResource> builder, Action<IResourceBuilder<RedisCommanderResource>>? configureContainer = null, string? containerName = null)
141var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource);
150var resourceBuilder = builder.ApplicationBuilder.AddResource(resource)
202/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="RedisResource"/>.</param>
206public static IResourceBuilder<RedisResource> WithRedisInsight(this IResourceBuilder<RedisResource> builder, Action<IResourceBuilder<RedisInsightResource>>? configureContainer = null, string? containerName = null)
212var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingRedisCommanderResource);
221var resourceBuilder = builder.ApplicationBuilder.AddResource(resource)
445public static IResourceBuilder<RedisCommanderResource> WithHostPort(this IResourceBuilder<RedisCommanderResource> builder, int? port)
461public static IResourceBuilder<RedisInsightResource> WithHostPort(this IResourceBuilder<RedisInsightResource> builder, int? port)
475/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.:
488/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
489public static IResourceBuilder<RedisResource> WithDataVolume(this IResourceBuilder<RedisResource> builder, string? name = null, bool isReadOnly = false)
505/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.:
518/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
519public static IResourceBuilder<RedisResource> WithDataBindMount(this IResourceBuilder<RedisResource> builder, string source, bool isReadOnly = false)
536/// Use with <see cref="WithDataBindMount(IResourceBuilder{RedisResource}, string, bool)"/>
537/// or <see cref="WithDataVolume(IResourceBuilder{RedisResource}, string?, bool)"/> to persist Redis data across sessions with custom persistence configuration, e.g.:
547/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
548public static IResourceBuilder<RedisResource> WithPersistence(this IResourceBuilder<RedisResource> builder, TimeSpan? interval = null, long keysChangedThreshold = 1)
567/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
569public static IResourceBuilder<RedisInsightResource> WithDataVolume(this IResourceBuilder<RedisInsightResource> builder, string? name = null)
581/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
582public static IResourceBuilder<RedisInsightResource> WithDataBindMount(this IResourceBuilder<RedisInsightResource> builder, string source)
Aspire.Hosting.Redis.Tests (55)
Aspire.Hosting.Seq (7)
Aspire.Hosting.SqlServer (12)
Aspire.Hosting.SqlServer.Tests (28)
Aspire.Hosting.Testing (6)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (188)
Dcp\DcpExecutorTests.cs (11)
112var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
144var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
176var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
209var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
369(Action<IResourceBuilder<ExecutableResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [
398var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo");
813(Action<IResourceBuilder<ContainerResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [
837var ctr = builder.AddContainer("database", "image");
997var container = builder.AddContainer("database", "image");
998var exe = builder.AddExecutable("node", "node.exe", ".");
999var project = builder.AddProject<TestProject>("project");
Orchestrator\ApplicationOrchestratorTests.cs (14)
24var parentResource = builder.AddContainer("database", "image");
25var childResource = builder.AddResource(new CustomChildResource("child", parentResource.Resource));
70var parent = builder.AddContainer("parent", "image");
71var child = builder.AddContainer("child", "image").WithParentRelationship(parent.Resource);
72var child2 = builder.AddContainer("child2", "image").WithParentRelationship(parent.Resource);
74var nestedChild = builder.AddContainer("nested-child", "image").WithParentRelationship(child.Resource);
133var firstParent = builder.AddContainer("firstParent", "image");
134var secondParent = builder.AddContainer("secondParent", "image");
136var child = builder.AddContainer("child", "image");
191var projectA = builder.AddProject<ProjectA>("projecta");
192var projectB = builder.AddProject<ProjectB>("projectb").WithParentRelationship(projectA.Resource);
238var container1 = builder.AddContainer("container1", "image");
239var container2 = builder.AddContainer("container2", "image2");
240var container3 = builder.AddContainer("container3", "image3");
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 (15)
21var throwingResource = builder.AddContainer("throwingresource", "doesnotmatter")
23var dependingContainerResource = builder.AddContainer("dependingcontainerresource", "doesnotmatter")
25var dependingExecutableResource = builder.AddExecutable("dependingexecutableresource", "doesnotmatter", "alsodoesntmatter")
95var cs = builder.AddConnectionString("cs");
96var param = builder.AddParameter("param", "value");
97var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
130var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
171var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
219var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
273var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
330var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
382var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
436var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
486var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
526var 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)
56/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
57public static IResourceBuilder<ValkeyResource> AddValkey(this IDistributedApplicationBuilder builder,
97/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.:
105/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
106public static IResourceBuilder<ValkeyResource> WithDataVolume(this IResourceBuilder<ValkeyResource> builder,
130/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.:
138/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
139public static IResourceBuilder<ValkeyResource> WithDataBindMount(this IResourceBuilder<ValkeyResource> builder,
159/// Use with <see cref="WithDataBindMount(IResourceBuilder{ValkeyResource}, string, bool)"/>
160/// or <see cref="WithDataVolume(IResourceBuilder{ValkeyResource}, string?, bool)"/> to persist Valkey data across sessions with custom persistence configuration, e.g.:
168/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
169public 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 (2)
CustomResources.AppHost (2)
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)
ServiceBus.AppHost (1)
SignalR.AppHost (2)
SqlServerEndToEnd.AppHost (5)
Stress.AppHost (15)
TestProject.AppHost (8)
TestShop.AppHost (6)
WaitForSandbox.AppHost (3)
WebPubSub.AppHost (2)
WithDockerfile.AppHost (2)