Azure Resource Manager

Using JSON Edit to edit my ARM Templates

I have just seen a Twitter about JSONEdit and have decided to give it a try. It can be a bit challenging to edit JSON using Visual Studio. Although you can see the tree, you can really interact with with, like copying and editing content. My expectations are that I will be able to do that with JSONEdit.

You can download it from here: http://tomeko.net/software/JSONedit/

Installation, well, there was no installation, actually. When I ran it, I’ve got this very screamy page:

image

I believe I can trust it, so, let’s run it anyways.

And there you have it. Let’s try opening some files. I have the files I have used for my ARM previous articles. On the first try, I had this error:

image

And it really seems that there is something funny there:

image

Even removing the characters, it won’t think this is a JSON file when asking to reformat the code:

 

image

Let’s try editing it with VS and then paste it directly to JSONEdit. Once I did that, I could easily see the tree:

image

The nice thing about the tree here is that you can edit the content:

image

You can also order the nodes and even better, copy and paste (as child or sibling):

image

Once you have it changed, you can paste it back to Visual Studio, for testing and deployment.

In summary, it seems like a nice tool to have, if you want to make sure you are replicating whole sessions or wants to better visualize some variables and resources. It seems Microsoft stored more data in the JSON files, which are not well understood by JSONEdit, but still good to have around when you are editing ARM Templates.

 

Hope this helps!

1 comment

  1. TO

    These three funny characters are UTF-8 BOM. Its use is not recommended in general (1), I hope it is not required by MS (UTF-8 without BOM is allowed). Version 0.9.14 of JSONedit asks if it should be stripped when loading new file, output files are always written without BOM. If you have file with another problem please send it as example to author (me).

    (1) quoting quote from wikipedia: “The Unicode Standard 5.0, Chapter 2:General Structure”: Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature

Leave a Reply

Your email address will not be published. Required fields are marked *