Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using BlobService only with Endpoint & SAS-Token #77

Closed
magegu opened this issue Feb 26, 2017 · 2 comments
Closed

Using BlobService only with Endpoint & SAS-Token #77

magegu opened this issue Feb 26, 2017 · 2 comments

Comments

@magegu
Copy link

magegu commented Feb 26, 2017

Hi there.

I'm trying to figure out, how i would use the ruby sdk to upload a new object to the container.
I tried to use the create_from_connection_string method but i'll fail later when using the blob_client.

config = %{BlobEndpoint=https://#{someaccount}.blob.core.windows.net;SharedAccessSignature=sv=2015-12-11&ss=b&srt=o&sp=rw&se=2020-02-18T01:13:23Z&st=2017-02-17T17:13:23Z&spr=https&sig=1A5sp62Cx2ATRgNTzMVY2H73wjDdYdWxHXOPVw%2BMfEs%3D}
client = Azure::Storage::Client.create_from_connection_string(config)
blogs = client.blob_client

would crash with an exception:

/Users/magegu/.rvm/gems/ruby-2.3.1/gems/azure-core-0.1.7/lib/azure/core/auth/signer.rb:32:in `initialize': Signing key must be provided (ArgumentError)
	from /Users/magegu/.rvm/gems/ruby-2.3.1/gems/azure-core-0.1.7/lib/azure/core/auth/shared_key.rb:33:in `initialize'
	from /Users/magegu/.rvm/gems/ruby-2.3.1/gems/azure-storage-0.11.5.preview/lib/azure/storage/blob/blob_service.rb:43:in `new'

any suggestion how to solve this with the current SDK/API?

Thanks

@yaxia
Copy link
Member

yaxia commented Feb 27, 2017

@magegu Thanks for reporting the issue. There is an issue in this API and we are working on the fix. You might want to work around by:

require 'azure/storage'

signer = Azure::Storage::Core::Auth::SharedAccessSignatureSigner.new <storage_account_name>, <sas_token>
blob_client = Azure::Storage::Blob::BlobService.new(signer: signer)
blob_properties = blob_client.get_blob_properties container_name, blob_name

@yaxia
Copy link
Member

yaxia commented Feb 28, 2017

@magegu Please try 0.12.0-preview for the fix. Thanks.

@vinjiang vinjiang closed this as completed Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants