-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[FEATURE REQ] Make ConnectionString class public #11590
Comments
I'm not sure I understand the use case for storage. For SAS Url there is a ctor that doesn't take a credential https://docs.microsoft.com/en-us/dotnet/api/azure.storage.blobs.blobclient.-ctor?view=azure-dotnet#Azure_Storage_Blobs_BlobClient__ctor_System_Uri_Azure_Storage_Blobs_BlobClientOptions_ but I think I'm missing something because SAS is not a connection string. In general our goal was to free customers from having to parse connection strings and expose ways to consume entire connection and parse it internally. Can you please provide more details on when you have a connection string but have to manually parse it to create a valid client? |
BlobClient itself is not as issue. The problem I faced is when I want to create an SAS-token myself, StorageSharedKeyCredential requires AccountName and AccountKey separately.
|
We have the same issue. We want to return an URL, that allows a web browser to download the file directly from Azure Blob Storage. However we only store the ConnectionString in our configuration. My current workaround looks like this
|
@tg-msft, tell me if I'm wrong but aren't you addressing the later issue with the new SasBuilder design and allowing to create it from the client? |
The SAS changes won't help with this problem - you'll still need to pull a credential for signing from somewhere. I wouldn't expose the entirety of the existing This shouldn't be assigned to Azure.Core so I'm changing everything to Storage. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage. |
Having Here's an example of how having this functionality public would save unnecessary issues and save me time: |
We frequently use these things as well and would be happy to have it public |
We appreciated the connection string validation we got with We were trying to use the |
I also used CloudStorageAccount.Parse(_connectionString) method for connection string validation and extracting parts and had to copy-paste entire internal StorageConnectionString class for this. |
It looks like I also need the StorageConnectionString class to extract the 'StorageAccountName' and 'StorageAccountKey' from the connection string to create a SAS when I follow the documentation. Off-topic but related because this is about generating a SAS and is the reason why I need the ConnectionString class to be public:
But if you create the BlobClient with the correct constructor overload (with the connection string) there is no need to parse the connection string with the 'StorageConnectionString' class to create a SAS:
It would be better if the 'GetBlobClient()' method on the container would be able to return a BlobClient were the property of 'CanGenerateSasUri' is true after it's initialized with a connection string. With this solution, you're forced to pass the connection string throughout the application. I prefer to get it from the config/KeyVault in the startup class and only use the BlobContainerClient. |
Hi @StannieV . I already created an issue for the off topic If you have anything to add to the relevant to this thread, feel free to, otherwise please add your concerns to the bug you are referring to the issue I linked, so we can stay organized with the issue at hand. |
Just tested it, problem solved in version 12.8.0! |
This (or some sort of parser/builder) would be very helpful as connection string is the most common format for storing connection details in configuration. Having some methods accept connection string while others accept account name + account key forces us to either store redundant info in configuration or roll our own connection string logic. |
@kasobol-msft |
I very much could utilize this. I just need it for simplicity:
|
@DaleyKD could you please elaborate more (best provide code snippet of how do you solve it now vs desired) so that we can understand your scenario better? If you have some connection string in hand it's going to have either key or sas token. Why would you need to parse it to double check that instead of directly feeding connection string into QueueClient ctor? |
@kasobol-msft Great question. I don't have a solution right now outside of using reflection. The main reason for this is local development vs. AKS deployment.
Well, now that I'm typing it out, maybe it's not such a big deal. We'd probably end up passing in (as part of our Helm values) Ignore me. |
@DaleyKD you can use QueueUriBuilder to append the queue name to base URI. |
@kasobol-msft it's been over a year since the issue was raised and backlogged. It's still needed. What are the plans to address it? Going through reflection is a workaround, and it would be great to see a more permanent solution. |
@SeanFeldman So far, for each ask there was an alternative without exposing SDK internals. Please describe your scenarios. |
@kasobol-msft, in my case I need to generate an account SAS token for a whole container and not specific files. This didn't work in the past but could be resolved. I'll give it a whirl. |
I've taken a look at the original code and think I have sorted it out. @kasobol-msft, I've also looked again at the migration guide and couldn't see anything. This issue would be much simpler if customers could find the necessary information in the upgrade guide. |
Thanks @SeanFeldman for pointing out the migration guide gap, we'll take care of that. |
Hi @vladkol. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
Hi @vladkol, since you haven’t asked that we “ |
This issue is currently blocking our team from upgrading from the v11 to v12 SDK in the Cloud Services extension for Visual Studio. We depend on the DevelopmentStorageAccount property to connect to Azurite (or the Storage Emulator for users that haven't migrated yet) for local debugging as well as providing UI for creating and editing storage connection strings. With ConnectionString being internal in v12, we would be missing this essential functionality to support our existing features once we upgrade. |
/unresolve |
Hi danegsta, only the original author of the issue can ask that it be unresolved. Please open a new issue with your scenario and details if you would like to discuss this topic with the team. |
Azure.Core
Make ConnectionString class public so developers can leverage it broadly, as "Key=Value;" format is widely adopted in Azure.
For example, Storage SDK used to have CloudStorageAccount.Parse. It doesn't exist in v12, and it's Storage-specific.
Now, in order to use Azure.Storage.StorageSharedKeyCredential with a connection string (together with BlobSasBuilder, for example) , they have to extract AccountKey value from the connection string themselves.
The text was updated successfully, but these errors were encountered: