Add ConnectionString parsing
See original GitHub issueIn plenty of cases we receive connection strings for azure resources. We should port ConnectionString parser from iot sdk, so that it’s easier and more consistent to work with APIs https://github.com/Azure/azure-iot-sdk-python/blob/master/azure-iot-device/azure/iot/device/common/auth/connection_string.py
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Is there any connection string parser in C#? - Stack Overflow
Yes, there's the System.Data.Common.DbConnectionStringBuilder class. The DbConnectionStringBuilder class provides the base class from which ...
Read more >connection-string-parser - npm
Start using connection-string-parser in your project by running `npm i connection-string-parser` ... Install. npm i connection-string-parser ...
Read more >DbConnectionStringBuilder.ConnectionString Property
The ConnectionString property of the DbConnectionStringBuilder class acts generally as a mechanism for creating and parsing semicolon-delimited lists of key/ ...
Read more >tediousjs/connection-string: A connection string parsing library
The library comes with a generic connection string parser that will parse through valid connections strings and produce a key-value map of the...
Read more >Quick Tip C#: How to parse any connection string?
DbConnectionStringBuilder is an inbuilt class from the Microsoft which allow us to parse connection string into KeyValue pair object. Please ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @nfx,
The feature has been added and will be available in the next release. We did consider your proposed option of some sort of
ConnectionStringclass, but ultimately decided that a parsing function is the best solution, as it provides validation that is generic enough for parsing connection strings across services and is simplest to use.If you are looking for a
ConnectionStringclass, specifically, Event Hubs already has theEventHubConnectionStringPropertiesclass, which I believe is similar to what you are looking for. Storage does not seem to have a similar class, but we can create an issue for this if you still find this necessary.Thank you for your feedback!
Hi @nfx, in the core
parse_connection_stringmethod, we provide docstring and define the types of the input and type of the keys and values in the output dict. Documentation here.In the Java example, it looks like there are four instance variables/properties on a
ConnectionString, with only one key and one value, rather than parsed key/value pairs. I may be misunderstanding the kind of documentation you are looking for. Would you be able to clarify the purpose of theConnectionStringinterface? (If you could provide a sample connection string that would be passed to the implementation of theConnectionStringand the return value ofname(),value(),type(), andsticky(), that would be very helpful.)Thanks!