Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

JAVA Storage SDK is throwing exception on SAS URI datetime parsing #573

@homezcx

Description

@homezcx

Which service(blob, file, queue, table) does this issue concern?

Blob

Which version of the SDK was used?

<dependency>
  <groupId>com.azure</groupId>
  <artifactId>azure-storage-blob</artifactId>
  <version>12.14.4</version>
</dependency>

What problem was encountered?

We have one SAS token generated by az cli, example: [https://dummy.blob.core.windows.net/dummy?se=2023-04-23&sp=rwl&sv=2021-04-10&sr=c&.......].

When it's applied in the below code, exceptions will be thrown on parsing the expiry date:
new BlobContainerClientBuilder().endpoint(storageUri).retryOptions(new RequestRetryOptions()).buildClient()

Invalid Date String: 2023-04-23.; Exception trace: java.lang.IllegalArgumentException: Invalid Date String: 2023-04-23. at com.azure.storage.common.Utility.parseDate(Utility.java:209) at com.azure.storage.common.sas.CommonSasQueryParameters.getQueryParameter(CommonSasQueryParameters.java:168) at com.azure.storage.common.sas.CommonSasQueryParameters.<init>(CommonSasQueryParameters.java:87) at com.azure.storage.blob.BlobUrlParts.parse(BlobUrlParts.java:393) at com.azure.storage.blob.BlobContainerClientBuilder.endpoint(BlobContainerClientBuilder.java:159)

Have you found a mitigation/solution?

The SAS token has to include a full date string on the expiry date like the below in order to let it work through:
se=2022-04-28T09:54:08Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions