You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/09/29 14:03:15 UTC

[camel] branch master updated: fix azure blob client code sample

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 399d0a9  fix azure blob client code sample
     new 94cf62e  Merge pull request #3207 from smccarthy-ie/azure-blob-client-code-sample
399d0a9 is described below

commit 399d0a964896327b86e7483c84e2b1a6d2c33bc5
Author: Stephen McCarthy <st...@redhat.com>
AuthorDate: Fri Sep 27 18:47:04 2019 +0100

    fix azure blob client code sample
---
 .../src/main/docs/azure-blob-component.adoc        | 31 +++++++++++-----------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/components/camel-azure/src/main/docs/azure-blob-component.adoc b/components/camel-azure/src/main/docs/azure-blob-component.adoc
index 7564947..0cf8f69 100644
--- a/components/camel-azure/src/main/docs/azure-blob-component.adoc
+++ b/components/camel-azure/src/main/docs/azure-blob-component.adoc
@@ -235,39 +235,38 @@ You have to provide the containerOrBlob name and the credentials if the private
 
 === Azure Blob Client configuration
 
-If your Camel Application is running behind a firewall or if you need to
-have more control over the Azure Blob Client configuration, you can
-create your own instance:
+If your Camel application is running behind a firewall or if you need more control over the Azure Blob Client configuration, you can create your own instance:
 
 [source,java]
---------------------------------------------------------------------------------------
-StorageCredentials credentials = new StorageCredentialsAccountAndKey("camelazure", Base64.encode("thekey".getBytes()));
-CloudBlob client = new CloudBlockBlob("camelazure", credentials);
+----
+StorageCredentials credentials = new StorageCredentialsAccountAndKey(accountName, accessKey);
+CloudBlob client = new CloudBlockBlob(URI.create("https://"
+                    + accountName + ".blob.core.windows.net/" + containerName 
+                    + "/" + fileName), credentials);
 registry.bind("azureBlobClient", client);
---------------------------------------------------------------------------------------
+----
 
-and refer to it in your Camel azure-blob component configuration:
+Then refer to this instance in your Camel `azure-blob` component configuration:
 
 [source,java]
---------------------------------------------------------------------------------
-from("azure-blob://camelazure/container1/blockBlob?azureBlobClient=#client")
+----
+from("azure-blob://" + accountName + "/" + containerName + "/" + fileName + "?azureBlobClient=#client")
 .to("mock:result");
---------------------------------------------------------------------------------
+----
 
 == Dependencies
 
-Maven users will need to add the following dependency to their pom.xml.
+Maven users will need to add the following dependency to their `pom.xml`.
 
 *pom.xml*
 
 [source,xml]
----------------------------------------
+----
 <dependency>
     <groupId>org.apache.camel</groupId>
     <artifactId>camel-azure</artifactId>
     <version>${camel-version}</version>
 </dependency>
----------------------------------------
-
-where `${camel-version`} must be replaced by the actual version of Camel.
+----
 
+where `${camel-version}` must be replaced by the actual version of Camel.