install the aforementioned nuget package
Create the builder:
type Program = class end
[<EntryPoint>]
let main _ =
let config =
ConfigurationBuilder()
.AddUserSecrets<Program>()
.Build()
// config["secrets:your-secret"]
0
F# CLI apps typically just use modules and keep it clean and functional. But AddUserSecrets() expects a class or a type.