0

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?

user3625533
  • 339
  • 1
  • 4
  • 20
  • if you don't have an option of adding a proxy via the client library, then you can make a call using HTTP REST calls directly. – Matt Small Apr 27 '22 at 16:53

1 Answers1

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 :

kavyaS
  • 8,026
  • 1
  • 7
  • 19