Hello @Derek de Rie ,
Thanks for reaching out.
Based on my search on above error message, this issue might have caused by the shared token cache so would recommend you to use “exclude_shared_token_cache_credential=True” to exclude the shared token cache.
Based on my investigation of the above error message, I believe the issue might have caused by the shared token cache, thus I recommend that you use "exclude shared token cache credential=True" to exclude the shared token cache, because DefaultAzureCredential is based on Azure Identity client library. You could skip the shared cache.
Example:
DefaultAzureCredential(connection_verify=False, exclude_shared_token_cache_credential=True)
secret_client = SecretClient(vault_url="https://testvaul1234.vault.azure.net/", credential=credential, connection_verify=False)
secret = secret_client.get_secret("mysecret")
Here are similar issues for your reference. If non of these help you fix the issue, I'd recommend opening an issue with the azure-sdk-for-python team so their experts can take a closer look into your issue.
https://learn.microsoft.com/en-us/answers/questions/604691/access-key-vault-using-user-managed-identities.html
https://stackoverflow.com/questions/67165101/azure-chainedtokencredential-fails-after-password-change
If you don't have support plan, please send an email to AzCommunity[at]Microsoft[dot]com referencing this thread and your subscription id so that we will help you get a one-time free technical support. Hope this helps.
Feel free to tag me If you have any other questions. Thank you for your time and patience throughout this issue.
-----
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.