Azure Quick Tip: Fixing Azure Automation ‘Invalid JSON primitive’ error

Here’s the scenario: You are working with Azure Automation and out of the blue, you start getting the error Invalid JSON primitive: Import-Module as depicted in the image below. Before changing your code (and I mean tearing up the code itself, modules, etc.) do yourself a favor and check the JSON file. Most of the time it is just bad formatting on the JSON file — missing a bracket, comma, or something like that.

Invalid JSON primitive
Yes, sometimes it’s the simplest thing that trips you up.

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top