-
Notifications
You must be signed in to change notification settings - Fork 64
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 by default for Azure paths #497
Comments
@daviewales Thanks for filing this issue. Agreed it would be great to support Right now the fall-through logic for getting a credential if/when we need one is complex: I think the major work here is to spec out the various credentialing scenarios and what we should do in each so that we can implement and test the logic effectively and comprehensively. Is that potentially a contribution you could help with? |
I'll see if I get a chance to have a closer look. My initial feeling is that we just need to check if
and if so set:
Other things to consider:
|
Great, thanks. I believe that credentials can be in the connection string, and I'm not sure how that would interact with also calling and passing DefaultAzureCredential. |
Some libraries, such as
polars
andpandas
, have an almost seamless method for interacting with cloud storage paths.e.g.:
This is nice, because I don't need to import any other libraries, setup credentials or blob clients, etc.
It automatically finds any available credentials in my local environment, presumably with something like
DefaultAzureCredential
.This means that when testing locally, I just need to be authenticated with Azure CLI, and everything just works.
I don't even need to manually specify environment variables.
It also means that I can deploy the same code to the server, and it will automatically find the appropriate environment variables to authenticate as a service principal with
AZURE_CLIENT_ID
,AZURE_CLIENT_SECRET
, etc.I may have missed something, but it seems that
cloudpathlib
has not enabled this kind of automatic credential detection withDefaultAzureCredential
. Instead, I need to do the following to get an authenticated workingCloudPath
:Ideally, it would be nice to be able to do the setup automatically.
I'm imagining the following future state:
(There may be a nicer way to specify the account name. I'm just copying the API from
polars
andpandas
here. I kind of wish that it was standard to include the account name in the path somehow, as passing the account name in separately feels clunky to me. It would be nice if we could useaz://mystorageaccount/container/...
)See the documentation for
DefaultAzureCredential
. (There's a reason it's called Default!):Note: If you are using
fsspec
+adlfs
,adlfs
requires the storage optionanon=False
to be set to enableDefaultAzureCredential
.For example, when using
pandas
, you must specifystorage_options={'anon': False}
.When using
fsspec
directly, you need to pass it as follows:For more details, see:
https://github.com/fsspec/adlfs#setting-credentials
The text was updated successfully, but these errors were encountered: