Connect to Azure Storage blob Behind Proxy: The proxy tunnel request to proxy 'http://ipaddress:port/' failed with status code '407'

876 Views Asked by At

Follow code available on Microsoft documentation portal but what if I want add the proxy to it? I'm using .NET Core 6+

string blobstorageconnection = pConfig.AzuerBlobStorageConnectionString;
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(blobstorageconnection);
CloudBlobClient? blobClient = null;
CloudBlockBlob? blockBlob = null;
blobClient = cloudStorageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference(pConfig.AzureStorageContainerName);
blockBlob = container.GetBlockBlobReference(pFileName);
await blockBlob.UploadFromFileAsync(pFilePath + @"\" + pFileName);

I tried above code and it is working fine without proxy setting in network but as we enable the proxy setting system raise the error : "The proxy tunnel request to proxy 'http://ipaddress:port/' failed with status code '407'."

0

There are 0 best solutions below