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

Support for Azure blob storage? #217

Closed
shawnthetechie opened this issue Nov 13, 2017 · 3 comments
Closed

Support for Azure blob storage? #217

shawnthetechie opened this issue Nov 13, 2017 · 3 comments

Comments

@shawnthetechie
Copy link

@shawnthetechie shawnthetechie commented Nov 13, 2017

I looked at the docs but I can't seem to find any resources for azure blob storage. Am i missing something?

@janko

This comment has been minimized.

Copy link
Member

@janko janko commented Nov 13, 2017

@shawnthetechie As far as I can tell, no one has written an Azure Blob Storage storage implementation yet.

If you would like to take a stab at it, "Creating a New Storage" as an attempt of a comprehensive guide for anyone who wants to write a new storage. ActiveStorage's AzureStorageService is the newest Azure Blob Storage implementation, so it's definitely worth taking a look at for inspiration.

@janko

This comment has been minimized.

Copy link
Member

@janko janko commented Jun 18, 2018

I will close this ticket, as I don't have the time to write an Azure storage, and this is a feature request for a separate gem, not a feature in Shrine.

@janko janko closed this Jun 18, 2018
@janko

This comment has been minimized.

Copy link
Member

@janko janko commented Jun 26, 2018

It should be possible to use fog-azure-rm with shrine-fog:

gem "shrine-fog"
gem "fog-azure-rm"
require "shrine/storage/fog"
require "fog/azurerm"

Shrine.storages[:store] = Shrine::Storage::Fog.new(
  provider: "AzureRM",
  # credentials
)

Alternatively, I found out that Minio has a feature where it can act as a proxy to Azure Blob Storage while retaining the S3 API. This means that you should be already be able to use Azure Blob API with Shrine, by starting a Minio server as an Azure gateway and configuring Shrine::Storage::S3 to point to the Minio server.

$ docker run -p 9000:9000 --name azure-s3 -e "MINIO_ACCESS_KEY=azureaccountname" -e "MINIO_SECRET_KEY=azureaccountkey" minio/minio gateway azure
Shrine::Storage::S3.new(
  endpoint: "http://127.0.0.1:9000",
  access_key_id: "azureaccountname",
  secret_access_key: "azureaccountkey",
  bucket: "bucket-name", # name of the bucket you created through Minio's web interface
  region: "us-east-1",
  force_path_style: true,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.