No commit activity in last 3 years
No release in over 3 years
paperclip-azure-storage is a paperclip adapter for azure storage that use service principal authentication
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.10
~> 1.4
~> 3.14

Runtime

>= 1.0.0, < 3.0.0
>= 5.1.0, < 7.0.0
 Project Readme

Paperclip Azure Storage

Description

paperclip-azure-storage is a paperclip adapter for azure storage.

The difference between this and other azure adapter, such as paperclip-azure, was the ability to use service principal as the authentication method.

Getting Started

  1. Add paperclip-azure-storage on Gemfile
gem 'paperclip-azure-storage'
  1. Configure paperclip
require 'paperclip-azure-storage'

Paperclip::DataUriAdapter.register

Paperclip::Attachment.default_options[:storage] = :azure_storage
Paperclip::Attachment.default_options[:tenant_id] = 'c881ddef-bf33-4574-a43b-1876a94c940a'
Paperclip::Attachment.default_options[:client_id] = 'e35cf4da-b3cd-4722-9923-deed0bf41a37'
Paperclip::Attachment.default_options[:client_secret] = 'J@NcRfUjXn2r5u7x!A%D*G-KaPdSgVkY'
Paperclip::Attachment.default_options[:resource] = 'https://mystorage.blob.core.windows.net'
Paperclip::Attachment.default_options[:storage_name] = 'mystorage'
Paperclip::Attachment.default_options[:container] = 'mycontainer'
  1. Upload & access your image
image_content = '<some-image>'
model = model_class.create!(image: image_content) # upload image to azure
model.image.azure_url # get azure image url