Skip to content
DocsTry Aspire
DocsTry

AzureProvisionableAspireResource<T> Methods

ClassMethods4 members
An Aspire wrapper around an Azure.Provisioning.ProvisionableResource.
AddAsExistingResource(AzureResourceInfrastructure)Section titled AddAsExistingResource(AzureResourceInfrastructure)overrideT
Adds a new Primitives.ProvisionableResource into infra. The new resource represents a reference to the current Azure.AzureProvisioningResource via https://learn.microsoft.com/azure/azure-resource-manager/bicep/existing-resource.
public abstract class AzureProvisionableAspireResource<T>
{
public override T AddAsExistingResource(
AzureResourceInfrastructure infra)
{
// ...
}
}
infraAzureResourceInfrastructureThe Azure.AzureResourceInfrastructure to add the existing resource into.
TA new Primitives.ProvisionableResource, typically using the FromExisting method on the derived Primitives.ProvisionableResource class.
FromExisting(string)Section titled FromExisting(string)abstractT
Gets the Azure.Provisioning resource from an existing Bicep identifier. Because static methods can't be abstract, this is an instance method.
public abstract class AzureProvisionableAspireResource<T>
{
public abstract T FromExisting(
string bicepIdentifier)
{
// ...
}
}
bicepIdentifierstring
GetProvisionableResource(AzureResourceInfrastructure, string)Section titled GetProvisionableResource(AzureResourceInfrastructure, string)staticnullableT?
Get the underlying provisionable resource of type T for the given AzureProvisioningResource.
public abstract class AzureProvisionableAspireResource<T>
{
public static T? GetProvisionableResource(
AzureResourceInfrastructure infra,
string bicepIdentifier)
{
// ...
}
}
infraAzureResourceInfrastructure
bicepIdentifierstring
SetName(T, BicepValue<string>)Section titled SetName(T, BicepValue<string>)abstract
Sets the name of the provisionable resource. This is needed because not all ProvisionableResource classes have a name property with a setter, and we can't put a type bound on T to require it.
public abstract class AzureProvisionableAspireResource<T>
{
public abstract void SetName(
T provisionableResource,
BicepValue<string> name)
{
// ...
}
}
provisionableResourceT
nameBicepValue<string>