-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Creation of Azure storage from connection string failed for shared key credentials #66
Comments
I ran into this just now. Thanks for the tip to store the account key as URL encoded, that worked! |
Which API needs to change? Can you describe the change required? |
Hi @robinrodricks, absolutely. Let's take a look at the following screenshot for context: Notice line 131, where every part of the connection string is always URL-decoded. This becomes problematic when using a key like the following (which is a base64-encoded Azure Storage Account key):
During URL-decoding, the As @AloisMaierhofer pointed out, we can work around this by URL-encoding the key, which will then be decoded correctly by the However, I’m unsure whether the |
It would appear that this issue is essentially a duplicate of #42. |
@sfmskywalker What if the |
@robinrodricks I think that's the ideal solution: it's user friendly and it's simple 👍🏻 |
the creation of a Azure file or blob storage instance failes if doing so via StorageFactory.Blobs.FromConnectionString
Reason:
The factory uses FluentStorage.ConnectionString.StorageConnectionString internally to parse the connection string. For each property value the method UrlDecode is called by the Parse method. This makes a lot of sense to be able to pass special characters in passwords.
The Azure account key is Base64 encoded, though. If it contains + characters, those get replaced by spaces, other characters might also get replaced falsely. Therefore the Azure account key must not be tampered with.
One workaround would be to store the account key urlencoded in the connection string in the application configuration - not very user friendly, its base64 already...
The StorageConnectionString on the other hand side has no knowledge if the secret key is urlencoded or base64 encoded... not sure how to solve this.
Maybe it would make sense to mention the url-encoding for passwords in the documentation.
The text was updated successfully, but these errors were encountered: