0

I have succesfully connected an ASP.NET (.Net Framework 4.7.2) web application to a demo Azure Key Vault using a "quick" set up using the following links:

StackOverFlow

Microsoft Docementation

I can even read the secrets using the web.config file. But now, after testing the application, I need to change the azure suscription and the key vault accordingly to deploy the final version.

How I do this with ASP.NET? (I have found a lot of documentation supporting ASP.NET Core, but not ASP.NET).

When I open the Azure Key vault page in the "connected services" pane of the Deployment tab, I get a page like this:

enter image description here

But is the red highlighted area in the picture above, the links take me to the azure key vault web page. So, there is not a configuration page within Visual Studio to change the azure suscription and key vault. In the application there is only a reference to the key vault in the Web.Config file. The connectedService.json file does not contain any useful information either.

I need to read the secrets from the web.config and not from anyther place. I have even written a method to read the secrets overriding the web.config. But this not aceptable, since the application architecture reads all the connections from the web.config file

Any ideas, please?.

Rick_Barb
  • 15
  • 3
  • Is this link useful? https://social.msdn.microsoft.com/Forums/en-US/aee86abd-9152-4ea4-88ab-565bd91191bf/how-can-i-use-azure-key-vault-with-vs-2017-and-web-forms-app?forum=aspdotnetazure – D A Nov 19 '21 at 15:32
  • Thank you, but not. It's similar to the other links I posted. It only tells you how to assign a key vault the first time, but it doesn't tell you how to change the suscription nor the key vault for that suscription. – Rick_Barb Nov 19 '21 at 16:23
  • And there is another link: https://learn.microsoft.com/en-us/visualstudio/azure/vs-azure-tools-connected-services-app-configuration?view=vs-2022 But it's the same situation. – Rick_Barb Nov 19 '21 at 17:23
  • HI @Rick_Barb , Are you trying to change the existing key vault subscription in your application ? – ShrutiJoshi-MT Nov 20 '21 at 07:06

1 Answers1

0

On Work around

You can access different subscription for any of your accounts directly

1) Server Explorer by right-clicking on the Azure node, choosing Manage and Filter Subscriptions, enter image description here

2) You get the list all subscription select the subscription. and select the subscription for your application

enter image description here

To Move the key vault to another subscription refer this document:

ShrutiJoshi-MT
  • 1,622
  • 1
  • 4
  • 9