johnnyhalife / waz-storage

A simple implementation of Windows Azure Storage API for Ruby, inspired by the S3 gems and self experience of dealing with queues. The major goal of the whole gem is to enable ruby developers [like me =)] to leverage Windows Azure Storage features and have another option for cloud storage.
http://waz-storage.heroku.com
MIT License
40 stars 21 forks source link

Create Container shows 403 Forbidden #37

Closed cometbalan closed 11 years ago

cometbalan commented 11 years ago

I am trying to create a container in order to upload images into the contianer using below code

conn = WAZ::Storage::Base.establish_connection!( { :account_name => account_name, :access_key => access_key} )

container = WAZ::Blobs::Container.create('container-123')

But it shows 403 forbidden, at the line where i try to create a container. Do i have to enable any settings in Portal panel? Any working sample code would be helpful.

Thanks.

johnnyhalife commented 11 years ago

Are your account name and keys correctly set?

I've tried the following:

require 'waz-storage'
require 'waz-blobs'

WAZ::Storage::Base.establish_connection!(
:account_name => ENV['AZURE_STORAGE_ACCOUNT'], 
:access_key => ENV['AZURE_STORAGE_ACCESS_KEY'])

container = WAZ::Blobs::Container.create('leaguenation123')

And it worked, with the latest version (1.3.6), that 403 is probably related to your account keys not being properly set

cometbalan commented 11 years ago

I have checked the account name and token, the details are correct. I am trying this from an Action under a controller in local machine, do i have to run this from actual server?

cometbalan commented 11 years ago

Oh yes.. that is the problem.. it works well in my actual server.. Thanks for helping.

cometbalan commented 11 years ago

Closing the issue.