microsoft / debugpy

An implementation of the Debug Adapter Protocol for Python
https://pypi.org/project/debugpy/
Other
1.84k stars 137 forks source link

Regression : Timeout with azure identity #1710

Open lipoteFR opened 1 week ago

lipoteFR commented 1 week ago

My visualstudiocode was working like a charme Once i get : Image and upgrade debugpy

then my python was still running in a "Run" mode but in debug i get a time-out

DEBUG:azure.identity._internal.decorators:AzureCliCredential.get_token failed: Failed to invoke the Azure CLI
  File "c:\Program Files\Python312\Lib\subprocess.py", line 1628, in _communicate
    raise TimeoutExpired(self.args, orig_timeout)
subprocess.TimeoutExpired: Command '['cmd', '/c', 'az account get-access-token --output json --resource https://database.windows.net]' timed out after 10 seconds

may be my professional laptop get restrictions and i should ask to have flow opened :(

My code is :

from azure.identity import AzureCliCredential, ChainedTokenCredential

az_cli = AzureCliCredential()
az_cred = ChainedTokenCredential( az_cli)
az_token = az_cred.get_token("https://database.windows.net/.default")
print(az_token)

The GetToken fails in timeout i revert to 2024.10.0 and it is working again Image

What could explain why it was working before and still working without debug mode ?

karthiknadig commented 1 week ago

debugpy published a new version with support for python 3.13. The fixes for it might have had a side effect for this. Moving this to debugpy repo.

debonte commented 1 week ago

@lipoteFR, thanks for the issue. I'm unable to reproduce this. Your code runs to completion for me, both on the command line and in the debugger. I tried both Python 3.12.7 and 3.13.0. I'm using the latest azure-identity (version 1.19.0).

Not sure it's relevant, but what version of Python are you using?  

then my python was still running in a "Run" mode but in debug i get a time-out

Are you using the same environment (same python version, same packages) in both of these cases?