stijn192 commented on a change in pull request #4430:
URL: https://github.com/apache/nifi/pull/4430#discussion_r463234889
##########
File path:
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/utils/AzureStorageUtils.java
##########
@@ -146,24 +142,46 @@ private AzureStorageUtils() {
}
/**
- * Create CloudBlobClient instance.
+ * Create BlobServiceClient instance.
* @param flowFile An incoming FlowFile can be used for NiFi Expression
Language evaluation to derive
* Account Name, Account Key or SAS Token. This can be
null if not available.
*/
- public static CloudBlobClient createCloudBlobClient(ProcessContext
context, ComponentLog logger, FlowFile flowFile) throws URISyntaxException {
+ public static BlobServiceClient createBlobServiceClient(PropertyContext
context, FlowFile flowFile) {
final AzureStorageCredentialsDetails storageCredentialsDetails =
getStorageCredentialsDetails(context, flowFile);
- final CloudStorageAccount cloudStorageAccount = new
CloudStorageAccount(
- storageCredentialsDetails.getStorageCredentials(),
- true,
- storageCredentialsDetails.getStorageSuffix(),
- storageCredentialsDetails.getStorageAccountName());
- final CloudBlobClient cloudBlobClient =
cloudStorageAccount.createCloudBlobClient();
-
- return cloudBlobClient;
+
+ final String storageSuffix =
StringUtils.isNotBlank(storageCredentialsDetails.getStorageSuffix())
+ ? storageCredentialsDetails.getStorageSuffix()
+ : "blob.core.windows.net";
Review comment:
@turcsanyip good question, actually now (to limit the size of this
already quite large PR) I've chosen to stick to the current functionality,
where there is and was no working custom endpoint yet in the Azure Queue
Storage processors. (read: the value could be set on the processor, but nothing
happened when configuring it). Hence I've chosen for a more hardcoded endpoint
which is visible over at line 72 on the
[AbstractAzureQueueStorage.java](https://github.com/stijn192/nifi/blob/2cfadeedc9e6546a58cf903074cf9913c9f11f66/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/queue/AbstractAzureQueueStorage.java#L72)
We could implement the custom endpoint now, or make it a seperate feature,
where we willend up having to make a separate credential class, as far as I can
see it. Tested sending to the `blob.core.windows.net` endpoint will actually
fail and will give the following error:
```
java.lang.AssertionError: Expected all Transferred FlowFiles to go to
success but 1 were routed to failure
```
---
@jfrazee - from v12 api's onwards, endpoint need to be full url's and will
give an `malformed endpoint` error when not setting the full url. See also here:
[QueueServiceClientBuilder Microsoft API
Docs](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-java/staging/apidocs/com/azure/storage/queue/QueueServiceClientBuilder.html)
[BlobServiceClientBuilder Microsoft API
Docs](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-java/staging/apidocs/com/azure/storage/blob/BlobServiceClientBuilder.html)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]