Azure Files Integration Demo
This document discuss the following:
Azure Storage offers highly available, massively scalable, durable, and secure storage for a variety of data objects in the cloud.
Azure Files shares can be mounted concurrently by cloud or on-premises deployments of Windows, Linux, and macOS. Azure Files shares can also be cached on Windows Servers with Azure File Sync for fast access near where the data is being used.
Blob storage now supports the SSH File Transfer Protocol (SFTP). This support lets you securely connect to Blob Storage via an SFTP endpoint, allowing you to use SFTP for file access, file transfer, and file management.
Design
There are three ways for Iguana sync files into Azure Storage:
Azure Files Shares
Azure SFTP
Azure FileREST API
Azure Files Shares Integration Design
Key Components
Azure File Shares: Remote File Storage
File Share Mount: power-shell script accessible vis TCP SMB port (445)
Iguana: read or write file to File Share Mount as regular network drive using File Channel components or Translator
How to:
Setup File Shares in Azure Storage account.
Execute Power-shell script from File Shares setting in Iguana Server Windows
3. Configure Iguana Channel / translator to read or write files to this network drive
Azure SFTP Integration Design
Key Components
SFTP Container: Remote SFTP server powered by Azure container
Local User: provides SFTP remote access
Iguana: read or write file to SFTP container using File Channels or Translator
How to
Create Local User in Azure SFTP
Provisioning SFTP container
Configure SFTP connections in Iguana File Channel or Translator
Sample Code
-- SFTP Example -- START --- local fileName = 'filterSFTPData.hl7' local sftpConfigs = configs.sftpConfigs local SftpConn = net.sftp.init{server=sftpConfigs.host, username=sftpConfigs.username, password=sftpConfigs.password} -- Push file to Remote SFTP local isSuccess = SftpConn:put{remote_path=fileName, data=Data, overwrite=true} trace(isSuccess) -- Read file from Remote SFTP local fileData = SftpConn:get{remote_path=fileName} trace(fileData)
Azure FileREST API Integration Design
Key Components
SFTP Container: Remote SFTP server powered by Azure container
Azure AD App: Azure AD App as part of SFTP container access control (IAM) provides API access for Iguana.
Iguana: read or write file to SFTP container using Iguana net.http API in the Translator
How to
Provisioning SFTP container
Configure Access Control (IAM) in SFTP container (ex. Reader Role)
Build net.http API calls in Iguana translator
Sample Code
-- SFTP REST API Example -- START --- -- Use Azure AD APP API to access Azure Blob local appConfigs = configs.appConfigs --1) Get Access token local resp = net.http.post{ url=appConfigs.url, headers={['Content-Type'] = "application/x-www-form-urlencoded"}, parameters = { ['grant_type'] = 'client_credentials', ['client_id'] = appConfigs.clientID, ['client_secret'] = appConfigs.clientSecret, ['resource']= "https://storage.azure.com" }, cache_time=60, live = true } local token = json.parse{data=resp}.access_token trace(token) --2) Read file local resp2 = net.http.get{ url=configs.fileConfigs.baseUrl.."/"..fileName, headers={ ['Authorization'] = "Bearer "..token, ['x-ms-version'] = configs.fileConfigs.storageVersion }, cache_time=60, live = true } trace(resp2) -- SFTP REST API Example -- END ---