ParameterResourceBuilderExtensions.CreateDefaultPasswordParameter Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a default password parameter that generates a random password.
public static Aspire.Hosting.ApplicationModel.ParameterResource CreateDefaultPasswordParameter (Aspire.Hosting.IDistributedApplicationBuilder builder, string name, bool lower = true, bool upper = true, bool numeric = true, bool special = true, int minLower = 0, int minUpper = 0, int minNumeric = 0, int minSpecial = 0);
static member CreateDefaultPasswordParameter : Aspire.Hosting.IDistributedApplicationBuilder * string * bool * bool * bool * bool * int * int * int * int -> Aspire.Hosting.ApplicationModel.ParameterResource
Public Function CreateDefaultPasswordParameter (builder As IDistributedApplicationBuilder, name As String, Optional lower As Boolean = true, Optional upper As Boolean = true, Optional numeric As Boolean = true, Optional special As Boolean = true, Optional minLower As Integer = 0, Optional minUpper As Integer = 0, Optional minNumeric As Integer = 0, Optional minSpecial As Integer = 0) As ParameterResource
Parameters
- builder
- IDistributedApplicationBuilder
Distributed application builder
- name
- String
Name of parameter resource
- lower
- Boolean
true
if lowercase alphabet characters should be included; otherwise, false
.
- upper
- Boolean
true
if uppercase alphabet characters should be included; otherwise, false
.
- numeric
- Boolean
true
if numeric characters should be included; otherwise, false
.
- special
- Boolean
true
if special characters should be included; otherwise, false
.
- minLower
- Int32
The minimum number of lowercase characters in the result.
- minUpper
- Int32
The minimum number of uppercase characters in the result.
- minNumeric
- Int32
The minimum number of numeric characters in the result.
- minSpecial
- Int32
The minimum number of special characters in the result.
Returns
The created ParameterResource.
Remarks
To ensure the generated password has enough entropy, see the remarks in GenerateParameterDefault.
The value will be saved to the app host project's user secrets store when IsRunMode is true
.