I'm working on integrating Azure Blob Storage into a Java application using the Azure SDK. When initializing the BlobContainerClient, I encounter the following error only on the server (not on my local machine):
Caused by: **java.lang.IllegalStateException**: A request was made to load the default HttpClient provider but one could not be found on the classpath. If you are using a dependency manager, consider including a dependency on azure-core-http-netty or azure-core-http-okhttp. Depending on your existing dependencies, you have the choice of Netty or OkHttp implementations. Additionally, refer to https://aka.ms/azsdk/java/docs/custom-httpclient to learn about writing your own implementation.
at com.azure.core.implementation.http.HttpClientProviders.createInstance(HttpClientProviders.java:37)
at com.azure.core.http.HttpClient.createDefault(HttpClient.java:27)
at com.azure.core.http.HttpPipelineBuilder.build(HttpPipelineBuilder.java:60)
at com.azure.storage.blob.implementation.util.BuilderHelper.buildPipeline(BuilderHelper.java:110)
at com.azure.storage.blob.BlobServiceClientBuilder.buildAsyncClient(BlobServiceClientBuilder.java:107)
at com.azure.storage.blob.BlobServiceClientBuilder.buildClient(BlobServiceClientBuilder.java:84)
at com.azure.service.impl.AzureBlobAuthService.authenticate(AzureBlobAuthService.java:46)
Here is the relevant part of my code:
BlobContainerClient containerClient = new BlobContainerClientBuilder()
.endpoint(config.getSasUrl())
.containerName(config.getContainerName())
.buildClient();
Additional Info: I'm using Maven with the following dependency:
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.9.0</version>
</dependency>