No announcement yet.

SMB with Azure File Storage

  • Filter
  • Time
  • Show
Clear All
new posts

  • SMB with Azure File Storage

    Has any one tried accessing Azure file storage using smb File reader?

    More details about Azure file storage here.

    Since I could not make it work using native SMB file reader. I used libraries provided by microsoft(see the java tab in above link for more details, will share mirth transformer code shortly); though would like the native thing to work

  • #2
    If you want to work with an Azure storage system, there is a java library from azure with the name of microsoft-windowsazure-api-0.4.6.

    The installation is easy, You need to upload/add it inside your mirth/custom-lib/lib folder and then restart.

    And then, you can try setting up the smb file reader as you want.
    HL7v2.7 Certified Control Specialist!


    • #3
      Using the library from MS...but not sure how to use smb reader

      I am already using the library as an alternative

      However I think the smb reader won't be able to use them. Would they?
      Out of box smb reader - I could not make it work with the azure storage..

      Here's the current code I am using...

      // get the jar files from github and include them as dependencies
      // Configure the connection-string with your values
      SERVER_NAME = "resource111111";
      ACCOUNT_KEY = "verylonggibberishstring";
      SHARE_NAME = "rootshare";//rootdirectory on your server
      storageConnectionString =
          "DefaultEndpointsProtocol=http;" +
          "AccountName="+SERVER_NAME+";" +
      s1 = new,ACCOUNT_KEY);
      // Use the CloudStorageAccount object to connect to your storage account
      try {
          storageAccount = new;
      } catch (invalidKey) {
          // Handle the exception

      // Create the file storage client.
      fileClient = storageAccount.createCloudFileClient();
      // Get a reference to the file share
      share = fileClient.getShareReference(SHARE_NAME);
      //Get a reference to the root directory for the share.
      rootDir = share.getRootDirectoryReference();
      transfer = function(inpath,outpath){
      	mydir = rootDir.getDirectoryReference(inpath);
      	list1 = mydir.listFilesAndDirectories();
      		try { 
      		} catch (e) {
      inpath="sourcefolder/subfolder"; //give the folder name on azure
      outpath="C:/Localfolder/"; // local folder. add extra / at end


      • #4
        Did you try creating File Reader with smb as a method? I think it should work after you upload that library.
        HL7v2.7 Certified Control Specialist!


        • #5
          Tried your suggestion... but no conenction...

          How will the smb reader know to use MS libraries?


          • #6
            Does the Microsoft-specific library do anything special on top of the SMB protocol? If so, then it makes sense that the standard File Reader doesn't work.
            Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

            Nicholas Rupley
            Work: 949-237-6069
            Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

            - How do I foo?
            - You just bar.