Wouter van Koppen
Wouter van Koppen

Reputation: 1121

Enforce and check JSON format in Azure Table Storage

Currently, I use Azure Table Storage to store some configuration data (see below for an example). The data is kind of unstructured, so I store it into the table using JSON. The whole document is stored in a database field.

{
    "group1": [
      "value1",
      "value2",
      "value3",
      "subgroup": [
          "value1",
          "value2"
        ]
    ],
    "othergroup": [
      "value1"
    ]
}

Is there a way to at least enforce a valid JSON string to be stored in the database? Because Table Storage under the hood store is as a string, there is no validity with respect to JSON at all. Neither is the JSON automatically formatted. JSON not formatted and checked

Previously at another project I worked with MongoDB and Studio 3T and was really happy with how you could manage JSON in it. Then, it was simply not possible to store an invalid JSON string into MongoDB.

However, Studio 3T is not usable for Table Storage, as far as I know..

Upvotes: 0

Views: 284

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29995

Just to summarize, Azure table storage / Azure Storage Explorer does not support json validation.

It's properties are just strings for no-sql storage. As of now, you should implement your own logic for json validation.

Hope it can help others who have the same issue.

Upvotes: 1

Related Questions