ExistingAzureResourceExtensions.PublishAsExisting Method

Definition

Overloads

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

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

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

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

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

Source:
ExistingAzureResourceExtensions.cs

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

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> PublishAsExisting<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
Product Versions
.NET Aspire 9.1.0

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

Source:
ExistingAzureResourceExtensions.cs

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

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> PublishAsExisting<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
Product Versions
.NET Aspire 9.1.0