Share via


AzureSqlExtensions.AddDatabase Method

Definition

Adds an Azure SQL Database to the application model.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureSqlDatabaseResource> AddDatabase (this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureSqlServerResource> builder, string name, string? databaseName = default);
static member AddDatabase : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureSqlServerResource> * string * string -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureSqlDatabaseResource>
<Extension()>
Public Function AddDatabase (builder As IResourceBuilder(Of AzureSqlServerResource), name As String, Optional databaseName As String = Nothing) As IResourceBuilder(Of AzureSqlDatabaseResource)

Parameters

builder
IResourceBuilder<AzureSqlServerResource>

The builder for the Azure SQL resource.

name
String

The name of the resource. This name will be used as the connection string name when referenced in a dependency.

databaseName
String

The name of the database. If not provided, this defaults to the same value as name.

Returns

A reference to the IResourceBuilder<T>.

Applies to