AzureProvisioningResource.CreateExistingOrNewProvisionableResource<T> Method

Definition

Encapsulates the logic for creating an existing or new ProvisionableResource based on whether or not the ExistingAzureResourceAnnotation exists on the resource.

C#
public static T CreateExistingOrNewProvisionableResource<T>(Aspire.Hosting.Azure.AzureResourceInfrastructure infrastructure, Func<string,Azure.Provisioning.BicepValue<string>,T> createExisting, Func<Aspire.Hosting.Azure.AzureResourceInfrastructure,T> createNew) where T : Azure.Provisioning.Primitives.ProvisionableResource;

Type Parameters

T

The type of ProvisionableResource to produce.

Parameters

createExisting
Func<String,BicepValue<String>,T>

A callback to create the existing resource.

createNew
Func<AzureResourceInfrastructure,T>

A callback to create the new resource.

Returns

T

The provisioned resource.

Applies to

Producto Versiones
.NET Aspire 9.1.0