Expecting property name enclosed in double quotes when passing JSON string to Azure CLI (from PowerShell)

Question:

To create diagnostic settings on an Azure Firewall I want to pass in logs and metrics settings.

I define these in 2 variables and then pass ’em into Azure CLI:

Executing this I get Expecting property name enclosed in double quotes: line 1 column 3 (char 2).

I tried without success

  • changed from multiline string literal to single line (which caused another error)
  • replaced ' with "

Answer:

Adding --debug parameter to Azure CLI revealed, that single quotes are eliminated in a argument transformation process which seems to cause the error:


Solution: escaping the quotes with \" made it work:

Source:

Expecting property name enclosed in double quotes when passing JSON string to Azure CLI (from PowerShell) by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply