I receive a "Expecting value: line 1 column 1 (char 0)" message whenever I try to add the OMS extension to an existing Linux VM. I replaced myResourceGroup, myVM, omskey and omsid in the code copied from the documentation below.
az vm extension set \
--resource-group myResourceGroup \
--vm-name myVM \
--name OmsAgentForLinux \
--publisher Microsoft.EnterpriseCloud.Monitoring \
--version 1.7 --protected-settings '{"workspaceKey": "omskey"}' \
--settings '{"workspaceId": "omsid"}'
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the question! We are investigating and will update you shortly.
@terrymandin I tried out in bash shell. I didn't get any error. Can you please tell me from which shell you are trying to execute this command?
Also please verify the single and double quotes are proper in protected settings and settings.
@jakaruna-MSFT , I tried replacing all of the single and double quotes and it did not fix the problem. I am running on Windows 10. I upgraded to the most recent version of az this morning and had the same issue. Feel free to ping me on email at terry.[email protected] and I will send you my script.
Here are the details of my az versioning:
C:\WINDOWS\system32>az --version
azure-cli (2.0.52)
acr (2.1.10)
acs (2.3.12)
advisor (2.0.0)
ams (0.3.1)
appservice (0.2.8)
backup (1.2.1)
batch (3.4.1)
batchai (0.4.5)
billing (0.2.0)
botservice (0.1.2)
cdn (0.2.0)
cloud (2.1.0)
cognitiveservices (0.2.4)
command-modules-nspkg (2.0.2)
configure (2.0.19)
consumption (0.4.0)
container (0.3.9)
core (2.0.52)
cosmosdb (0.2.5)
dla (0.2.3)
dls (0.1.6)
dms (0.1.1)
eventgrid (0.2.0)
eventhubs (0.3.1)
extension (0.2.3)
feedback (2.1.4)
find (0.2.12)
hdinsight (0.1.0)
interactive (0.4.0)
iot (0.3.4)
iotcentral (0.1.4)
keyvault (2.2.8)
lab (0.1.4)
maps (0.3.2)
monitor (0.2.7)
network (2.2.10)
nspkg (3.0.3)
policyinsights (0.1.0)
profile (2.1.2)
rdbms (0.3.5)
redis (0.3.2)
relay (0.1.2)
reservations (0.4.1)
resource (2.1.6)
role (2.1.11)
search (0.1.1)
servicebus (0.3.2)
servicefabric (0.1.9)
signalr (1.0.0)
sql (2.1.6)
storage (2.2.6)
telemetry (1.0.0)
vm (2.2.9)
Extensions:
azure-cli-iot-ext (0.5.0)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\temandin.azure\cliextensions'
Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
@terrymandin can you try running the command in Azure Cloud Shell instead?
@terrymandin Tried out this command in command prompt. Since the JSON used in the command had spaces, It failed. After removing the spaces in both settings and protected settings, The command worked well. We also need to note that the example provided will work well with bash or cloud shell.
I will close this out for now. If you need additional help please let me know and we can reopen and continue.
Thanks Jakaruna, the spaces were most likely the problem. I see there are still spaces in the original documentation. Will you remove those?
@jakaruna-MSFT This is also true for the examples on this page https://docs.microsoft.com/en-us/cli/azure/monitor/diagnostic-settings?view=azure-cli-latest