0

I have a Blazor server side web app. I've pushed it up to Azure app service. To run it I need to give it access to the secrets I've got in a json file on my computer.

Where/how do I push these up to Azure so that the app service can provide them to my application?

I'm guessing I'm asking wrong, but what I've found via search is not telling me how to transfer these settings over.

And if the answer is place it in the app service configuration part - that's key value pairs. So how do I handle:

"Twilio": {
    "VerifyApiKey": "abc",
    "AccountSID": "def",
    "AuthToken": "ghi"
  },
David Thielen
  • 28,723
  • 34
  • 119
  • 193
  • I wanted to write an answer but this [video](https://www.youtube.com/watch?v=f8Hf-YUrC10) shows everything you need to know. There are some parts which could be done even nicer but it should get you started. [Here](https://learn.microsoft.com/en-us/aspnet/core/security/key-vault-configuration?view=aspnetcore-7.0#use-managed-identities-for-azure-resources) you can find a better way of configuring the AddAzureKeyVault() function. Let me know if you need any more help or if I should write a complete answer. – Silvan Jul 12 '23 at 20:17
  • @Silvan They're both close but they skip over parts. If you could write a detailed answer that references them, that would be fantastic. For example, what are the steps to create the AD user, how is that user "logged in" for the application, what are the exact steps to tie that user to allowing access of the key vault, etc. TIA – David Thielen Jul 12 '23 at 23:02
  • Why does the user need to access the secrets? You only put application secrets into the key vault. The `AuthToken` you have to fetch during the runtime of your application. I assume the `AccountSID` you also don't need to hide so it can just live in the `appsettings.json` directly – Silvan Jul 13 '23 at 06:38
  • You can store the values in JSON format in `Azure App Configuration` => Configuration explorer.[Image](https://i.stack.imgur.com/9kAsg.png). – Harshitha Jul 13 '23 at 11:13
  • [App Configuration image](https://i.stack.imgur.com/VuXbB.png) – Harshitha Jul 13 '23 at 11:15
  • @Harshitha thank you. That's a good temp fix as I figure out the key vault stuff. – David Thielen Jul 13 '23 at 12:47
  • @DavidThielen - So you have opted storing in Azure Key-Vault or still looking for more details? – Harshitha Jul 13 '23 at 16:57
  • 1
    @Harshitha I figure, from what I've read, that Key Vault is the most secure and works well once set up. If there's something else that's better, I'm very open to learning about it. TIA – David Thielen Jul 13 '23 at 19:32

0 Answers0