I'm using the below YAML code to deploy Synapse objects (Datasets/DataFlow/Pipelines) using CLI within the PowerShell core
- task: AzureCLI@2
inputs:
azureSubscription: 'ServiceConnection'
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: 'az synapse dataset create --workspace-name SynapseWorkspaceName --name SQLServer1 --file @"$(System.DefaultWorkingDirectory)/dataset/SqlServer.json"'
I'm getting the below error
No characters are allowed after a here-string header but before the end of the line.
Note: I'm able to create Synapse objects using the same Azure CLI command (shown above) in the below scenarios
- In my local machine
- Azure DevOps - Azure CLI with Bash as SciptType
Azure CLI command also allows us to pass the JSON content (the issue is when you pass just the JSON file name) which is working fine.
Appreciate the help.
Thanks,
Praveen
I can reproduce the same error when running the command within
pwshinstalled on a Linux machine and PowerShell on a Windows machine.According to Tips for using the Azure CLI | Microsoft Learn
Thus, the
AzureCLIpipeline task is working with the help of backtick character`.Hope this helps.