Using Account SAS
Hi, I'm trying to use an Account SAS for a blob container, but it doesn't seem to work, any help would be appreciated. I've tried what feels like everything, but I can't get it working at all.
This is my my current setup:
var log = new LoggerConfiguration()
.WriteTo.Async(a => a.AzureBlobStorage(
formatter: new CompactJsonFormatter(),
blobServiceClient: new BlobServiceClient(new Uri(config["SharedAccessSignature"])),
storageContainerName: "somecontainer",
storageFileName: "{yyyy}-{MM}-{dd}_log.txt"
))
.CreateLogger();
where config["SharedAccessSignature"] is the full SAS token URI (https://).
The BlobServiceClient seems to get built correctly, or at least no exceptions are thrown with the current setup, and the account name is set as it should.
Thanks a lot.
Overdue reply, but did you ever get this working? I did a lot of testing tonight for SaS and it worked with no issues.
I just used .WriteTo without Async, since Serilog 4 is now native async, and then I passed in a sharedAccessSignature and an accountUrl to complete the SaS connection. But your account should be fine as well.
Closing old thread