I'm using the newer v4.x version of the Azure .NET SDKS - https://www.nuget.org/packages/Azure.Security.KeyVault.Secrets/4.1.0
In my case this is to access Key Vault secrets but the question probably applies globally. When using the above nuget package to retrieve a secret through a .NET Core 3.1 app, all seems to work OK.
var credential = new ClientSecretCredential("<TENANT_ID>", "<CLIENT_ID>", "<SECRET>");
var client = new SecretClient(new Uri("https://MyVault.vault.azure.net/"), credential);
var secret = await client.GetSecretAsync("MySecret");
However I need it to run in a .NET Framework 4.7.1, the call eventually times out after retrying 4 times.
I fully suspect this is down to the corporate proxy I work behind (although if there may be other reasons please tell me).
There is a SecretClientOptions
that inherits from ClientOptions
which contains a Transport
property but it is not immediately obvious how to use this.
I see on other versions of the Node SDK they have a proxyOptions
property but that doesn't exist in the .NET version. Is there another way to configure this?
I also wanted to try an diagnose a bit further but am not sure how to use the Diagnostics
property and I struggle to get Fiddler to capture any .NET traffic these days.
UPDATE: Looks like a fix for this was committed 9 days ago so expecting a fix soon which will make .NET Framework use the system proxy correctly - https://github.com/Azure/azure-sdk-for-net/issues/16990