Skip to content

Instantly share code, notes, and snippets.

@BelRarr
Created November 29, 2023 15:42
Show Gist options
  • Save BelRarr/ba1ea5fc039614751185d7422b23ea58 to your computer and use it in GitHub Desktop.
Save BelRarr/ba1ea5fc039614751185d7422b23ea58 to your computer and use it in GitHub Desktop.
configure the proxy communication in the startup.cs file
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
var proxy = new WebProxy("http://proxyserver:8080", false);
var httpClientHandler = new HttpClientHandler
{
Proxy = proxy,
UseProxy = true,
};
var httpClient = new HttpClient(httpClientHandler, false);
var options = new DefaultAzureCredentialOptions
{
HttpClient = httpClient,
};
var credential = new DefaultAzureCredential(options);
services.AddSingleton(x => new SecretClient(new Uri("<your-key-vault-url>"), credential));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment