Microsoft Azure - Using JSON with Azure Logic Apps - GeeksforGeeks

30 Jul, 2021

In this article, we will look into how to create JSON Schema that can be used in Azure logic apps. For the sake of example, here one of our goals is to create an Azure logic app that gets triggered by an HTTP request. 
Now, when we pass our JSON payload over, we want it to be validated. So, let’s look into a few tools that we could use to generate some sample JSON data, as well as to create a JSON Schema based on it. 
First, let’s look at ObjGen. This is an online tool that we could use to just mark out some sample JSON data. So, notice we could come here and we could just start typing in some properties and giving it values, and on the right side, it will just generate some information for us.we
Now, we could copy our JSON data and we can go over to another tool called the JSON Schema tool. What we could do here now, is paste in that JSON data, and hit “Submit”. 
Notice here on the right side, it’s going to create that JSON Schema that we could use as shown below:
{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "http://example.com/example.json",
    "type": "object",
    "title": "The root schema",
    "description": "The root schema comprises the entire JSON document.",
    "default": {},
    "examples": [
        {
            "CompanyName": "Geeksforgeeks",
            "CompanyOwner": "Sandeep Jain"
        }
    ],
    "required": [
        "CompanyName",
        "CompanyOwner"
    ],
    "properties": {
        "CompanyName": {
            "$id": "#/properties/CompanyName",
            "type": "string",
            "title": "The CompanyName schema",
            "description": "An explanation about the purpose of this instance.",
            "default": "",
            "examples": [
                "Geeksforgeeks"
            ]
        },
        "CompanyOwner": {
            "$id": "#/properties/CompanyOwner",
            "type": "string",
            "title": "The CompanyOwner schema",
            "description": "An explanation about the purpose of this instance.",
            "default": "",
            "examples": [
                "Sandeep Jain"
            ]
        }
    },
    "additionalProperties": true
}
Now, we could use this JSON Schema inside of the HTTP action inside of the Azure logic app to help validate that JSON, that might come over in the body.

azure-cloud-instances


Cloud-Computing


Microsoft Azure

Writing code in comment? 
                                    Please use ide.geeksforgeeks.org, 
                                    generate link and share the link here.
                                
Microsoft Azure - Installation of Service Bus Explorer
Microsoft Azure - Azure VM Disk Space in Percentage using Azure KQL
How to Install SQL Server on Azure VM?
Microsoft Azure - Rebooting an Application Gateway
Microsoft Azure - Check Status of Azure VM using Azure PowerShell
Microsoft Azure - Get Azure VM Properties using Azure PowerShell
Defense in Depth Strategy in Microsoft Azure
Microsoft Azure - Mount Azure Storage in Container App In App Service
Installing Private Git Server on K8s Cluster with Gitea and AKS
Microsoft Azure - Enable Windows Event Logs in Azure for Monitoring