https://github.com/arnab-developer/aspnetazurekeyvaultdemo
ASP.NET Azure key vault demo
https://github.com/arnab-developer/aspnetazurekeyvaultdemo
Last synced: 3 months ago
JSON representation
ASP.NET Azure key vault demo
- Host: GitHub
- URL: https://github.com/arnab-developer/aspnetazurekeyvaultdemo
- Owner: Arnab-Developer
- License: mit
- Created: 2021-08-28T05:47:25.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T03:10:27.000Z (12 months ago)
- Last Synced: 2025-01-17T02:24:09.460Z (5 months ago)
- Language: C#
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ASP.NET Azure key vault demo
A demo to show how an ASP.NET app can access Azure key vault secret.
Application secrets should not be stored in `appsettings.json`. When the app is
running in local machine then it should read the secrets from
[user secret](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-5.0&tabs=windows#how-the-secret-manager-tool-works).
When the app is deployed and running from Azure then it should read secrets from
[key vault](https://azure.microsoft.com/en-gb/services/key-vault/).With this sample app you can able to see how 'appsettings' value has been overwritten
by 'user secret' and 'user secret' value has been overwritten by 'azure key vault'.## Run this app from local with 'user secret'
- Clone the repo.
- Open the solution with Visual Studio.
- Right click on the project and click on 'Manage User Secrets'.
- Use below json in the user secret
```json
{
"Address": "user secret value"
}
```
- Press F5 in Visual Studio to run the app.## Run this app from azure with 'azure key vault'
- Create app service in azure and deploy this app.
- Create key vault and add 'Address' secret with some value.
- You need to 'add access policy' in the key vault with the app service identity
principal so that the application can access key vault successfully.
- Run the app