Goal : Handle Azure Blob Container with a Native Magic xpi connector
1/Prerequisites
Install Microsoft Azure Storage Explorer (* optional) to check the connection with your Azure EndPoint – Account Name – Account Key
All credentials (AccountName, Account Key) can be found in “Primary Connection String” (“Chaine de connexion principale” in french :-))
2/ Download the connector for Azure Storage (Magic xpi 4.14)
The Connector is available here (for Magic xpi 4.14) : https://france.magicsoftware.com/share/azurestorage.zip
(Please contact me to get the source)
Unzip the connector inside <Magic xpi Install directory>\Runtime\addon_connectors
3/ Define an Azure Storage Magic xpi Resource in your project and clic on the Button Validate
4/ Let’s build a flow with 6 steps
In order : Create container=>Upload Object => Download Object => Get BlobsList => Delete Blob => Delete Container
5/ Drag And Drop the Connector and configure it for the first method “Create Container”
Define 2 Flow variables (F.Response (Blob) and F.Success (Logical))
Right clic to configure the connector, set Store Result In and Operation Success with your flow variables and click OK
The connector implements 7 methods
To create a container choose “CreateCloudBlobContainer”
6/ Drag and drop another Azure Storage Connector and choose “UploadFromFile” method
(*) By setting blobname with the value folde1/bb.txt then it will create a subfolder in azure storage
7/ Proceed in the same way for the following steps (DownloadToFile, GetBlobList, DeleteBlobInContainer, DeleteContainer)
8/ Response Messages are :
- Container <container name> successfully created
- <your filename> successfully uploaded
- <your blobname> successfully downloaded to <your localdirectory>\<your localfilename>.downloaded
- <your blobs list>
- <your blobname> deleted successfully
- Container <container name> deleted successfully
if there is an error, the connector update C.Sys.ErrorCode with value 669 and C.SysErrorDescription.
9/ For DownloadFile method , File mode must be :
2:create(if file exists, it is replaced) otherwise it creates a new file.
10/ You can use Log4net file to get some logs.