Reputation: 1096
I've created an ADF with the wizard which copies data from Azure SQL to Blob storage.
At the option to specify an output filename (see screenshot), I'd like to append to the filename, the date the file was created or some other variable value. Is there a way to do this?
Upvotes: 2
Views: 7268
Reputation: 3236
Besides using the Data Factory Copy Wizard you can also change the file path and/or file name of a blob file by editing the json configuration of the OutputDataset that controls the file creation, (after having set up the copy pipeline) like this:
See also:
V1: Azure Data Factory - Functions and System Variables
V2: System variables supported by Azure Data Factory
V2: How to read or write partitioned data in Azure Data Factory version 2
Custom Date and Time Format Strings
Example:
{
"name": "OutputDataset-abc",
"properties": {
"published": false,
"type": "AzureBlob",
"linkedServiceName": "Destination-BlobStorage-abc",
"typeProperties": {
"fileName": "blobFileName-{firstCustomVariable}.json.gz",
"folderPath": "folderName-{secondCustomVariable}",
"format": {
"type": "JsonFormat",
"filePattern": "arrayOfObjects"
},
"partitionedBy": [
{
"name": "firstCustomVariable",
"value": {
"type": "DateTime",
"date": "SliceStart",
"format": "yyyyMMddHH"
}
},
{
"name": "secondCustomVariable",
"value": {
"type": "DateTime",
"date": "SliceStart",
"format": "MM"
}
}
],
"compression": {
"type": "GZip",
"level": "Fastest"
}
},
"availability": {
"frequency": "Day",
"interval": 1
},
"external": false,
"policy": {}
}
}
Upvotes: 2
Reputation: 26
Yes, it's supported to specify variables on ADF Copy Wizard. The supported variables are: {year}, {month}, {day}, {hour}, {minute} and {custom}. See Data Movement Activities article for details about these variables. Example: inputfolder/{year}/{month}/{day}.
Upvotes: 1