Create Azure storage backed Form Data Model

Last update: 2023-04-03
  • Created for:
  • Beginner

Create Azure storage backed Form Data Model


Hi, in this video, we will take a look at integrating AEM forms as Cloud service. With Azure portal storage, Azure blob storage is Microsoft object storage solution for the Cloud, blob storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that doesn’t adhere to any particular data model or definition such as text or binary data. So the first thing you need to do is to create an account in Microsoft Azure portal, and then you create a storage account. And once you have the storage account, make sure you get to this access keys here and make a note of these two access keys here. This access key and the connection strings. So these are the two properties that we’ll be using to connect our AEM forms as Cloud service with this particular storage account in Azure portal. So the next thing you need to do is to log into our AEM forms Cloud service instance, go into the Cloud service option here and click on the Azure storage icon, select the folder in which you are going to create your Cloud services configuration. I’m going to select the global storage here, sorry, let’s click on global and then click on create.

So here give a meaningful title. So let’s call it, formsCSandAzureblob.

And here you need to provide the keys that I showed you in the previous screen. So first is Azure storage account. I’ve made a copy. You can go back to this key here Azure storage account, so that’s the copy to the clipboard and paste it in here. And then the next is the Azure access key. So select go to the Azure access key here and copy and paste it into this here. So once you have these specified click on save to create the data source configuration. So now that the data source configuration is created, the next step that you would need to do is to create a form data model based on this Cloud services configuration that we just created. So to create a form data model, we go into our forms, UI, go into the data integrations and click on create form data model.

So here give a meaningful name. So I’m going to call it storeformdatain Cloudservices, right? And then give the data source configuration can reside in the global folder. If you want, you can select that here, click on next to select the Cloud services configuration that we had created earlier. So let’s select that here, it was called form service.

Yeah, it was called formCSinAzureblob, right? Select that and click on create. So now the form data model is created successfully. Let’s go ahead and open it in the edit mode.

So the form data model editor is opened here.

And if you expand this, you will notice that there are no schemas associated because the data that is stored in the Azure portal storage is of an unstructured data as such they won’t be any schemas, but out of the box, we provide you these services, which allow you to store and manipulate the blobs that you would store in the Azure portal storage, using AEM forms as Cloud service. In the next video, we will take a look at creating an entity and storing some sample data in the storage account that you have in your Azure portal.

Once your form data model backed by an Azure portal storage account is created. The next thing we need to do is to create an entity to mimic the data that you want to store in the storage account. So to create an entity, click on this and give a meaningful name here, I’m going to give, call it credit applications, because we’re going to stores credit applications that were submitted using AEM forms and click on add. Now that the entity is created, let’s go ahead and add some child properties. So save this entity and select the entity here and create a child properties. So these are properties of this particular entities. The first thing we need to do is to capture the applicant name.

So that is the applicant name here, and the title is going to be the same with the space here, applicant name, and the type is going to be of type string here, click done.

We can add entities of type binary. So we’ll create a entity to capture the image or the photograph of the person applying for credit. So that’s going to be called as applicant photograph picture, applicant’s picture and you can copy the same name and the title would be the same, applicant picture, but the type is going to be of type binary, so this way you can add as many entities or properties to, as many properties to entities as you would want. And those entities would then be stored in your Azure portal storage using the same operation of the form data model.

So I have added some more properties to this entity and those properties are city, address, states, zip code, social security number, and a property of type float called monthly income. So now that our entity is complete, we need to configure a service, which would allow us to store this data in our Azure portal storage. So to do that, let’s select the entity here and open up its properties sheet here. And for now there is no read service. So we are going to set it as none here and for the write service, we’ll going to select this save blob with Azure service and the save blob in Azure service expect some parameters here. The first one is the credit application. That is our entity. We don’t need to do anything there. The second one is the blob ID. So this is the blob ID with which our data will be stored in Azure storage account. So that we’re going to say bind it to the social security number of the person submitting the forms. So, select the social security number here, and then the container name. So this is something specific to Azure storage account, and this can be a literal and make sure it is all in lower case.

So we can give any string here. I’m going to call it credit applications submitted.

And then there is a binaries in line property, which determines how the binary data with this particular entity is stored, that is stored in line or not? So here, we’re going to select it as literal. And we’re going to say, it’s not going to be stored in line. We will talk about this later in one of the other videos. And then, so these are the three properties that we need to configure the blob ID, the container name and the binaries in line. Of course the credit application is our entity that will be stored. So click on done here and save. So now that our form data model with the entity and the entity is configured to use the appropriate service to store the data in the Azure portal storage is created. The next thing that we need to do is to create an adaptive form based on this particular form data model and on submission of the adaptive form, the data will be stored in the Azure portal storage account. -

On this page