Unable to get access_token due to aiohttp not honoring env proxy vars #19282
Labels
Azure.Core
Client
This issue points to a problem in the data-plane of the library.
feature-request
This issue requires a new behavior in the product in order be resolved.
Milestone
The
aio
version ofClientSecretCredential
when used to obtain an access_token fails with the following error:Cannot connect to host <REQUESTED URL>:443 ssl:default [The parameter is incorrect]
because the environment variableno_proxy
is not honored by aiohttp (which is internally used by the async identity python sdk)Here is the aiohttp issue: aio-libs/aiohttp#4431
To Reproduce (run this in an asyncio event loop)
from azure.identity.aio import ClientSecretCredential
credential = await ClientSecretCredential(self.tenant_id,self.client_id,self.client_secret)
token_obj = credential.get_token("https://management.core.windows.net/.default")
credential.close()
Expected behavior
Get back a token
Impacts
Since Identity cannot be used in an async fashion, this has cascading effects on other SDK's like BlobServiceClient that would need a storage credential and further will lead to customer being able to use only the sync version of these SDK's and it would lead to throughput issues downstream.
aiohttp will release a fix in their 3.8 release (current is 3.7.x) and once that is released, this needs to be re-tested. Keeping this here for tracking
Most secure enterprise setups will have
no_proxy
environment variable set and this should be fixed to fully avail the async aspects of the SDK.The text was updated successfully, but these errors were encountered: