ExistingAzureResourceExtensions.RunAsExisting Method

Definition

Overloads

RunAsExisting<T>(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>)

Marks the resource as an existing resource when the application is running.

RunAsExisting<T>(IResourceBuilder<T>, String, String)

Marks the resource as an existing resource when the application is running.

RunAsExisting<T>(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>)

Source:
ExistingAzureResourceExtensions.cs

Marks the resource as an existing resource when the application is running.

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> RunAsExisting<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ParameterResource> nameParameter, Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.ParameterResource>? resourceGroupParameter = default) where T : Aspire.Hosting.ApplicationModel.IAzureResource;

Type Parameters

T

The type of the resource.

Parameters

builder
IResourceBuilder<T>

The resource builder.

nameParameter
IResourceBuilder<ParameterResource>

The name of the existing resource.

resourceGroupParameter
IResourceBuilder<ParameterResource>

The name of the existing resource group, or null to use the current resource group.

Returns

The resource builder with the existing resource annotation added.

Applies to

.NET Aspire 9.1.0
Produit Versions
.NET Aspire 9.1.0

RunAsExisting<T>(IResourceBuilder<T>, String, String)

Source:
ExistingAzureResourceExtensions.cs

Marks the resource as an existing resource when the application is running.

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> RunAsExisting<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, string name, string? resourceGroup = default) where T : Aspire.Hosting.ApplicationModel.IAzureResource;

Type Parameters

T

The type of the resource.

Parameters

builder
IResourceBuilder<T>

The resource builder.

name
String

The name of the existing resource.

resourceGroup
String

The name of the existing resource group, or null to use the current resource group.

Returns

The resource builder with the existing resource annotation added.

Applies to

.NET Aspire 9.1.0
Produit Versions
.NET Aspire 9.1.0