@KarishmaTiwari-MSFT thanks for your reply.
This is what i have tried.
======================================================================================================
$logsSetting = '{"workspaceKey": "efasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf=="}'.Replace("'",'\"')
$metricsSetting = '{"workspaceId":"1111111-1111-1111-b111-00fb111111111"}'.Replace("'",'\"')
az vm extension set --name OmsAgentForLinux `
--publisher Microsoft.EnterpriseCloud.Monitoring --version 1.* --no-auto-upgrade --no-wait --force-update `
--protected-settings $logsSetting `
--settings $metricsSetting `
--resource-group "myresourcegroup-rg" `
--vm-name "MYVM03"
==========================================================================================================
this is the error i am getting:
Error detail: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
The JSON may have been parsed by the shell. See https://learn.microsoft.com/cli/azure/use-cli-effectively#use-quotation-marks-in-arguments