I am trying to create linked service on Azure Synapse using Azure CLI. I have a json file with code of linked service:
{
"name": "LS_dakeyvault",
"properties": {
"annotations": [],
"type": "AzureKeyVault",
"typeProperties": {
"baseUrl": "https://edap-d-kv.vault.azure.net/"
}
}
}
I would run following in Windows shell:
az synapse linked-service create --name LS_dakeyvault --file "C:\Project\SynGitTest0\linkedService\LS_dakeyvault.json" --workspace-name edap-d-syn
I would get this error:
Failed to parse JSON: C:\Project\SynGitTest0\linkedService\LS_dakeyvault.json
Error detail: Expecting value: line 1 column 1 (char 0)
The JSON may have been parsed by the shell. See https://learn.microsoft.com/cli/azure/use-cli-effectively#quoting-issues
I have the same problem with other shells (powershell, bash).
I tried following instructions from links that MS provided.I am not sure that I understand what should I do. I tried putting name of the file in single quotes:
az synapse linked-service create --name LS_dakeyvault --file "'C:\Project\SynGitTest0\linkedService\LS_dakeyvault.json'" --workspace-name edap-d-syn
(I am not sure that this is a right solution for quoting issue.) In that case I would get a different error:
string indices must be integers
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/synapse/manual/operations/artifacts.py", line
36, in create_or_update_linked_service
TypeError: string indices must be integers