As part of my effort to enhance my ASP.NET Core 3 web app with the ability to use Azure Blob storage, I need to understand the azure key vault.
So I'm following Quickstart: Azure Key Vault client library for .NET (SDK v4).
The sample code here demonstrates techniques for storing and fetching secrets to/from my key vault. Are these techniques appropriate for use inside of Kubernetes resident ASP.NET Core 3 Kestrel Web Apps? If not, please guide me to some appropriate sample code for fetching and storing secrets.
I enhance the sample console application to print the keyValutName retrieved from the environment variable and it is indeed correct.
I get the following error:
dotnet run
Creating a secret in kv-temp called 'mySecret' with the value '3.14159' ...Unhandled exception. Azure.Identity.AuthenticationFailedException: SharedTokenCacheCredential authentication failed: A configuration issue is preventing authentication - check the error message from the server for details.You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS70002: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https://go.microsoft.com/fwlink/?linkid=2083908.
What am I doing wrong? The error says to modify the configuration in application registration portal... This seems contrary to what I read in 'App identity and security principles' where the preferred approach is to NOT register the application.
Should I be registering this console application (and my ASP.NETCore Web App) in the azure portal? Should I be creating a principle?
Fri Oct 09 2020 Update
I followed Allen's instructions and did the git clone
and edited the source as per Allen's instructions and I'm getting this (similar) error:
MsalServiceException: AADSTS70002: The client does not exist or is not
enabled for consumers. If you are the application developer, configure a new
application through the App Registrations in the Azure Portal at
https://go.microsoft.com/fwlink/?linkid=2083908.
Trace ID: 4700fefb-af1b-4566-bba8-46ccdbac6a00
Correlation ID: 332949b6-7490-44b3-87e6-11163c3a70ec
Timestamp: 2020-10-09 13:49:26Z
Thank you
Siegfried