-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[QUERY] CloudStorageAccount equivalent in Storage v12 #12892
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage. |
V12 doesn't have the equivalent of a Here's our authentication samples for blob - https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs |
@seanmcc-msft, thank you. The issue is not how to authenticate but how to get the parts from the authentication information. For example, |
|
The transition from v11 to v12 is a very poor experience 🙁 Thank you for your help, @seanmcc-msft. |
Thanks for the feedback @SeanFeldman. We are working on the migration guide. |
I was looking for the parse method found on CloudStorageAccount use case: I now need three app setting properties? connection string, account name, and key? Yes, I could create my own connection string build or parser but it would be nice to have this util in the sdk. Maybe I am missing something in in the api? |
Could someone answer this? @SeanFeldman you maybe? |
Sorry mate, I have given up on this one. @azure-sdk has decided to enforce the model where the user code has to decide what authentication mode is used and call the appropriate API, unlike the approach taken with |
I resigned to using a simple regular expression to obtain account key and name from the connection string, example: try
{
var matches = Regex.Matches(connectionString, @"([^=]+)=([^\;]+);?");
var parts = matches.ToDictionary(value => value.Groups[1].ToString(), value => value.Groups[2].ToString());
var key = parts["AccountKey"];
var name = parts["AccountName"];
}
catch (KeyNotFoundException)
{
throw new ArgumentException("Invalid connection string");
} |
I just brought it back and now everything is 💯 : https://www.nuget.org/packages/Devlooped.CloudStorageAccount |
Query/Question
With Storage v11 there was a
CloudStorageAccount
type that could be constructed by parsing a connection string, SAS Uri, or taking an instance ofStorageCredentials
. In addition to that,CloudStorageAccount
would be able to return aStorageCredentials
object, allowing a common way of generating storage credentials from one of the provided options above.With v12 this doesn't seem to be possible anymore. What the equivalent and where can I find some examples?
Environment:
dotnet --info
output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]The text was updated successfully, but these errors were encountered: