AzureBicepResourceAnnotation Constructors
Azure.AzureProvisioner . Constructor(AzureBicepResource) Section titled Constructor(AzureBicepResource)Azure.AzureProvisioner . public class AzureBicepResourceAnnotation{ public AzureBicepResourceAnnotation( AzureBicepResource resource) { // ... }}Parameters
resourceAzureAzureBicepResource which should be used by the Azure.AzureProvisioner .Remarks
The Azure. is only capable of deploying resources that implement I and only has built-in deployment logic for resources that derive from Azure. This annotation that can be added to any Application will be detected by the Azure. and used to provision an Azure resource for an Aspire resource type that does not itself derive from Azure.
For example, the following code adds a https://learn.microsoft.com/dotnet/api/aspire.hosting.applicationmodel.sqlserverserverresource resource to the application model. This type does not derive from Azure but can be annotated with Azure by using the AzureSqlExtensions.AsAzureSqlDatabase() extension method.
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.