microsoft / microsoft/aspire

Set defaults on Sql server instances

Open
#8,724 0 comments 0 reactions 0 assignees View on GitHub
area-integrations azure-sqlserver breaking-change
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] 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](https://github.com/user-attachments/assets/40db1ece-9de6-4a13-b620-935a008fcc3d)

### Describe the solution you'd like

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

### Additional context

Happy to complete this work

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.