I am trying to Migrate a table from Database A to Database B in same Azure SQL Server. I was successful in migrating data from Azure blob storage to Azure database using Azure Data Factory, But I don't seem to understand how i can modify my ADF code to migrate data across database.
I've learned to migrate data by help of This StackOverflow Link But i am looking for migrating table using Copy Activity.
My Pipeline for Azure Blob to Azure SQL is below. Please suggest the modifications that would result in migration of data from one Azure SQL DB to another. Here is the complete Data Factory code. I am looking for a workaround or at least some resource that would guide me. Thanks in advance.
Azure SQL Linked Service
{
"name": "AzureSqlLinkedService",
"properties": {
"description": "",
"hubName": "dalete_hub",
"type": "AzureSqlDatabase",
"typeProperties": {
"connectionString": "Data Source=tcp:server.database.windows.net,1433;Initial Catalog=DB;Integrated Security=False;User [email protected];Password=**********;Connect Timeout=30;Encrypt=True"
}
}
}
Azure Storage Linked Service
{
"name": "AzureStorageLinkedService",
"properties": {
"description": "",
"hubName": "dalete_hub",
"type": "AzureStorage",
"typeProperties": {
"connectionString": "DefaultEndpointsProtocol=https;AccountName=newstorageaccount;AccountKey=**********"
}
}
}
Input Dataset
{
"name": "InputDataset",
"properties": {
"structure": [
{
"name": "Region",
"type": "String"
},
{
"name": "Sales",
"type": "String"
}
],
"published": false,
"type": "AzureBlob",
"linkedServiceName": "AzureStorageLinkedService",
"typeProperties": {
"fileName": "data.txt",
"folderPath": "adfpoc/",
"format": {"type": "TextFormat",
"columnDelimiter": ","
}
},
"availability": {
"frequency": "Hour",
"interval": 1
},
"external": true,
"policy": {}
}
}
Output Dataset
{
"name": "OutputDataset",
"properties": {
"structure": [
{
"name": "Region",
"type": "String"
},
{
"name": "Sales",
"type": "String"
}
],
"published": false,
"type": "AzureSqlTable",
"linkedServiceName": "AzureSqlLinkedService",
"typeProperties": {
"tableName": "data"
},
"availability": {
"frequency": "Hour",
"interval": 1
}
}
}
ADFPipeline
{
"name": "ADFTutorialPipeline",
"properties": {
"description": "Copy data from a blob to Azure SQL table",
"activities": [
{
"type": "Copy",
"typeProperties": {
"source": {
"type": "BlobSource" },
"sink": {
"type": "SqlSink",
"writeBatchSize": 10000,
"writeBatchTimeout": "60.00:00:00"
}
},
"inputs": [
{
"name": "InputDataset"}
],
"outputs": [
{
"name": "OutputDataset"
}
],
"policy": {
"timeout": "01:00:00",
"concurrency": 1,
"executionPriorityOrder": "NewestFirst"
},
"scheduler": {
"frequency": "Hour",
"interval": 1
},
"name": "CopyFromBlobToSQL"
}
],
"start": "2019-03-11T00:00:00Z",
"end": "2019-03-12T00:00:00Z",
"isPaused": false,
"hubName": "dalete_hub",
"pipelineMode": "Scheduled"
}
}