Search code examples
azure-data-factory

How to add a prefix to a tablename in Azure Data Factory


The following copy activity parameter will copy a table to it's sink location as follows

tablename_firstname_yyyyMMddhhmmss

Can someone show how modify the parameter such that it adds the letters XYZ_ to the beginning, such that it looks like the following

XYZ_tablename_firstname_yyyyMMddhhmmss

The copy parameters are as follows:

@concat(
    pipeline().parameters.TableName,
    '_',
    activity('Lookup1').output.firstRow.firstname,
    '_',
    formatDateTime(utcNow(),'yyyyMMddhhmmss'),'.txt'
    )

The copy activity sink looks like the following:

enter image description here

The link service looks like the following

enter image description here

Any thoughts


Solution

  • Not sure if I understood it correctly but how about just add it to the concat?

    @concat(
        'XYZ_',
        pipeline().parameters.TableName,
        '_',
        activity('Lookup1').output.firstRow.firstname,
        '_',
        formatDateTime(utcNow(),'yyyyMMddhhmmss'),'.txt'
        )