2153 references to IResourceBuilder
Aspire.Hosting (320)
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
222/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
223public static IResourceBuilder<T> WithImageSHA256<T>(this IResourceBuilder<T> builder, string sha256) where T : ContainerResource
241/// 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.
246/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
247public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, params string[] args) where T : ContainerResource
258/// 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.
263/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
264public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Action<ContainerRuntimeArgsCallbackContext> callback) where T : ContainerResource
280/// 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.
285/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
286public static IResourceBuilder<T> WithContainerRuntimeArgs<T>(this IResourceBuilder<T> builder, Func<ContainerRuntimeArgsCallbackContext, Task> callback) where T : ContainerResource
301/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
313public static IResourceBuilder<T> WithLifetime<T>(this IResourceBuilder<T> builder, ContainerLifetime lifetime) where T : ContainerResource
320private static IResourceBuilder<T> ThrowResourceIsNotContainer<T>(IResourceBuilder<T> builder) where T : ContainerResource
329/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
330public static IResourceBuilder<T> PublishAsContainer<T>(this IResourceBuilder<T> builder) where T : ContainerResource
341/// <param name="builder">The <see cref="IResourceBuilder{T}"/>.</param>
345/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
358/// When generating the manifest for deployment tools, the <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>
374public static IResourceBuilder<T> WithDockerfile<T>(this IResourceBuilder<T> builder, string contextPath, string? dockerfilePath = null, string? stage = null) where T : ContainerResource
403/// <returns>A <see cref="IResourceBuilder{ContainerResource}"/>.</returns>
426public static IResourceBuilder<ContainerResource> AddDockerfile(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, string? dockerfilePath = null, string? stage = null)
448/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
449public static IResourceBuilder<T> WithContainerName<T>(this IResourceBuilder<T> builder, string name) where T : ContainerResource
464/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
466/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, object)"/> is
467/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
471/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, object)"/> extension method
473/// <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
488public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, object? value) where T : ContainerResource
512/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
514/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is
515/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
519/// The <see cref="ContainerResourceBuilderExtensions.WithBuildArg{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method
521/// <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
538public static IResourceBuilder<T> WithBuildArg<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
559/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
561/// Thrown when <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> is
562/// called before <see cref="ContainerResourceBuilderExtensions.WithDockerfile{T}(IResourceBuilder{T}, string, string?, string?)"/>.
566/// The <see cref="ContainerResourceBuilderExtensions.WithBuildSecret{T}(IResourceBuilder{T}, string, IResourceBuilder{ParameterResource})"/> extension method
585public static IResourceBuilder<T> WithBuildSecret<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> value) where T : ContainerResource
610/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
618public 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>
83public static IResourceBuilder<T> PublishAsDockerFile<T>(this IResourceBuilder<T> builder, IEnumerable<DockerBuildArg>? buildArgs) where T : ExecutableResource
109/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
110public static IResourceBuilder<T> PublishAsDockerFile<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<ContainerResource>>? configure)
128var 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 (143)
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
722/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
727/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource}, WaitBehavior)"/> also results
730/// <para>The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method can be used to associate
744public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, WaitBehavior waitBehavior) where T : IResourceWithWaitSupport
752private static IResourceBuilder<T> WaitForCore<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, WaitBehavior? waitBehavior, bool addRelationship) where T : IResourceWithWaitSupport
769var parentBuilder = builder.ApplicationBuilder.CreateResourceBuilder(dependencyResourceWithParent.Parent);
789/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
804public static IResourceBuilder<T> WithExplicitStart<T>(this IResourceBuilder<T> builder) where T : IResource
816/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
835public static IResourceBuilder<T> WaitForCompletion<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency, int exitCode = 0) where T : IResourceWithWaitSupport
861/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
864/// The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method is used in conjunction with
865/// the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> to associate a resource
866/// registered in the application hosts dependency injection container. The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/>
891public static IResourceBuilder<T> WithHealthCheck<T>(this IResourceBuilder<T> builder, string key) where T : IResource
914/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
935public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints
948internal static IResourceBuilder<T> WithHttpHealthCheckInternal<T>(this IResourceBuilder<T> builder, string desiredScheme, string endpointName, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints
1009/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
1030public static IResourceBuilder<T> WithHttpsHealthCheck<T>(this IResourceBuilder<T> builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints
1072/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
1078public static IResourceBuilder<T> WithCommand<T>(
1079this IResourceBuilder<T> builder,
1129public static IResourceBuilder<T> WithRelationship<T>(
1130this IResourceBuilder<T> builder,
1164public static IResourceBuilder<T> WithParentRelationship<T>(
1165this IResourceBuilder<T> builder,
1166IResourceBuilder<IResource> parent) where T : IResource
1194public static IResourceBuilder<T> WithParentRelationship<T>(
1195this IResourceBuilder<T> builder,
Aspire.Hosting.Azure (72)
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)
ExistingAzureResourceExtensions.cs (16)
35public static IResourceBuilder<T> RunAsExisting<T>(this IResourceBuilder<T> builder, IResourceBuilder<ParameterResource> nameParameter, IResourceBuilder<ParameterResource>? resourceGroupParameter = null)
56public static IResourceBuilder<T> RunAsExisting<T>(this IResourceBuilder<T> builder, string name, string? resourceGroup = null)
77public static IResourceBuilder<T> PublishAsExisting<T>(this IResourceBuilder<T> builder, IResourceBuilder<ParameterResource> nameParameter, IResourceBuilder<ParameterResource>? resourceGroupParameter = null)
98public static IResourceBuilder<T> PublishAsExisting<T>(this IResourceBuilder<T> builder, string name, string? resourceGroup = null)
119public static IResourceBuilder<T> AsExisting<T>(this IResourceBuilder<T> builder, IResourceBuilder<ParameterResource> nameParameter, IResourceBuilder<ParameterResource>? resourceGroupParameter = null)
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 (36)
AzureEventHubsExtensions.cs (34)
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)
112/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
113public static IResourceBuilder<AzureEventHubResource> AddHub(this IResourceBuilder<AzureEventHubsResource> builder, [ResourceName] string name, string? hubName = null)
132/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
133public static IResourceBuilder<AzureEventHubResource> WithProperties(this IResourceBuilder<AzureEventHubResource> builder, Action<AzureEventHubResource> configure)
149/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
150public static IResourceBuilder<AzureEventHubConsumerGroupResource> AddConsumerGroup(this IResourceBuilder<AzureEventHubResource> builder, [ResourceName] string name, string? groupName = null)
172/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
192public static IResourceBuilder<AzureEventHubsResource> RunAsEmulator(this IResourceBuilder<AzureEventHubsResource> builder, Action<IResourceBuilder<AzureEventHubsEmulatorResource>>? configureContainer = null)
214var storageResource = builder.ApplicationBuilder
225var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
354public static IResourceBuilder<AzureEventHubsEmulatorResource> WithDataBindMount(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string? path = null)
363public static IResourceBuilder<AzureEventHubsEmulatorResource> WithDataVolume(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string? name = null)
373public static IResourceBuilder<AzureEventHubsEmulatorResource> WithGatewayPort(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, int? port)
384public static IResourceBuilder<AzureEventHubsEmulatorResource> WithHostPort(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, int? port)
397/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
398public static IResourceBuilder<AzureEventHubsEmulatorResource> WithConfigurationFile(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string path)
415/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
416public 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 (51)
AzureServiceBusExtensions.cs (47)
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)
126/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
127public static IResourceBuilder<AzureServiceBusQueueResource> AddServiceBusQueue(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name, string? queueName = null)
146/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
147public static IResourceBuilder<AzureServiceBusQueueResource> WithProperties(this IResourceBuilder<AzureServiceBusQueueResource> builder, Action<AzureServiceBusQueueResource> configure)
163public static IResourceBuilder<AzureServiceBusResource> AddTopic(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name)
177public static IResourceBuilder<AzureServiceBusResource> AddTopic(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name, string[] subscriptions)
179var topic = builder.AddServiceBusTopic(name);
195/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
196public static IResourceBuilder<AzureServiceBusTopicResource> AddServiceBusTopic(this IResourceBuilder<AzureServiceBusResource> builder, [ResourceName] string name, string? topicName = null)
215/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
216public static IResourceBuilder<AzureServiceBusTopicResource> WithProperties(this IResourceBuilder<AzureServiceBusTopicResource> builder, Action<AzureServiceBusTopicResource> configure)
232/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
234public static IResourceBuilder<AzureServiceBusResource> AddSubscription(this IResourceBuilder<AzureServiceBusResource> builder, string topicName, string subscriptionName)
236IResourceBuilder<AzureServiceBusTopicResource> topicBuilder;
257/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
258public static IResourceBuilder<AzureServiceBusSubscriptionResource> AddServiceBusSubscription(this IResourceBuilder<AzureServiceBusTopicResource> builder, [ResourceName] string name, string? subscriptionName = null)
277/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
278public static IResourceBuilder<AzureServiceBusSubscriptionResource> WithProperties(this IResourceBuilder<AzureServiceBusSubscriptionResource> builder, Action<AzureServiceBusSubscriptionResource> configure)
296/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
313public static IResourceBuilder<AzureServiceBusResource> RunAsEmulator(this IResourceBuilder<AzureServiceBusResource> builder, Action<IResourceBuilder<AzureServiceBusEmulatorResource>>? configureContainer = null)
339var sqlEdgeResource = builder.ApplicationBuilder
366var surrogateBuilder = builder.ApplicationBuilder.CreateResourceBuilder(surrogate);
494/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
495public static IResourceBuilder<AzureServiceBusEmulatorResource> WithConfigurationFile(this IResourceBuilder<AzureServiceBusEmulatorResource> builder, string path)
512/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
527public static IResourceBuilder<AzureServiceBusEmulatorResource> WithConfiguration(this IResourceBuilder<AzureServiceBusEmulatorResource> builder, Action<JsonNode> configJson)
542/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
543public 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)
28public static IResourceBuilder<AzureStorageResource> AddAzureStorage(this IDistributedApplicationBuilder builder, [ResourceName] string name)
95/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
96public static IResourceBuilder<AzureStorageResource> RunAsEmulator(this IResourceBuilder<AzureStorageResource> builder, Action<IResourceBuilder<AzureStorageEmulatorResource>>? configureContainer = null)
168public static IResourceBuilder<AzureStorageEmulatorResource> WithDataBindMount(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? path = null, bool isReadOnly = false)
178public static IResourceBuilder<AzureStorageEmulatorResource> WithDataVolume(this IResourceBuilder<AzureStorageEmulatorResource> builder, string? name = null, bool isReadOnly = false)
187public static IResourceBuilder<AzureStorageEmulatorResource> WithBlobPort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
201public static IResourceBuilder<AzureStorageEmulatorResource> WithQueuePort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
214/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureStorageEmulatorResource"/>.</returns>
215public static IResourceBuilder<AzureStorageEmulatorResource> WithTablePort(this IResourceBuilder<AzureStorageEmulatorResource> builder, int port)
228/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureStorageEmulatorResource"/>.</returns>
229public static IResourceBuilder<AzureStorageEmulatorResource> WithApiVersionCheck(this IResourceBuilder<AzureStorageEmulatorResource> builder, bool enable = true)
250/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
252/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureBlobStorageResource"/>.</returns>
253public static IResourceBuilder<AzureBlobStorageResource> AddBlobs(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
262/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
264/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureTableStorageResource"/>.</returns>
265public static IResourceBuilder<AzureTableStorageResource> AddTables(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
274/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for <see cref="AzureStorageResource"/>/</param>
276/// <returns>An <see cref="IResourceBuilder{T}"/> for the <see cref="AzureQueueStorageResource"/>.</returns>
277public static IResourceBuilder<AzureQueueStorageResource> AddQueues(this IResourceBuilder<AzureStorageResource> builder, [ResourceName] string name)
Aspire.Hosting.Azure.Tests (308)
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")
1183var mykv = builder.AddAzureKeyVault("mykv");
1245var mykv = builder.AddAzureKeyVault("mykv");
1308var sql = builder.AddSqlServer("sql").AsAzureSqlDatabase();
1402var sql = builder.AddSqlServer("sql").AsAzureSqlDatabase();
1485var usr = builder.AddParameter("usr");
1486var pwd = builder.AddParameter("pwd", secret: true);
1489var postgres = builder.AddPostgres("postgres", usr, pwd).AsAzurePostgresFlexibleServer();
1603var usr = builder.AddParameter("usr");
1604var pwd = builder.AddParameter("pwd", secret: true);
1607var postgres = builder.AddPostgres("postgres", usr, pwd).AsAzurePostgresFlexibleServer();
1712var usr = builder.AddParameter("usr");
1713var pwd = builder.AddParameter("pwd", secret: true);
1716var postgres = builder.AddPostgres("postgres", usr, pwd).PublishAsAzurePostgresFlexibleServer();
1749var postgres = builder.AddPostgres("postgres1")
1767var param = builder.AddParameter("param");
1813var serviceBus = builder.AddAzureServiceBus("sb");
1926var wps = builder.AddAzureWebPubSub("wps1");
1993var wps = builder.AddAzureWebPubSub("wps1")
2061var storage = builder.AddAzureStorage("storage").RunAsEmulator(e =>
2070var blob = storage.AddBlobs("blob");
2071var queue = storage.AddQueues("queue");
2072var table = storage.AddTables("table");
2099var storagesku = builder.AddParameter("storagesku");
2100var storage = builder.AddAzureStorage("storage")
2207var blob = storage.AddBlobs("blob");
2222var queue = storage.AddQueues("queue");
2237var table = storage.AddTables("table");
2257var storagesku = builder.AddParameter("storagesku");
2258var storage = builder.AddAzureStorage("storage")
2366var blob = storage.AddBlobs("blob");
2381var queue = storage.AddQueues("queue");
2396var table = storage.AddTables("table");
2416var storagesku = builder.AddParameter("storagesku");
2417var storage = builder.AddAzureStorage("storage")
2524var blob = storage.AddBlobs("blob");
2539var queue = storage.AddQueues("queue");
2554var table = storage.AddTables("table");
2574var storagesku = builder.AddParameter("storagesku");
2575var storage = builder.AddAzureStorage("storage")
2683var blob = storage.AddBlobs("blob");
2698var queue = storage.AddQueues("queue");
2713var table = storage.AddTables("table");
2734var sku = builder.AddParameter("searchSku");
2735var search = builder.AddAzureSearch("search")
2829var ai = builder.AddAzureApplicationInsights("ai").PublishAsConnectionString();
2830var serviceBus = builder.AddAzureServiceBus("servicebus").PublishAsConnectionString();
2832var serviceA = builder.AddProject<ProjectA>("serviceA", o => o.ExcludeLaunchProfile = true)
2857var openai = builder.AddAzureOpenAI("openai")
2973var provisioningResource = builder.AddAzureInfrastructure("infrastructure", r =>
2987var provisioningResource = builder.AddAzureInfrastructure("infrastructure", r =>
ExistingAzureResourceExtensionsTests.cs (25)
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")
49var nameParameter = builder.AddParameter("name", "existingName");
50var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
51var nameParameter1 = builder.AddParameter("name1", "existingName");
52var resourceGroupParameter1 = builder.AddParameter("resourceGroup1", "existingResourceGroup");
54var serviceBus = builder.AddAzureServiceBus("sb")
70var nameParameter = builder.AddParameter("name", "existingName");
71var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
73var serviceBus = builder.AddAzureServiceBus("sb")
88var nameParameter = builder.AddParameter("name", "existingName");
89var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
90var nameParameter1 = builder.AddParameter("name1", "existingName");
91var resourceGroupParameter1 = builder.AddParameter("resourceGroup1", "existingResourceGroup");
93var serviceBus = builder.AddAzureServiceBus("sb")
104public static TheoryData<Func<string, string, string, IResourceBuilder<IAzureResource>>> AsExistingMethodsWithString =>
113public void CanCallAsExistingWithStringArguments(Func<string, string, string, IResourceBuilder<IAzureResource>> runAsExisting)
115var serviceBus = runAsExisting("existingName", "existingResourceGroup", "sb");
129var nameParameter = builder.AddParameter("name", "existingName");
130var resourceGroupParameter = builder.AddParameter("resourceGroup", "existingResourceGroup");
132var serviceBus = builder.AddAzureServiceBus("sb")
Aspire.Hosting.Azure.WebPubSub (9)
Aspire.Hosting.Containers.Tests (45)
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 (24)
29var parameter = builder.AddParameter("secret", secret: true);
98var dockerFile = builder.AddDockerfile(resourceName, tempContextPath, tempDockerfilePath);
116var dockerFile = builder.AddContainer(resourceName, "someimagename")
131var dockerFile = builder.AddContainer("testcontainer", "someimagename")
151var dockerFile = builder.AddContainer("testcontainer", "someimagename")
243var parameter = builder.AddParameter("message");
245var container = builder.AddContainer("testcontainer", "testimage")
291var parameter = builder.AddParameter("message");
293var container = builder.AddDockerfile("testcontainer", tempContextPath, tempDockerfilePath, "runner")
338var parameter = builder.AddParameter("secret", secret: true);
340var container = builder.AddContainer("testcontainer", "testimage")
384var parameter = builder.AddParameter("secret", secret: true);
386var container = builder.AddDockerfile("testcontainer", tempContextPath, tempDockerfilePath)
427var parameter = builder.AddParameter("message");
498var parameter = builder.AddParameter("message");
593var container = builder.AddContainer("mycontainer", "myimage");
614var container = builder.AddContainer("mycontainer", "myimage")
630var container = builder.AddDockerfile("mycontainer", tempContextPath);
645var container = builder.AddContainer("mycontainer", "myimage")
661var container = builder.AddDockerfile("mycontainer", tempContextPath, "Dockerfile");
676var container = builder.AddContainer("mycontainer", "myimage")
692var container = builder.AddDockerfile("mycontainer", tempContextPath, "Otherdockerfile");
707var container = builder.AddContainer("mycontainer", "myimage")
723var 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)
53/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
54public 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.:
103/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
104public static IResourceBuilder<GarnetResource> WithDataVolume(this IResourceBuilder<GarnetResource> builder,
124/// Use <see cref="WithPersistence(IResourceBuilder{GarnetResource}, TimeSpan?)"/> to adjust Garnet persistence configuration, e.g.:
138/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
139public static IResourceBuilder<GarnetResource> WithDataBindMount(this IResourceBuilder<GarnetResource> builder,
158/// Use with <see cref="WithDataBindMount(IResourceBuilder{GarnetResource}, string, bool)"/>
159/// or <see cref="WithDataVolume(IResourceBuilder{GarnetResource}, string?, bool)"/> to persist Garnet data across sessions with custom persistence configuration, e.g.:
169/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
171public static IResourceBuilder<GarnetResource> WithPersistence(this IResourceBuilder<GarnetResource> builder,
180/// Use with <see cref="WithDataBindMount(IResourceBuilder{GarnetResource}, string, bool)"/>
181/// or <see cref="WithDataVolume(IResourceBuilder{GarnetResource}, string?, bool)"/> to persist Garnet data across sessions with custom persistence configuration, e.g.:
191/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
192public 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)
40/// <returns>A reference to the <see cref="IResourceBuilder{MilvusServerResource}"/>.</returns>
41public static IResourceBuilder<MilvusServerResource> AddMilvus(this IDistributedApplicationBuilder builder,
43IResourceBuilder<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)
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)
32/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
33public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port)
46/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
47public static IResourceBuilder<MongoDBServerResource> AddMongoDB(this IDistributedApplicationBuilder builder,
50IResourceBuilder<ParameterResource>? userName = null,
51IResourceBuilder<ParameterResource>? password = null)
99/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
100public static IResourceBuilder<MongoDBDatabaseResource> AddDatabase(this IResourceBuilder<MongoDBServerResource> builder, [ResourceName] string name, string? databaseName = null)
146/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
147public static IResourceBuilder<T> WithMongoExpress<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<MongoExpressContainerResource>>? configureContainer = null, string? containerName = null) where T : MongoDBServerResource
154var resourceBuilder = builder.ApplicationBuilder.AddResource(mongoExpressContainer)
173public static IResourceBuilder<MongoExpressContainerResource> WithHostPort(this IResourceBuilder<MongoExpressContainerResource> builder, int? port)
189/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
190public static IResourceBuilder<MongoDBServerResource> WithDataVolume(this IResourceBuilder<MongoDBServerResource> builder, string? name = null, bool isReadOnly = false)
203/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
204public static IResourceBuilder<MongoDBServerResource> WithDataBindMount(this IResourceBuilder<MongoDBServerResource> builder, string source, bool isReadOnly = false)
218/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
219public 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)
29/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
30public static IResourceBuilder<NatsServerResource> AddNats(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port)
46/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
47public static IResourceBuilder<NatsServerResource> AddNats(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null,
48IResourceBuilder<ParameterResource>? userName = null,
49IResourceBuilder<ParameterResource>? password = null)
111/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
113public static IResourceBuilder<NatsServerResource> WithJetStream(this IResourceBuilder<NatsServerResource> builder, string? srcMountPath = null)
130/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
131public static IResourceBuilder<NatsServerResource> WithJetStream(this IResourceBuilder<NatsServerResource> builder)
144/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
145public static IResourceBuilder<NatsServerResource> WithDataVolume(this IResourceBuilder<NatsServerResource> builder, string? name = null, bool isReadOnly = false)
160/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
161public 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)
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<PostgresServerResource> AddPostgres(this IDistributedApplicationBuilder builder,
41IResourceBuilder<ParameterResource>? userName = null,
42IResourceBuilder<ParameterResource>? password = null,
96/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
100/// using the <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
104/// Note that by default calling <see cref="AddDatabase(IResourceBuilder{PostgresServerResource}, string, string?)"/>
106/// will create the database. As a result if <see cref="ResourceBuilderExtensions.WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/>
110public static IResourceBuilder<PostgresDatabaseResource> AddDatabase(this IResourceBuilder<PostgresServerResource> builder, [ResourceName] string name, string? databaseName = null)
132/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
133public static IResourceBuilder<T> WithPgAdmin<T>(this IResourceBuilder<T> builder, Action<IResourceBuilder<PgAdminContainerResource>>? configureContainer = null, string? containerName = null) where T : PostgresServerResource
139var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgAdminResource);
148var pgAdminContainerBuilder = builder.ApplicationBuilder.AddResource(pgAdminContainer)
220public static IResourceBuilder<PgAdminContainerResource> WithHostPort(this IResourceBuilder<PgAdminContainerResource> builder, int? port)
236public static IResourceBuilder<PgWebContainerResource> WithHostPort(this IResourceBuilder<PgWebContainerResource> builder, int? port)
268/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
269public static IResourceBuilder<PostgresServerResource> WithPgWeb(this IResourceBuilder<PostgresServerResource> builder, Action<IResourceBuilder<PgWebContainerResource>>? configureContainer = null, string? containerName = null)
273var builderForExistingResource = builder.ApplicationBuilder.CreateResourceBuilder(existingPgWebResource);
282var pgwebContainerBuilder = builder.ApplicationBuilder.AddResource(pgwebContainer)
368/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
369public static IResourceBuilder<PostgresServerResource> WithDataVolume(this IResourceBuilder<PostgresServerResource> builder, string? name = null, bool isReadOnly = false)
383/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
384public static IResourceBuilder<PostgresServerResource> WithDataBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = false)
398/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
399public 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")
80IResourceBuilder<PgAdminContainerResource>? adminBuilder = null;
81var redis = builder.AddPostgres("postgres").WithPgAdmin(c => adminBuilder = c);
110var postgres = builder.AddPostgres("pg").WithEnvironment("POSTGRES_DB", postgresDbName);
111var db = postgres.AddDatabase(postgresDbName);
149IResourceBuilder<PgWebContainerResource>? pgWebBuilder = null;
151var pg = builder.AddPostgres("pg1");
152var db = pg.AddDatabase(dbName);
207var usernameParameter = builder1.AddParameter("user", username);
208var passwordParameter = builder1.AddParameter("pwd", password, secret: true);
209var postgres1 = builder1.AddPostgres("pg", usernameParameter, passwordParameter).WithEnvironment("POSTGRES_DB", postgresDbName);
211var db1 = postgres1.AddDatabase(postgresDbName);
278var postgres2 = builder2.AddPostgres("pg", usernameParameter, passwordParameter);
279var db2 = postgres2.AddDatabase(postgresDbName);
381var postgres = builder.AddPostgres("pg").WithEnvironment("POSTGRES_DB", postgresDbName);
382var 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 (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 (43)
Aspire.Hosting.Seq (7)
Aspire.Hosting.SqlServer (12)
Aspire.Hosting.SqlServer.Tests (28)
Aspire.Hosting.Testing (6)
Aspire.Hosting.Testing.Tests (3)
Aspire.Hosting.Tests (188)
Dcp\DcpExecutorTests.cs (11)
243var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
275var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
307var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
340var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo")
500(Action<IResourceBuilder<ExecutableResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [
529var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo");
944(Action<IResourceBuilder<ContainerResource>> AddEndpoint, string ErrorMessageFragment)[] testcases = [
968var ctr = builder.AddContainer("database", "image");
1128var container = builder.AddContainer("database", "image");
1129var exe = builder.AddExecutable("node", "node.exe", ".");
1130var 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);
72var child2 = builder.AddContainer("child2", "image").WithParentRelationship(parent);
74var nestedChild = builder.AddContainer("nested-child", "image").WithParentRelationship(child);
135var firstParent = builder.AddContainer("firstParent", "image");
136var secondParent = builder.AddContainer("secondParent", "image");
138var child = builder.AddContainer("child", "image");
193var projectA = builder.AddProject<ProjectA>("projecta");
194var projectB = builder.AddProject<ProjectB>("projectb").WithParentRelationship(projectA);
240var container1 = builder.AddContainer("container1", "image");
241var container2 = builder.AddContainer("container2", "image2");
242var 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 (9)
22var throwingResource = builder.AddContainer("throwingresource", "doesnotmatter")
24var dependingContainerResource = builder.AddContainer("dependingcontainerresource", "doesnotmatter")
26var dependingExecutableResource = builder.AddExecutable("dependingexecutableresource", "doesnotmatter", "alsodoesntmatter")
95var cs = builder.AddConnectionString("cs");
96var param = builder.AddParameter("param", "value");
329var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
485var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
589var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
638var nginx = builder.AddContainer("nginx", "mcr.microsoft.com/cbl-mariner/base/nginx", "1.22")
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)
55/// <returns>A reference to the <see cref="IResourceBuilder{T}"/>.</returns>
56public static IResourceBuilder<ValkeyResource> AddValkey(this IDistributedApplicationBuilder builder,
96/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.:
104/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
105public static IResourceBuilder<ValkeyResource> WithDataVolume(this IResourceBuilder<ValkeyResource> builder,
129/// Use <see cref="WithPersistence(IResourceBuilder{ValkeyResource}, TimeSpan?, long)"/> to adjust Valkey persistence configuration, e.g.:
137/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
138public static IResourceBuilder<ValkeyResource> WithDataBindMount(this IResourceBuilder<ValkeyResource> builder,
158/// Use with <see cref="WithDataBindMount(IResourceBuilder{ValkeyResource}, string, bool)"/>
159/// or <see cref="WithDataVolume(IResourceBuilder{ValkeyResource}, string?, bool)"/> to persist Valkey data across sessions with custom persistence configuration, e.g.:
167/// <returns>The <see cref="IResourceBuilder{T}"/>.</returns>
168public 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 (20)
CdkSample.AppHost (20)
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)
TestingAppHost1.AppHost (2)
TestProject.AppHost (8)
TestShop.AppHost (6)
WaitForSandbox.AppHost (3)
WebPubSub.AppHost (2)
WithDockerfile.AppHost (2)