corvus-dotnet / corvus-dotnet/Corvus.Storage

If IServiceIdentityAzureTokenCredentialSource is needed but not supplied, we should provide a better error

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Some storage configurations can cause `Corvus.Storage` to determine that it needs to use `IServiceIdentityAzureTokenCredentialSource` to authenticate. However, not all hosting environments will register an implementation of this interface, because there are scenarios in which it is unneeded, and might not make any sense (e.g., in a console application).

It is of course an error to put `Corvus.Storage` in a situation where configuration tells it that it should use `IServiceIdentityAzureTokenCredentialSource`, but to fail to supply such an implementation. `Corvus.Storage` currently responds to this situation by crashing with a `NullReferenceException`. It should report the problem with a more meaningful error, explaining that configuration requiring a service identity has been used, but the host has not registered an `IServiceIdentityAzureTokenCredentialSource` implementation.

The relevant code is in `CachingStorageContextFactory.GetKeyVaultSecretFromConfigAsync`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.