Azure Blob Storage is Microsoft's cloud-based object storage solution, similar to Amazon's S3 (Simple Storage Service). Both services offer scalable and secure storage for large amounts of unstructured data, such as text or binary data. They provide similar features, including high availability, durability, and multiple redundancy options to ensure data protection. Users can store and retrieve any amount of data at any time, benefiting from ease of access through various APIs and tools, making both services ideal for a wide range of applications including backup, archival, and big data analytics.
This is in line with the last implementation post about making a connection to Microsoft to leverage their Graph API. This time, we are going to be writing TrueContext Submission JSON files into a Microsoft Storage account so that the data can be processed and sent to any other source in Azure.
Sending submission data to Azure Blob Storage allows you to both keep a record of all the data that has been captured and is also a gateway to getting this data into your other Azure services using a Data Pipeline.
We will start by creating or using an existing Storage Account in Azure and then a new (or an existing) container inside the Storage Account.
Creating the connection in TrueContext
Following similar steps to create the App Registration in Azure as found here you can assign different permissions to all the app to have access to Azure Blob Storage. The level of permissions needed will be up to the business, but the service will need the ability to write to the Storage Account.
-
In TrueContext, create an HTTP Connection we will use the OAuth 2 method. The settings that will be input will be as follows:
-
Next you will click on the Connect button in the connection and should be presented with a Connection Established. If you receive an error, please review your app registration permissions and the values of the Client ID and Secret that were input.
This connection can now be used to make API calls to Azure Blob Storage to send your JSON/PDF or any output
Creating a destination to Azure Blob Storage
Now we will create the destination in TrueContext to write submissions in the form of a JSON into the container of choice.
-
Navigate to the FormSpace that has permissions to use the Connection that we just created. Preferably, test this in a development FormSpace first.
-
Create a new HTTP Data Destination
-
Give it a name and ensure that it is using the connection that we created.
-
On the Request Configuration tab, use the following settings:
-
-
HTTP Method: PUT (POST will return an error)
-
URL Suffix: /containerName/filename.json
-
Replace containerName with the container that you would like to write into.
-
Replace filename with the naming convention that you would like. A common one would be %r.json to use the submission identifier.
-
If you would like to build a folder structure in the Container, you can specify a path and the folders will be created automatically. /containerName/folder1/folder2/filename.json
-
Request Headers:
-
Key: Content-type Value: application/octet-stream
-
Key: x-ms-blob-type Value: BlockBlob
-
Click on Update to finalize the data destination
Testing this out will be as simple as adding this destination to any form, attaching the standard JSON (V2) document type and submitting the form.
Once the form is submitted, the json file should land in the Container/Folder that was specified.
Now that you are sending data in Azure Blob Storage, you can leverage Azure Data Factory to parse, process, and manipulate the data just the way that you need to send it off to other services like Azure Cosmo DB, SQL Server, and many others.
#Microsoft #TechTalkImplementation
------------------------------
Ian Chamberlain
Solutions Architect
TrueContext
------------------------------