Tracking issue for `DefaultAzureCredential` (azure-identity) support in `azure-batch` (v2)
Re-opening #30468 because this should be addressed as far as I can tell (just closing a clearly relevant issue and even locking the communication doesn't help with actually solving problems).
Is your feature request related to a problem? Please describe.
In the past the Azure library ecosystem was fragmented in terms of credential handling. An infamous error when trying to work with the alleged standard DefaultAzureCredential is:
AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session'
According to this StackOverflow question, the goal is to clean up the credentials handling:
As of May 2022, all SDKs have been re-released with native support for azure-identity. If you still encounter this error with a given SDK on its latest version, please open an issue asking for a re-release of that SDK here: https://github.com/Azure/azure-sdk-for-python/issues
azure-batch as of its latest version 13.0.0 (released on Nov 9th 2022) still does not support DefaultAzureCredential.
This issue has been raised a few times before:
- https://github.com/Azure/azure-sdk-for-python/issues/23583
- https://github.com/Azure/azure-sdk-for-python/issues/28739
The issues vaguely mention that this feature will come eventually (https://github.com/Azure/azure-sdk-for-python/issues/23583#issuecomment-1079098388 suggesting by the end of 2022, which apparently hasn't happened), but the tickets have been closed, without actually being resolved.
It would be great we can have a proper "tracking issue" that actually gets closed, once the feature really is there. This way, users can really react to the change. Closing the issues without really having resolved the issue only leads to confusion (implying that it might work already), and misses an opportunity to use the issue ticket as an "announcement" to its watchers via the closing action.
Describe the solution you'd like
Re-release azure-batch with DefaultAzureCredential support and keep this issue open until that point.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @cRui861 @dpwatrous @jingjlii @JJJessieWang @wanghoppe @wiboris.
Hi @bluenote10, I'm an AI Support assistant here to help with your issue. While the Azure SDK team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
- The error (“AttributeError: 'DefaultAzureCredential' object has no attribute 'signed_session'”) is known and tracked; previous issues (#23583, #28739) indicate that our team is aware that Batch’s credential handling needs alignment with the behavior of DefaultAzureCredential.
- This issue is now serving as the tracking issue to re-release azure-batch with improved support for azure-identity, including DefaultAzureCredential.
- For further context on credential handling and related error messages, please see the azure-mgmt-batch README and the troubleshooting documentation in azure-identity’s README.
- We’ll keep this issue open until the updated release is available to provide a clear signal when the change is officially supported.
The Azure SDK team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Hi Microsoft team - can you please clarify the state of this?
There is an additional issue here which makes this a larger problem as far as I can see, in the fact that the deprecated and unsupported ADAL library is still used by this batch package.
- especially given that, it would be good to have a clear plan for this issues resolution.
It looks like the code changes for this may have been done already?, and all that's needed presumably therefore is for the code to be released? See https://github.com/Azure/azure-sdk-for-python/pull/32383 which was merged to main in Sep 2024.
However, there hasn't been a release to conda / pypi cinse the 14.2 in Feb 2024.
@wanghoppe @kristapratico @kashifkhan @wiboris Thanks.
Also being affected by this and I suspect I'm as confused as others re: the status of a fix. When can we expect to be able to use DefaultAzureCredential to authenticate BatchServiceClient?
Yes. azure-batch (v15.x and above) fully supports DefaultAzureCredential from azure-identity.