From ae32bef7267fa42b4d79001fd7c05384bbbba92f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 02:33:35 +0000 Subject: [PATCH 1/4] Initial plan From b078a4a967592c2b5755a5c7d94d4db919bb1d95 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 02:47:21 +0000 Subject: [PATCH 2/4] Allow fractional VCores for Azure SQL Database Serverless (0.5, 0.75) Co-authored-by: ninjarobot <1520226+ninjarobot@users.noreply.github.com> --- samples/scripts/sqlserver.fsx | 6 +++++- src/Farmer/Common.fs | 2 +- src/Tests/Sql.fs | 38 ++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/samples/scripts/sqlserver.fsx b/samples/scripts/sqlserver.fsx index 80e6d46e1..64f590b2f 100644 --- a/samples/scripts/sqlserver.fsx +++ b/samples/scripts/sqlserver.fsx @@ -40,7 +40,11 @@ let myDatabases = sqlServer { } sqlDb { name "serverless4to8cpu" - sku (GeneralPurpose(S_Gen5(4, 8))) + sku (GeneralPurpose(S_Gen5(4.0, 8.0))) + } + sqlDb { + name "serverlessHalfCore" + sku (GeneralPurpose(S_Gen5(0.5, 2.0))) } ] } diff --git a/src/Farmer/Common.fs b/src/Farmer/Common.fs index d134b838b..dcb0c57d2 100644 --- a/src/Farmer/Common.fs +++ b/src/Farmer/Common.fs @@ -2005,7 +2005,7 @@ module Sql = | Gen5_32 | Gen5_40 | Gen5_80 - | S_Gen5 of CapacityMin: int * CapacityMax: int + | S_Gen5 of CapacityMin: float * CapacityMax: float member this.Name = Reflection.FSharpValue.GetUnionFields(this, typeof) diff --git a/src/Tests/Sql.fs b/src/Tests/Sql.fs index 9ec43c4d0..8e91457ba 100644 --- a/src/Tests/Sql.fs +++ b/src/Tests/Sql.fs @@ -262,7 +262,7 @@ let tests = add_databases [ sqlDb { name "mydb22" - sku (GeneralPurpose(S_Gen5(2, 4))) + sku (GeneralPurpose(S_Gen5(2.0, 4.0))) } ] } @@ -304,6 +304,42 @@ let tests = "Incorrect autoPauseDelay" } + test "Serverless sql supports fractional VCores (0.5 and 0.75)" { + let sql = sqlServer { + name "my38server" + admin_username "isaac" + + add_databases [ + sqlDb { + name "mydb23" + sku (GeneralPurpose(S_Gen5(0.5, 1.0))) + } + ] + } + + let template = arm { + location Location.UKSouth + add_resources [ sql ] + } + + let jsn = template.Template |> Writer.toJson + let jobj = jsn |> Newtonsoft.Json.Linq.JObject.Parse + + Expect.equal + (jobj + .SelectToken("resources[?(@.name=='my38server/mydb23')].sku.capacity") + .ToString()) + "1" + "Incorrect max capacity" + + Expect.equal + (jobj + .SelectToken("resources[?(@.name=='my38server/mydb23')].properties.minCapacity") + .ToString()) + "0.5" + "Incorrect min capacity - should support fractional VCores" + } + test "Must set either SQL Server or AD authentication" { Expect.throws (fun () -> sqlServer { name "test" } |> ignore) "Should throw if no auth set" } From 34bfce749460e8fb8ca14de82c2ff538a8d3c329 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 03:03:03 +0000 Subject: [PATCH 3/4] Maintain backward compatibility - integer literals work with float parameters Co-authored-by: ninjarobot <1520226+ninjarobot@users.noreply.github.com> --- samples/scripts/sqlserver.fsx | 2 +- src/Tests/Sql.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/scripts/sqlserver.fsx b/samples/scripts/sqlserver.fsx index 64f590b2f..5cc61d422 100644 --- a/samples/scripts/sqlserver.fsx +++ b/samples/scripts/sqlserver.fsx @@ -40,7 +40,7 @@ let myDatabases = sqlServer { } sqlDb { name "serverless4to8cpu" - sku (GeneralPurpose(S_Gen5(4.0, 8.0))) + sku (GeneralPurpose(S_Gen5(4, 8))) } sqlDb { name "serverlessHalfCore" diff --git a/src/Tests/Sql.fs b/src/Tests/Sql.fs index 8e91457ba..f61c8e568 100644 --- a/src/Tests/Sql.fs +++ b/src/Tests/Sql.fs @@ -262,7 +262,7 @@ let tests = add_databases [ sqlDb { name "mydb22" - sku (GeneralPurpose(S_Gen5(2.0, 4.0))) + sku (GeneralPurpose(S_Gen5(2, 4))) } ] } From 04ab0d212aa8e9ae7ed059de59b02ecc6d2778ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Oct 2025 15:25:02 +0000 Subject: [PATCH 4/4] Update release notes and documentation for fractional VCore support Co-authored-by: ninjarobot <1520226+ninjarobot@users.noreply.github.com> --- RELEASE_NOTES.md | 3 +++ docs/content/api-overview/resources/sql.md | 26 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 50251b359..ff4b0c7b4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,9 @@ Release Notes ============= +## 1.9.24 +* SQL Azure: Support for fractional VCores (0.5, 0.75) in Serverless Gen5 databases. + ## 1.9.23 * Actions Groups: Bump API version to `2025-09-01-preview`. diff --git a/docs/content/api-overview/resources/sql.md b/docs/content/api-overview/resources/sql.md index b5e59c4d4..0b04b7f99 100644 --- a/docs/content/api-overview/resources/sql.md +++ b/docs/content/api-overview/resources/sql.md @@ -48,6 +48,24 @@ The SQL Azure module contains two builders - `sqlServer`, used to create SQL Azu | collation | Sets the collation of the database. | | use_encryption | Enables transparent data encryption of the database. | +#### Serverless Gen5 SKU + +The Serverless Gen5 SKU (`S_Gen5`) supports fractional VCores, allowing you to specify capacity as low as 0.5 or 0.75 VCores for cost-effective serverless databases. You can specify both minimum and maximum capacity: + +```fsharp +// Serverless with fractional VCores +sqlDb { + name "serverlessDb" + sku (GeneralPurpose(S_Gen5(0.5, 2.0))) // min: 0.5 VCores, max: 2.0 VCores +} + +// Serverless with integer VCores (also supported) +sqlDb { + name "serverlessDb2" + sku (GeneralPurpose(S_Gen5(1, 4))) // min: 1 VCore, max: 4 VCores +} +``` + #### Example ##### AD auth not set @@ -78,6 +96,10 @@ let myDatabases = sqlServer { db_size (1024 * 128) hybrid_benefit } + sqlDb { + name "serverlessDb" + sku (GeneralPurpose(S_Gen5(0.5, 2.0))) // Serverless with fractional VCores + } ] } @@ -132,6 +154,10 @@ let myDatabases = sqlServer { db_size (1024 * 128) hybrid_benefit } + sqlDb { + name "serverlessDb" + sku (GeneralPurpose(S_Gen5(0.5, 2.0))) // Serverless with fractional VCores + } ] }