serilog-sinks-azureblobstorage icon indicating copy to clipboard operation
serilog-sinks-azureblobstorage copied to clipboard

"blobEndpoint" is required after upgrade to 3.x

Open Gachapen opened this issue 2 years ago • 0 comments

Config that worked with 2.x:

    "WriteTo:AzureBlobStorage":
    {
      "Name": "AzureBlobStorage",
      "Args": {
        "accountName": "examplestorage",
        "sharedAccessSignature": "exampleSas",
        "writeInBatches": true,
        "period": "00:00:04",
        "batchPostingLimit": 1000,
        "storageContainerName": "exampleContainer",
        "storageFileName": "example.txt"
      }
    }

After 3.x, we get this error:

Error configuring AzureBlobStorage: System.NotSupportedException: 'blobEndpoint' must be provided
   at Serilog.LoggerConfigurationAzureBlobStorageExtensions.AzureBlobStorage(LoggerSinkConfiguration loggerConfiguration, ITextFormatter formatter, String sharedAccessSignature, String accountName, Uri blobEndpoint, LogEventLevel restrictedToMinimumLevel, String storageContainerName, String storageFileName, Boolean writeInBatches, Nullable`1 period, Nullable`1 batchPostingLimit, ICloudBlobProvider cloudBlobProvider, Nullable`1 blobSizeLimitBytes, Nullable`1 retainedBlobCountLimit, Boolean useUtcTimeZone)

Digging through the code, it looks like this change is the cause: https://github.com/chriswill/serilog-sinks-azureblobstorage/pull/78/files#diff-393b65822204c0e8a99ee47327343b6cb6644acd99472f81ae7bfdccd010976dR393

After the change, the optional blobEndpoint, which is "only needed for testing", is now required, and accountName is no longer used.

Gachapen avatar May 13 '22 12:05 Gachapen