Validate XML user content in Logic App workflows with XSD Validator
When processing XML files in Logic App workflows, XSD validation is a necessary pre-processing step to catch errors beforehand. Microsoft currently only supports XSD validation within Logic App workflows on top of Azure Integration Accounts. This kind of resource is rather expensive and not always available within the cost boundaries of client projects.
The Invictus Framework provides a XSD Validator component that allows you to validate XML files within your Logic App workflow by storing the XSD schemas in an Azure Blob Storage container. The interaction with the component happens via a HTTP endpoint; circumventing the need of an expensive Azure Integration Account.
XSD validate user XML
The XSD Validator has a single endpoint available: /api/ValidateXmlAgainstXsd. Given an user XML and referenced XSD schema (stored in Azure Blob Storage), the endpoint response with the result of the validation, possibly with violation failures.
| JSON property | Required | Description |
|---|---|---|
Content | yes | The BASE64-encoded XML user input that needs to be validated. |
XsdName | yes | The name of the XSD schema, stored in Azure Blob Storage. |
Full request example
// POST -> /api/ValidateXmlAgainstXsd
{
"Content": "PHBlcnNvbj48Zmlyc3ROYW1lPkpvaG48L2ZpcnN0TmFtZT48L2xhc3ROYW1lPkRvZTwvbGFzdE5hbWU+PHByb2R1Y3RUeXBlPjEwPC9wcm9kdWN0VHlwZT48L3BlcnNvbj4=",
"XsdName": "person.xsd"
}
Full response example
// 200 OK <- /api/ValidateXmlAgainstXsd
{
"isValid": false,
"exceptions": [
{
"message": "The element 'person' has invalid child element 'productType'. List of possible elements expected: 'firstName', 'lastName'."
}
]
}
Stored XSD schemas
Upload referenced XSD schema files to the Azure Blob Storage container xsdvalidatorstore (available upon installation), within the Invictus Azure Storage Account that's part of the installation.
Related Bicep template parameters
| Name | Description | Tags |
|---|---|---|
invictusXsdValidatorFunctionLocalContainerImage | The URL that navigates to the Azure Container App image of the XSD Validator component. | comp:xsd-validatorcontainer-apps |
storageAccountNamedefault: invictus${resourcePrefix}store | The name of the shared Azure Storage Account, used by all Framework components. | comp:pubsubcomp:transcocomp:regex-translatorcomp:xsd-validatorcomp:xml-json-convertercomp:time-sequencercomp:sequence-controllerstorage |
xsdValidatorFunctionNamedefault: inv-${resourcePrefix}-xsdvalidator | The name of the Azure Container App deployed for the XML-JSON Converter component. | comp:xsd-validatorcontainer-apps |
xsdValidatorScaling | The Azure Container App scaling options of the XSD Validator component. | comp:xsd-validatorscalingcontainer-apps |