jakobht / azurex Goto Github PK
View Code? Open in Web Editor NEWImplementation of the Azure Blob Storage Rest API for elixir
License: MIT License
Implementation of the Azure Blob Storage Rest API for elixir
License: MIT License
Hey, thanks for your library ๐
I'm a beginner with the Azure ecosystem, I'm more used to Amazon Web Services.
It looks like Azurex.Authorization.SharedKey
is somewhat similar to AWS pre-signed URLS: can I use it to authorize a user to upload just one blob in a container?
Do you have any code samples regarding this feature?
We currently use timex to format dates as the support in elixir 1.9 wasn't good enough.
We now only support to elixir 1.11 as that is the oldest maintained version, so we should remove the timex dependency.
Issue copied from PotionalDev
First of all thanks a lot for this library!
I'm trying to
put
a blob which is around 10mb big. I configured at then I run the code:# Make a blob of 16mb blob = for x <- 1..(1024*1024), into: <<>> do <<Enum.random(0..255)>> end blob = Enum.reduce(1..14, blob, fn (_, x) -> x <> x end) # Create it Azurex.Blob.put_blob("blob", blob, "application/octet-stream")This returns:
{:error, %HTTPoison.Error{id: nil, reason: :timeout}}Interestingly:
The blob is created, and when I download it, it is the blob I uploaded.
This only happens for "bigger" binaries if the binary is e.g. 1kb the return is as expected.
I understand that the error is just propagated from HTTPoison, but I thought you might have some insights?
Currently, there is only shared key support. We also need support for SAS tokens and Managed Identities. What do you think that should look like?
use Azurex, <options>
approach?Thank You
I need to work with multiple Azure blob storage providers, some provided by the user at runtime. Looking at this package, it seems we default out to an environment configuration. That won't work for what I need - I need to either set the config, reset it, or pass it in as an option.
What would you prefer we do to handle this? I'd rather make a PR and build this functionality for you than fork it and do it in a vacuum.
Hi
I have it working before like few weeks before and now I had this AuthenticationFailed
for all requests.
to re-produce:
mix new my_app
and in mix.exs
defp deps do
[
{:azurex, "~> 0.1.2"}
]
end
and in config/config.exs
config :azurex, Azurex.Blob.Config,
storage_account_name: System.get_env("AZURE_STORAGE_ACCOUNT"),
storage_account_key: System.get_env("AZURE_STORAGE_ACCESS_KEY")
and run the code
Azurex.Blob.list_containers
and I got
{:error,
%HTTPoison.Response{
body: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:e5a8dd0f-e01e-000c-17f1-3fd423000000\nTime:2021-05-03T07:57:39.5168256Z</Message><AuthenticationErrorDetail>The Date header in the request is incorrect.</AuthenticationErrorDetail></Error>",
headers: [
{"Content-Length", "419"},
{"Content-Type", "application/xml"},
{"Server", "Microsoft-HTTPAPI/2.0"},
{"x-ms-request-id", "e5a8dd0f-e01e-000c-17f1-3fd423000000"},
{"x-ms-error-code", "AuthenticationFailed"},
{"Date", "Mon, 03 May 2021 07:57:38 GMT"}
],
request: %HTTPoison.Request{
body: "",
headers: [
{"authorization",
"SharedKey xxxxxstorage:4nHSO+J19veoXUZRAXIpRbKbVQV2rS2+0wlhACky35Y="},
{"x-ms-version", "2019-12-12"},
{"x-ms-date", "Mon, 03 May 2021 07:57:38 Etc/UTC"}
],
method: :get,
options: [],
params: %{},
url: "https://xxxxxstorage.blob.core.windows.net/?comp=list"
},
request_url: "https://xxxxxstorage.blob.core.windows.net/?comp=list",
status_code: 403
}}
I suspected it's related to Timex
as it did work for me before.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.