# AzureBicepResourceAnnotation

- Kind: `class`
- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure/BicepResourceAnnotation.cs)
- Implements: `IResourceAnnotation`

Used to annotate resources as being potentially deployable by the `Azure.AzureProvisioner`.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureBicepResourceAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Remarks

The `Azure.AzureProvisioner` is only capable of deploying resources that implement [IAzureResource](/reference/api/csharp/aspire.hosting.azure/iazureresource.md) and only has built-in deployment logic for resources that derive from [AzureBicepResource](/reference/api/csharp/aspire.hosting.azure/azurebicepresource.md). This annotation that can be added to any `ApplicationModel.IResource` will be detected by the `Azure.AzureProvisioner` and used to provision an Azure resource for an Aspire resource type that does not itself derive from [AzureBicepResource](/reference/api/csharp/aspire.hosting.azure/azurebicepresource.md).

For example, the following code adds a [https://learn.microsoft.com/dotnet/api/aspire.hosting.applicationmodel.sqlserverserverresource](https://learn.microsoft.com/dotnet/api/aspire.hosting.applicationmodel.sqlserverserverresource) resource to the application model. This type does not derive from [AzureBicepResource](/reference/api/csharp/aspire.hosting.azure/azurebicepresource.md) but can be annotated with [AzureBicepResourceAnnotation](/reference/api/csharp/aspire.hosting.azure/azurebicepresourceannotation.md) by using the AzureSqlExtensions.AsAzureSqlDatabase() extension method.

```csharp
var builder = DistributedApplication.CreateBuilder();
builder.AddAzureProvisioning();
var sql = builder.AddSqlServerServer("sql"); // This resource would not be deployable via Azure Provisioner.
sql.AsAzureSqlDatabase(); // ... but it now is because this adds the AzureBicepResourceAnnotation annotation.
```

## Constructors

- [AzureBicepResourceAnnotation(AzureBicepResource)](/reference/api/csharp/aspire.hosting.azure/azurebicepresourceannotation/constructors.md#constructor-azurebicepresource) -- Used to annotate resources as being potentially deployable by the `Azure.AzureProvisioner`.

## Properties

- [Resource](/reference/api/csharp/aspire.hosting.azure/azurebicepresourceannotation/properties.md#resource) : [AzureBicepResource](/reference/api/csharp/aspire.hosting.azure/azurebicepresource.md) `get` -- The [AzureBicepResource](/reference/api/csharp/aspire.hosting.azure/azurebicepresource.md) derived resource.
