Class ServiceCollectionExtensions
- Namespace
- Kentico.Xperience.AzureStorage
- Assembly
- Kentico.Xperience.AzureStorage.dll
Extension methods for configuring Azure services in the dependency injection container.
public static class ServiceCollectionExtensions
- Inheritance
-
objectServiceCollectionExtensions
Methods
AddAzureStorageCredential(IServiceCollection, Func<IServiceProvider, TokenCredential>)
Configures Azure Storage to use TokenCredential-based authentication (managed identity) instead of shared key authentication.
public static IServiceCollection AddAzureStorageCredential(this IServiceCollection services, Func<IServiceProvider, TokenCredential> credentialFactory)
Parameters
servicesIServiceCollectionThe service collection to add the credential factory to.
credentialFactoryFunc<IServiceProvider, TokenCredential>A factory function that receives the service provider and returns a Azure.Core.TokenCredential. The service provider can be used to resolve other services needed for credential configuration.
Returns
- IServiceCollection
The service collection for chaining.
Remarks
See official Microsoft documentation on how to configure the managed identity credentials.