Skip to content
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

Import msal_extensions only when needed #20095

Merged
merged 4 commits into from
Aug 5, 2021
Merged

Conversation

chlowell
Copy link
Member

@chlowell chlowell commented Aug 4, 2021

On Windows, msal_extensions depends on pywin32, which isn't importable in some environments (see #19989 for an example). Importing anything from azure.identity will import msal_extensions and thus pywin32 so when the latter isn't importable neither is anything in azure.identity. This PR moves import msal_extensions into the functions which require it, allowing applications to avoid importing pywin32. Persistent caching still won't work without pywin32, and neither will DefaultAzureCredential if it tries to load the shared cache, but this makes it possible for affected applications to carry on with a reduced feature set.

@chlowell chlowell requested review from mccoyp and schaabs as code owners August 4, 2021 22:01
@ghost ghost added the Azure.Identity label Aug 4, 2021
@chlowell chlowell merged commit a3ad60a into Azure:main Aug 5, 2021
@chlowell chlowell deleted the lazy-import branch August 5, 2021 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants