Lucene.Net.Store.Azure icon indicating copy to clipboard operation
Lucene.Net.Store.Azure copied to clipboard

Authentication with SAS tokens requires container creation privileges

Open Kargo opened this issue 3 years ago • 0 comments

Authenticating the Azure client using a SAS token, without container creation privileges, causes the application to crash.

So far I've identified the following code in AzureDirectory.cs as part of the problem:

public void CreateContainer()
{
    _blobContainer = _blobClient.GetContainerReference(_catalog);

    // create it if it does not exist
    _blobContainer.CreateIfNotExists();
}

The call to CreateIfNotExist() will fail with HTTP status code 403 if the provided credentials lack container creation privileges. This happens even when the container already exists.

Kargo avatar Jan 06 '23 12:01 Kargo