You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/04/04 15:03:18 UTC

[GitHub] [jackrabbit-oak] jelmini commented on a diff in pull request #510: OAK-9713 sas uri support in oak-upgrade

jelmini commented on code in PR #510:
URL: https://github.com/apache/jackrabbit-oak/pull/510#discussion_r841846442


##########
oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/node/SegmentAzureFactory.java:
##########
@@ -143,11 +159,16 @@ private AzurePersistence createAzurePersistence() throws StorageException, URISy
         CloudBlobDirectory cloudBlobDirectory = null;
 
         if (accountName != null && uri != null) {
-            String key = System.getenv("AZURE_SECRET_KEY");
-            StorageCredentials credentials = new StorageCredentialsAccountAndKey(accountName, key);
+            StorageCredentials credentials;
+            if (!StringUtils.isBlank(sasToken)) {
+                credentials = new StorageCredentialsSharedAccessSignature(sasToken);
+            } else {
+                String key = System.getenv("AZURE_SECRET_KEY");
+                credentials = new StorageCredentialsAccountAndKey(accountName, key);
+            }
             cloudBlobDirectory = AzureUtilities.cloudBlobDirectoryFrom(credentials, uri, dir);

Review Comment:
   Shouldn't we call `AzureUtilities.cloudBlobDirectoryFrom(credentials, uri, dir, skipCreateContainer)` here as well? If credentials of type `StorageCredentialsSharedAccessSignature` are used, then the container creation may need to be skipped. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org