Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Release Notes

## 1.9.24
* Service Bus: Add validation for SKU-specific features (topics not supported on Basic SKU, max message size only supported on Premium SKU).
* SQL Azure: Support for fractional VCores such as (0.5, 0.75) in Serverless Gen5 databases.
* Virtual Machines: Added support for `deleteOption` on VM disks, NICs, and public IP addresses to automatically clean up resources when a VM is deleted.
* New builder keywords: `disk_delete_option`, `nic_delete_option`, `public_ip_delete_option`
* New convenience keyword: `delete_attached` to set all delete options at once
Expand Down
26 changes: 26 additions & 0 deletions docs/content/api-overview/resources/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,6 +96,10 @@ let myDatabases = sqlServer {
db_size (1024<Mb> * 128)
hybrid_benefit
}
sqlDb {
name "serverlessDb"
sku (GeneralPurpose(S_Gen5(0.5, 2.0))) // Serverless with fractional VCores
}
]
}

Expand Down Expand Up @@ -132,6 +154,10 @@ let myDatabases = sqlServer {
db_size (1024<Mb> * 128)
hybrid_benefit
}
sqlDb {
name "serverlessDb"
sku (GeneralPurpose(S_Gen5(0.5, 2.0))) // Serverless with fractional VCores
}
]
}

Expand Down
4 changes: 4 additions & 0 deletions samples/scripts/sqlserver.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ let myDatabases = sqlServer {
name "serverless4to8cpu"
sku (GeneralPurpose(S_Gen5(4, 8)))
}
sqlDb {
name "serverlessHalfCore"
sku (GeneralPurpose(S_Gen5(0.5, 2.0)))
}
]
}

Expand Down
2 changes: 1 addition & 1 deletion src/Farmer/Common.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,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<Gen5Series>)
Expand Down
36 changes: 36 additions & 0 deletions src/Tests/Sql.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Loading