Skip to content

Configuring the connect timeout doesn't change it from the default of 10 second. #47511

@hexadecimal1234

Description

@hexadecimal1234

Describe the bug
Using azure-blob-storage 12.31.3
We are using the azure-storage-blob library to upload files to Azure blob storage. Setting the connectTimeout in the com.azure.core.util.HttpClientOptions object which is then set into com.azure.storage.blob.BlobServiceClientBuilder via the clientOptions() method does not alter the connection timeout. No matter what is set, the connection timeout reverts to the default of 10 seconds.

I tried some different things as well.

I tried creating a com.azure.core.http.netty.NettyAsyncHttpClientBuilder object and directly setting the connection timeout through the API.

I tried the HttpClient.createDefault(HttpClientOptions) method and passing the connection timeout through the HttpClientOptions.

I tried setting the following in the -D properties. -DPROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT=15000

Exception or Stack Trace
=ERROR 2025-12-09 19:52:55.000343 [azure-sdk-global-thread-0] - io.netty.channel.ConnectTimeoutException: connection timed out after 10000 ms: login.microsoftonline.com/2603:1037:1:128:0:0:0:6:443

To Reproduce
Work from a machine without connectivity to Azure due to fire wall. Don't set the proxy configuration. Machine will not be able to reach Azure so the connection timeout will be invoked. Regardless of the configuration of the connect timeout the connection timeout always reports failure after 10 seconds.

Code Snippet
HttpClientOptions clientOptions = new HttpClientOptions();

    clientOptions.setConnectTimeout(Duration.ofMillis(15000));
    if (props.getResponseTimeout() > 0) {
        clientOptions.setResponseTimeout(Duration.ofMillis(props.getResponseTimeout()));
    }
    if (props.getReadTimeout() > 0) {
        clientOptions.setReadTimeout(Duration.ofMillis(props.getReadTimeout()));
    }
    if (props.getWriteTimeout() > 0) {
        clientOptions.setWriteTimeout(Duration.ofMillis(props.getWriteTimeout()));
    }
    blobServiceClientBuilder.clientOptions(clientOptions);

    blobServiceClient = blobServiceClientBuilder.buildClient();

Expected behavior
Configuring the connection timeout should correctly configure the connection timeout. Error message should reflect the configured connection timeout.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. iOS]
  • IDE: [e.g. IntelliJ]
  • Library/Libraries: [e.g. com.azure:azure-core:1.16.0 (groupId:artifactId:version)]
  • Java version: [e.g. 8]
  • App Server/Environment: [e.g. Tomcat, WildFly, Azure Function, Apache Spark, Databricks, IDE plugin or anything special]
  • Frameworks: [e.g. Spring Boot, Micronaut, Quarkus, etc]

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Assignees

Labels

Azure.Coreazure-coreHttpClientbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions