Hi @Bhavya Shah,
Have you tried adding Key Vault to your web application using Visual Studio Connected Services.
You can follow the documentation steps below and follow this tutorial and your Key Vault permissions will be set up to work with your own Azure subscription.
Add Key Vault to your web application by using Visual Studio Connected Services
You can also refer to the following documents:
How to Override Web.config values with Azure KeyVault in .NET Framework 4.7.1
On-prem ASP.NET Framework web app with Azure Key Vault
Please note that I cannot use Environment.GetEnvironmentVariable() in this case because it is ASP.NET (Framework) app.
By the way, the Environment.GetEnvironmentVariable method is also available in the .NET Framework.
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.