-
Notifications
You must be signed in to change notification settings - Fork 2.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
[core] connection string parser only #17640
[core] connection string parser only #17640
Conversation
sdk/core/azure-core/azure/core/utils/_connection_string_parser.py
Outdated
Show resolved
Hide resolved
sdk/core/azure-core/azure/core/utils/_connection_string_parser.py
Outdated
Show resolved
Hide resolved
|
||
def parse_connection_string(conn_str, case_sensitive_keys=False): | ||
# type: (str, bool) -> Mapping[str, str] | ||
"""Parses the connection string into a dict of its component parts, with the option of preserving case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason the documentation for this doesn't seem to be rendering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 looking into it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the _connection_string_parser.py
file to azure/core
and imported parse_connection_string
in azure/core/__init__.py
. The change showed up in the docs, so I don't think _connection_string_parser.py
has errors that would cause rendering failure.
I also copied the azure/core/tracing
folder to a azure/core/tracing_copy
folder and assumed that if tracing
is working, then tracing_copy
should also render. This didn't work either, so I believe this might not be a problem with the code/the __init__.py
file either. Thoughts, @annatisch ?
Adding xms-ids to ContainerService (Azure#17640) * Adding xms-ids to ContainerService * prettier fix
This is an attempt to create a generic connection string parsing function that will be used across SDKs to minimize redundant logic and validation, addressing #16782.
Split from PR: #17049
This parsed connection string will be returned as a dict of connection string keys (ie.
Endpoint
,SharedAccessKey
, etc.) and values, with an option for allowing case insensitive keys. This option is useful when checking a connection string with keys that don't match expected case, without looping through all the keys. For example:gist: https://gist.github.com/swathipil/0640998161b2b9fb41dee053e16a770c