none
How to Update Azure Table Record from Azure Data factory !!

    Question

  • Hi All,

    I have created a table in Azure Storage table With lastupdatedate and tablename.

    I am trying to overwrite this record through azure data factory , But unable to do so.

    Instead of overwriting it created a new record in the table.

    Please help here.

    • Moved by VeeraGiri Babu Wednesday, September 19, 2018 10:11 AM Better suited here than Storage.
    Wednesday, September 19, 2018 9:12 AM

All replies

  • You could use the azureTableInsertType property.

    https://docs.microsoft.com/en-us/azure/data-factory/connector-azure-table-storage#azure-table-as-a-sink-type

    The mode to insert data into Azure Table. This property controls whether existing rows in the output table with matching partition and row keys have their values replaced or merged.

    This setting applies at the row level not the table level. Neither option deletes rows in the output table that do not exist in the input. To learn about how the merge and replace settings work, see Insert or merge entityand Insert or replace entity.

    Maybe you could use tableName as RowKey if you only want to key one record for one table name?



    Wednesday, September 19, 2018 10:06 AM
  • Hi Fang,

    We have tried using the same. But The Partition key Is automatically generated because of which it creates one more row in the output table.

    We want to have only record for a Table , so it should update the lastUpdatedDate and not create a new record with new UpdateDate.

    Please help here...It is needed urgently.

    Friday, September 21, 2018 7:59 AM
  • Hi Erika,

    You could use

    to control the partition key.  Assure the column name contains that table name in the source named "tableName"

                    "name": "Copy Data1",
                    "type": "Copy",
                    "policy": {
                        "timeout": "7.00:00:00",
                        "retry": 0,
                        "retryIntervalInSeconds": 30,
                        "secureOutput": false,
                        "secureInput": false
                    },
                    "typeProperties": {
                        "source": {
                            "type": "SqlSource"
                        },
                        "sink": {
                            "type": "AzureTableSink",
                            "azureTableInsertType": "merge",
                            "azureTableDefaultPartitionKeyValue": "mytablerecords",
                            "azureTableRowKeyName": "tableName",
                            "writeBatchSize": 10000
                        },


    Tuesday, September 25, 2018 10:11 AM