'create key vault client using proxy
Need to create azure keyvault client using proxy setting. Organigation current network policy allowing the calls only via organization proxy using port 80.
current code
credentials = DefaultAzureCredential()
client = SecretClient(vault_url='https://XXX.vault.azure.net', credential=credentials)
print(f'Keyvalut connected')
password = client.get_secret('keytosomesecreat')
print('password')
When we do the call we are getting "Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
Need to do this call via org proxy so we tried to add proxy to the editor(pycharm) and there is no option to add proxy while creating key vault client too.
Is there any way that we can do the call via proxy?
Solution 1:[1]
Please check the references if they can be worked around in python.
According to this and Access Key Vault behind a firewall ip-address-ranges | Microsoft Docs
Please check and try if you add the IPs to your Firewall as it may not be possible to provide a specific range of IP addresses that Key Vault service endpoints will have at any particular time. And to look into data centre address ranges
Or
- try to use HttpClient to check and work with Azure Key Vault REST API in python or specify proxy in environment variables like HTTPS_PROXY, see HttpClient.DefaultProxy Property
Some references :
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | kavyasaraboju-MT |