Azure / azure-storage-ruby

Microsoft Azure Storage Library for Ruby
http://azure.github.io/azure-storage-ruby/
82 stars 158 forks source link

create_block_blob returns ResourceNotFound #219

Open BenG-x opened 2 years ago

BenG-x commented 2 years ago

I experience a problem when trying to create a block blob with create_block_blob with a client using a SAS token to authenticate:

client = Azure::Storage::Blob::BlobService.create(
  storage_account_name: 'my_account_name',
  storage_sas_token: 'sas_token'
)
client.create_block_blob('some_container_name', 'test123.csv', 'some_content')

# Azure::Core::Http::HTTPError: ResourceNotFound (404): The specified resource does not exist.

The credentials are valid and I am able to create a block blob using the Azure Storage Explorer.

I don't get the ResourceNotFound error - I am just trying to create the blob so of course is does not exist yet - according to the README there is also not something I have to do before (like initializing the blob). Or am I doing something wrong with authentication by SAS token?