0

I have followed the following for How to reference Key Vault connection strings from an Azure App Service.

https://davecallan.com/how-to-reference-key-vault-connection-strings-from-an-azure-app- 
service/

The connection string has a name of "sqlconnection" in the App Service Configuration. I then deleted this entry from the Configuration Json file and restarted the Web app.

I then try to connect but it gives a database error with no details.

Any ideas on this ?

Jennifer
  • 31
  • 6

1 Answers1

0

I tried to reproduce the same in my environment like below:

I created a key vault with Azure role-based access control (RBAC) like below:

enter image description here

Make sure to add Key Vault Administrator role in Access control like below:

enter image description here

Generate a key vault secret under setting. While generating secret of type as Manual name and set the value to the current SQL Database connection string stored in the Application web.config

enter image description here

Try to use Secret value connection string of your sql database like below:

enter image description here

Then you can able to see Secret Identifier like below:

enter image description here

In your web app -> under setting click configuration -> click new connection string

enter image description here

Type the name of the connection string and set the value @Microsoft.KeyVault(SecretUri=VALUE), where the VALUE

enter image description here

In Identity under setting -> make sure to add system assigned status as on like below:

enter image description here

Click on the "Role Assignments" button and then Add keyvault secrets user role like below:

enter image description here

As you are facing database error with no details you can check the Log4net errors under Portals_default\Logs.

Reference:

Connection strings and app settings not working properly on Azure App Service · Issue #4227 · dnnsoftware/Dnn.Platform · GitHub

Imran
  • 3,875
  • 2
  • 3
  • 12
  • I have tried all of this and no luck , still doesnt work – Jennifer Feb 08 '23 at 07:13
  • Kindly check this reference:- [Ref1](https://intelequia.com/blog/post/2070/storing-azure-app-service-secrets-on-azure-key-vault) & [Ref2](https://davecallan.com/how-to-reference-key-vault-connection-strings-from-an-azure-app-service/) – Imran Feb 08 '23 at 12:12