Database Mail with Key Vault
Hi
We are in the process of migrating our on-prem sql to Azure SQL Managed instance. we are using the database mail feature. One of the steps while configuring the Database Mail is creating a database mail account
Create a Database Mail account
EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = '...',
@description = '...',
@email_address = '$(loginEmail)',
@display_name = '...',
@mailserver_name = '$(mailserver)' ,
@username = '$(loginEmail)' ,
@password = '$(password)'
as you see above, we need to pass in the username and password to sysmail_add_account_sp. This , i think , will store all the parameters in some internal sql tables.
Now we have a security guideline that says all passwords are to be stored only in the azure keyvault. And we have been asked to explore if the above database mail account can be setup with a password stored in keyvault rather than directly passing it to the sp like in the code above.
is this possible at all? any guidance here will be greatly appreciated.
thanks