-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use DefaultAzureCredential
for azure storage and discourage connectionString
#195
Conversation
{ | ||
baseUri = pathUri; | ||
} | ||
var blobServiceClient = string.IsNullOrWhiteSpace(connectionString) |
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.
This is the beating heart of this change.
A few comments:
- To use
DefaultAzureCredential
, we must pass in a URI to the storage account. There is no constructor with a connection string. - Using shared keys is highly discouraged by all the docs. I can provide links if needed.
- Managed Identities "just work"
- By default,
DefaultAzureCredential
does not do interactive authentication. - Much of the
AzureCredential
configuration can be accomplished with environmental variables. I didn't come up with a strategy to use a differentAzureCredential
per source. This could be done with some more changes to the config files but I suspect YAGNI :-)
{ | ||
throw new ArgumentException("Missing connectionString for azure account."); | ||
await log.LogAsync(LogLevel.Warning, "connectionString is deprecated for azure account. Use path instead."); |
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 needed to change many files to get a hold of this logger. I can make this a separate PR if needed.
TODO, need to run tests and do manual testing. |
DefaultAzureCredential
for azure storage and deprecate connectionStringDefaultAzureCredential
for azure storage and discourage connectionString
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.
Looks great 💯
I'll run the functional tests on the CI and verify that the tests with a connection string are still working. |
Full functional tests passed ✅ |
Use
DefaultAzureCredential
for azure storage and discourage connectionStringDefaultAzureCredential
, we must pass in a URI to the storage account. There is no constructor with a connection string.DefaultAzureCredential
does not do interactive authentication.AzureCredential
configuration can be accomplished with environmental variables. I didn't come up with a strategy to use a differentAzureCredential
per source. This could be done with some more changes to the config files but I suspect YAGNI :-)