Skip to content

Set defaults on Sql server instances #8724

@FullStackChef

Description

@FullStackChef

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

It would be good if possible to add defaults for AddAzureSqlServer that set the SKU to the minimum available version if nothing is specified.

The reason for this is that not specifying it leads to azure auto creating the database at a general purpose vcore 2 with an estimated monthly cost of ~400
Image

Describe the solution you'd like

var sql = builder.AddAzureSqlServer("sqlserver").RunAsContainer(
    container => container.WithLifetime(ContainerLifetime.Persistent)
).ConfigureInfrastructure(c =>
{
    if (c.GetProvisionableResources().OfType<SqlDatabase>().SingleOrDefault() is SqlDatabase db)
    {
        db.Sku = new SqlSku
        {
            Name = "Basic",
            Tier = "Basic",
            Capacity = 5
        };
    }
}).AddDatabase("sqldb", "DatabaseName");

Additional context

Happy to complete this work

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packagesazure-sqlserverbreaking-changeIssue or PR that represents a breaking API or functional change over a prerelease.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions