Azure-Samples / Synapse

Samples for Azure Synapse Analytics
MIT License
375 stars 351 forks source link

ADF to Synapse Pipeline migration powershell bug #144

Open yang-jiayi opened 2 years ago

yang-jiayi commented 2 years ago

PowerShell for ADF to Synapse Pipeline migration, but there is a problem with garbled characters in case of non-English multibyte character codes.

https://github.com/Azure-Samples/Synapse/blob/main/Pipelines/ImportADFtoSynapse/importADFtoSynapseTool.ps1

Please make the following modifications to avoid the JSON character encoding issue.

$uri = "$destUri/$resourceType/$($_.name)?api-version=$($config.SynapseWorkspace.apiVersion)";
$jsonBody = ConvertTo-Json $_ -Depth 30
$jsonBody =[Text.Encoding]::UTF8.GetBytes($jsonBody)
$name = $_.name

Please add this code. $jsonBody =[Text.Encoding]::UTF8.GetBytes($jsonBody)

Thanks.