3

I am using User Secrets for my Blazor ASP.NET Core 3.1 application and it works really well in my development environment. However, I am anticipating the moment that I will have to export these values to my production environment and am having trouble finding any resources around this.

I did find this question/answer: How to deploy ASP.NET Core UserSecrets to production

However, it doesn't seem to provide an easy way of exporting data from development to production, which in my case would be either Azure App Service Environment Variables or Azure Key Vault.

Is the expectation that I will have to manually export each and every value one by one into the target destination?

That is what is implied in this otherwise well-written and valuable article regarding Azure Key Vault configuration:

https://learn.microsoft.com/en-us/aspnet/core/security/key-vault-configuration?view=aspnetcore-3.1#secret-storage-in-the-production-environment-with-azure-key-vault

That seems like a lot of work especially with how easily User Secrets were to initialize, setup, and manage in Visual Studio.

It even has its own right-click menu!

enter image description here

In particular, I am interested in being able to easily export the Visual Studio User Secrets secrets.json file with one command to either Azure App Service Environmental Variables or Azure Key Vault. I haven't decided on which one but one of these will be my final destination so it would be nice to know how to easily deploy to either of them.

Is this possible and, if so, how?

The thought does strike me that I could use a PowerShell script. However, I am not finding anything of the sort and want to verify that something hasn't already been reliably created before venturing off to my own devices.

Mike-E
  • 2,477
  • 3
  • 22
  • 34

0 Answers0