1

I have template for datafactory pipeline with destination dataset sink, which I want deploy using resource manager and Java Azure SDK:

{
      "name": "[concat(parameters('factoryName'), '/', parameters('pipeline_pipelineConfiguration_pipelineTemplate_destinationDataset01'))]",
      "type": "Microsoft.DataFactory/factories/datasets",
      "apiVersion": "2018-06-01",
      "properties": {
        "linkedServiceName": {
          "referenceName": "[parameters('pipeline_pipelineConfiguration_pipelineTemplate_destinationLinkedService01')]",
          "type": "LinkedServiceReference"
        },
        "annotations": [],
        "type": "DelimitedText",
        "typeProperties": {
          "location": {
            "type": "AzureBlobStorageLocation",
            "fileName": {
              "value": "[concat('@concat(utcnow(\'yyyy-MM-dd\'),\'-',parameters('pipeline_pipelineConfiguration_destination'),',.txt\'')]",
              "type": "Expression"
            },
            "container": ""
          },
          "columnDelimiter": ",",
          "escapeChar": "\\",
          "firstRowAsHeader": true,
          "quoteChar": "\""
        },
        "schema": []
      },
      "dependsOn": [
        "[concat(variables('factoryId'), '/linkedServices/', parameters('pipeline_pipelineConfiguration_pipelineTemplate_DestinationLinkedService01'))]"
      ]
    }

I get exception:

com.fasterxml.jackson.core.JsonParseException: Unrecognized character escape ''' (code 39)

most probably because of value parameter for fileName.

What would the best way to provide file name with date calculated on time of exporting data and part of the name taken from parameter ?

  • 2
    Try to create a variable for singleQuote. refer to https://stackoverflow.com/questions/33986180/how-to-escape-single-quote-in-arm-template – Nancy Jan 09 '20 at 10:28

1 Answers1

1

Use variable and make calculation of value this variable or use replace() function.

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36