NovoNordisk.Configuration.AzureBlob 1.0.1

dotnet add package NovoNordisk.Configuration.AzureBlob --version 1.0.1
                    
NuGet\Install-Package NovoNordisk.Configuration.AzureBlob -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NovoNordisk.Configuration.AzureBlob" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NovoNordisk.Configuration.AzureBlob" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="NovoNordisk.Configuration.AzureBlob" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NovoNordisk.Configuration.AzureBlob --version 1.0.1
                    
#r "nuget: NovoNordisk.Configuration.AzureBlob, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=NovoNordisk.Configuration.AzureBlob&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=NovoNordisk.Configuration.AzureBlob&version=1.0.1
                    
Install as a Cake Tool

License: MIT NuGet Downloads NuGet Version

Azure Blob Storage Configuration Provider

This is a configuration provider for the built-in Configuration API, for reading JSON configuration files from Azure Blob Storage.

Features:

  • Authentication via Azure token credential
  • Reloadable config, with adjustable cadence
  • Invoke Action on exception

Installation

You can install the library via NuGet:

dotnet add package NovoNordisk.Configuration.AzureBlob

Usage

To get started, all you need is the URL for the specific blob you want to load.

var blobUrl = new Uri("...");
builder.Configuration.AddJsonBlob(blobUrl);

This requires the blob to be public. If you need to use Azure credentials to access the blob, these can be passed to the AddJsonBlob method.

var blobUrl = new Uri("...");
builder.Configuration.AddJsonBlob(blobUrl, tokenCredential: new DefaultAzureCredential());

By default, the blob is read on first use, and kept in the application. If the file is changed, and you want the application to react/update when the file changes, you need to enable reload.

var blobUrl = new Uri("...");
builder.Configuration.AddJsonBlob(blobUrl, reloadOnChange: true);

This will check the ETag on the file every 30 seconds. If you want to use a different cadence, you can specify a timespan for the delay between checks.

var blobUrl = new Uri("...");
builder.Configuration.AddJsonBlob(blobUrl, reloadOnChange: true, pollingInterval: TimeSpan.FromMinutes(5));

If, for any reason, an error occurs during a reload, you can specify an exception handler to be invoked.

var blobUrl = new Uri("...");
configurationBuilder.AddJsonBlob(blobUrl, exceptionHandler: exception =>
{
    Console.WriteLine(exception.Message);
});

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

References

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 759 5/19/2025
1.0.0 185 5/16/2025