Azure-Samples / azure-sdk-for-java-storage-blob-upload-download

How to upload and download blobs from Azure Blob Storage with Java
16 stars 34 forks source link

xception in thread "main" java.lang.IllegalArgumentException: Input byte array has incorrect ending byte at 16 at java.base/java.util.Base64$Decoder.decode0(Base64.java:876) at java.base/java.util.Base64$Decoder.decode(Base64.java:566) #17

Open bravikr opened 9 months ago

bravikr commented 9 months ago

Exception in thread "main" java.lang.IllegalArgumentException: Input byte array has incorrect ending byte at 16 at java.base/java.util.Base64$Decoder.decode0(Base64.java:876) at java.base/java.util.Base64$Decoder.decode(Base64.java:566) at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.createMac(BaseAuthorizationTokenProvider.java:218) at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.lambda$reInitializeIfPossible$0(BaseAuthorizationTokenProvider.java:250) at com.azure.cosmos.implementation.MacPool.(MacPool.java:27) at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.reInitializeIfPossible(BaseAuthorizationTokenProvider.java:250) at com.azure.cosmos.implementation.BaseAuthorizationTokenProvider.(BaseAuthorizationTokenProvider.java:38) at com.azure.cosmos.implementation.RxDocumentClientImpl.(RxDocumentClientImpl.java:459) at com.azure.cosmos.implementation.RxDocumentClientImpl.(RxDocumentClientImpl.java:330) at com.azure.cosmos.implementation.RxDocumentClientImpl.(RxDocumentClientImpl.java:290) at com.azure.cosmos.implementation.AsyncDocumentClient$Builder.build(AsyncDocumentClient.java:275) at com.azure.cosmos.CosmosAsyncClient.(CosmosAsyncClient.java:170) at com.azure.cosmos.CosmosClientBuilder.buildAsyncClient(CosmosClientBuilder.java:1084) at com.azure.cosmos.CosmosClientBuilder.buildAsyncClient(CosmosClientBuilder.java:1071)

Get the above exception when I try to use and run the below api.

     CosmosAsyncClient   client = new CosmosClientBuilder()
                                          .endpoint(endpointUri)
                                          .key(connection_string)
                                         .buildAsyncClient();

public String connection_string = "AccountEndpoint=https://";

Is that conneciton_string needs to be encrypted ? but how it has to be ?