You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed all the steps described in edgeguides to setup ActiveStorage in combination with an Azure Storage Account
Expected behavior
Attaching and uploading of a blob works fine. I can see the uploaded files in my Azure Storage container.
Then I use the url_for to display images stored on Azure.
Actual behavior
I got error 500 on requested images, and got this error when I try to open generated uri :
Azure::Storage::InvalidOptionsError in ActiveStorage::BlobsController#show
invalid options {:content_disposition=>"inline; filename="image.png"; filename*=UTF-8''image.png", :content_type=>"image/png"} provided for SAS token generate
After much pain in setting up an Azure account I've managed to reproduce this - investigating now.
@fearcraftor that advice from the Azure team isn't much use - Active Storage is trying to create a signed url so is creating a SAS token for that. If you have to create a SAS token every time a user wanted to download a file it'd be a bit awkward 😄
@fearcraftor what did you set for the path option in your Azure config? If you set the primary endpoint of your storage account then it should work as the client uses the URI to determine which service to generate the SAS for, e.g:
@georgeclaghorn the config for Azure doesn't seem very clear - we can drop the path option and pass the service via an option to signed_uri and let the client build the correct host.
The Active Storage service for Azure Storage has an option called `path`
that is ambiguous in meaning. It needs to be set to the primary blob
storage endpoint but that can be determined from the blobs client anyway.
To simplify the configuration this commit removes the `path` option and
gets the endpoint from the blobs client instead.
Closes#32225.
Hello
Steps to reproduce
I followed all the steps described in edgeguides to setup ActiveStorage in combination with an Azure Storage Account
Expected behavior
Attaching and uploading of a blob works fine. I can see the uploaded files in my Azure Storage container.
Then I use the url_for to display images stored on Azure.
Actual behavior
I got error 500 on requested images, and got this error when I try to open generated uri :
Azure::Storage::InvalidOptionsError in ActiveStorage::BlobsController#show
invalid options {:content_disposition=>"inline; filename="image.png"; filename*=UTF-8''image.png", :content_type=>"image/png"} provided for SAS token generate
azure-storage (0.15.0.preview) lib/azure/storage/core/auth/shared_access_signature_generator.rb:174:in 'generate_service_sas_token'
azure-storage (0.15.0.preview) lib/azure/storage/core/auth/shared_access_signature_generator.rb:340:in 'signed_uri'
activestorage (5.2.0.rc1) lib/active_storage/service/azure_storage_service.rb:81:in 'block in url'
activesupport (5.2.0.rc1) lib/active_support/notifications.rb:168:in 'block in instrument'
activesupport (5.2.0.rc1) lib/active_support/notifications/instrumenter.rb:23:in 'instrument'
activesupport (5.2.0.rc1) lib/active_support/notifications.rb:168:in 'instrument'
activestorage (5.2.0.rc1) lib/active_storage/service.rb:113:in 'instrument'
activestorage (5.2.0.rc1) lib/active_storage/service/azure_storage_service.rb:79:in 'url'
activestorage (5.2.0.rc1models) active_storage/blob.rb:113:in 'service_url'
activestorage (5.2.0.rc1controllers) active_storage/blobs_controller.rb:12:in 'show'
I asked Azure team, they tell me to setup a SAS token. As far I know there's no documentation from Rails about such a setup.
Are you aware of that problem ? Is there any further configuration I missed ?
Thank you in advance
System configuration
Rails version: 5.2.0.rc1
Ruby version: 2.5.0
using gem 'azure-storage', 0.15.0.preview
The text was updated successfully, but these errors were encountered: