Lucene.Net.Store.Azure
Lucene.Net.Store.Azure copied to clipboard
Authentication with SAS tokens requires container creation privileges
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.