# AzureProvisionableAspireResource<T> Methods

- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Type: [AzureProvisionableAspireResource<T>](/reference/api/csharp/aspire.hosting.foundry/azureprovisionableaspireresource-1.md)
- Kind: `Methods`
- Members: `4`

An Aspire wrapper around an Azure.Provisioning.ProvisionableResource.

## AddAsExistingResource(AzureResourceInfrastructure)

- Name: `AddAsExistingResource(AzureResourceInfrastructure)`
- Modifiers: `virtual`
- Returns: `T`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/Project/AzureCognitiveServicesBase.cs#L36-L49)

```csharp
public abstract class AzureProvisionableAspireResource<T>
{
    public virtual T AddAsExistingResource(
        AzureResourceInfrastructure infra)
    {
        // ...
    }
}
```

## Parameters

- `infra` (`AzureResourceInfrastructure`)

## FromExisting(string)

- Name: `FromExisting(string)`
- Modifiers: `abstract`
- Returns: `T`

Gets the Azure.Provisioning resource from an existing Bicep identifier. Because static methods can't be abstract, this is an instance method.

```csharp
public abstract class AzureProvisionableAspireResource<T>
{
    public abstract T FromExisting(
        string bicepIdentifier)
    {
        // ...
    }
}
```

## Parameters

- `bicepIdentifier` (`string`)

## GetProvisionableResource(AzureResourceInfrastructure, string)

- Name: `GetProvisionableResource(AzureResourceInfrastructure, string)`
- Modifiers: `static` `nullable`
- Returns: `T?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/Project/AzureCognitiveServicesBase.cs#L23-L25)

Get the underlying provisionable resource of type T for the given AzureProvisioningResource.

```csharp
public abstract class AzureProvisionableAspireResource<T>
{
    public static T? GetProvisionableResource(
        AzureResourceInfrastructure infra,
        string bicepIdentifier)
    {
        // ...
    }
}
```

## Parameters

- `infra` (`AzureResourceInfrastructure`)
- `bicepIdentifier` (`string`)

## SetName(T, BicepValue<string>)

- Name: `SetName(T, BicepValue<string>)`
- Modifiers: `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.

```csharp
public abstract class AzureProvisionableAspireResource<T>
{
    public abstract void SetName(
        T provisionableResource,
        BicepValue<string> name)
    {
        // ...
    }
}
```

## Parameters

- `provisionableResource` (`T`)
- `name` (`BicepValue<string>`)
