[Identity] Support concurrently running commands with MSAL
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
## Description
The current management of file `.azure/accessTokens.json` is not thread-safe, which leads to issue #1347, #8766, #9427.
[microsoft-authentication-extensions-for-python](https://github.com/AzureAD/microsoft-authentication-extensions-for-python) already uses [portalocker](https://pypi.org/project/portalocker/) to handle concurrent accesses:
https://github.com/AzureAD/microsoft-authentication-extensions-for-python/blob/35641c37de1f0bbb214627769e5847e74808ad55/setup.py#L28-L29
```py
"portalocker~=1.6;platform_system=='Windows'",
"portalocker~=1.0;platform_system!='Windows'",
```
With the current [integration with MSAL](https://github.com/Azure/azure-cli/pulls?q=label%3A%22Azure+Identity+Adoption%22), we should make sure concurrent accesses are handled correctly.
Contributor guide
Assessment
This issue has not been assessed yet.