New-AzADAppCredential doesn't generate client secrets. So Let's just do it ourselves.
Install module from gallery
Install-Module SuperSecret.Tools -Scope CurrentUser
Import-Module SuperSecret.Tools
- To generate a new client secret and store as a secure string..
$clientSecret = New-ClientSecret
- To generate a new client secret and store as plain text..
$clientSecret = New-ClientSecret -PlainText
- Need to recover the secure string? No Worries..
$clientSecret | ConvertFrom-SecureSecret
Note: ConvertFrom-SecureSecret
works for any secure strings stored as variables - get creative.
.\Build.ps1 -ModulePath .\SuperSecret.Tools -BuildLocal
Import-Module ".\bin\release\*\SuperSecret.Tools" -Force #replace the * with release number generated from build.