For user secret management, I use user secrets for the development stage and I want to use Azure key vault for release and staging. I have this configuration
"ConnectionStrings": {
"DefaultConnection": "MySecretConnectionString"
},
"SmtpSettings": {
"SmtpMailServer": "smtp.mailserver.somewhere",
"SmtpPort": "465",
"SenderLogin": "login",
"SenderDisplayName": "Site ",
"SenderPassword": "password",
"SenderEmail": "[email protected]",
"SecureSocketSettings": "SslOnConnect"
}
Problem arises when i want to set ConnectionStrings:DefaultConnection
or SmtpSettings:SenderPassword
in in Azure key vault.
Is there any way to assign and use value to nested properties? For example like I do for user-secrets with
dotnet user-secrets set "SmtpSettings:SenderPassword" "########" --project MyProject
but for Azure key vault
az keyvault secret set --name "SmtpSettings:SenderPassword" --value "######" --vault-name MyProjectVault
: is not allowed, Parameter 'secret_name' must conform to the following pattern: '^[0-9a-zA-Z-]+$'.