Database connection string with azure keyvault in azure function local.setting.json
OS
0
Reputation points
Hi,
I am supporting an azure function someone wrote in c# in donnet frameworkcore 2.2.4. The function app is connecting to database using sql account and usernames and passwords are hardcode in connection string at the moment. We want to use azure keyvault now so that we dont have list password in connection string.
Here is the connection with hardcode username and password in local.setting.json file.
"SQLConnectionString":"Server=tcp:xxxx-sql.database.windows.net,1433;Initial Catalog=abc-db;Persist Security Info=False;User ID=xxxx;Password=xxxxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
Can you help me, how can I replace this connection string so that it gets username and password from Key vault secrets? I dont have much deeper knowledge of C#. Thank you for your help.
Sign in to answer