AzureProvisioningResource.CreateExistingOrNewProvisionableResource<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Encapsulates the logic for creating an existing or new ProvisionableResource based on whether or not the ExistingAzureResourceAnnotation exists on the resource.
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;
static member CreateExistingOrNewProvisionableResource : Aspire.Hosting.Azure.AzureResourceInfrastructure * Func<string, Azure.Provisioning.BicepValue<string>, 'T (requires 'T :> Azure.Provisioning.Primitives.ProvisionableResource)> * Func<Aspire.Hosting.Azure.AzureResourceInfrastructure, 'T (requires 'T :> Azure.Provisioning.Primitives.ProvisionableResource)> -> 'T (requires 'T :> Azure.Provisioning.Primitives.ProvisionableResource)
Public Shared Function CreateExistingOrNewProvisionableResource(Of T As ProvisionableResource) (infrastructure As AzureResourceInfrastructure, createExisting As Func(Of String, BicepValue(Of String), T), createNew As Func(Of AzureResourceInfrastructure, T)) As T
Type Parameters
- T
The type of ProvisionableResource to produce.
Parameters
- infrastructure
- AzureResourceInfrastructure
The AzureResourceInfrastructure that will contain the ProvisionableResource.
- 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
The provisioned resource.