导入用于创建ADF资源而不创建任何内容的ARM模板

问题描述 投票:0回答:1

我有一个空白的Data Factory-v2(TestDataFactory-123Test),我想使用现有的ADF(TestDataFactory-123)填充它。我一步一步地遵循了官方文档Create a Resource Manager template for each environment中提到的内容。部署显示已成功,但我看不到任何内容。我在门户中使用“在编辑器中构建自己的模板”选项来导入现有的ARM模板。我有什么遗漏吗?

下面是我通过“导出” TestDataFactory-123的ARM得到的ARM:

{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "factoryName": {
      "type": "string",
      "metadata": "Data Factory name",
      "defaultValue": "TestDataFactory-123"
    },
    "AzureBlobStorageLinkedService_connectionString": {
      "type": "secureString",
      "metadata": "Secure string for 'connectionString' of 'AzureBlobStorageLinkedService'",
      "defaultValue": "TestDataFactory-123"
    }
  },
  "variables": {
    "factoryId": "[concat('Microsoft.DataFactory/factories/', parameters('factoryName'))]"
  },
  "resources": [
    {
      "name": "[concat(parameters('factoryName'), '/AzureBlobStorageLinkedService')]",
      "type": "Microsoft.DataFactory/factories/linkedServices",
      "apiVersion": "2018-06-01",
      "properties": {
        "annotations": [],
        "type": "AzureBlobStorage",
        "typeProperties": {
          "connectionString": "[parameters('AzureBlobStorageLinkedService_connectionString')]"
        }
      },
      "dependsOn": []
    },
    {
      "name": "[concat(parameters('factoryName'), '/InputDataset')]",
      "type": "Microsoft.DataFactory/factories/datasets",
      "apiVersion": "2018-06-01",
      "properties": {
        "linkedServiceName": {
          "referenceName": "AzureBlobStorageLinkedService",
          "type": "LinkedServiceReference"
        },
        "annotations": [],
        "type": "Binary",
        "typeProperties": {
          "location": {
            "type": "AzureBlobStorageLocation",
            "fileName": "emp.txt",
            "folderPath": "input",
            "container": "adftutorial"
          }
        }
      },
      "dependsOn": [
        "[concat(variables('factoryId'), '/linkedServices/AzureBlobStorageLinkedService')]"
      ]
    },
    {
      "name": "[concat(parameters('factoryName'), '/OutputDataset')]",
      "type": "Microsoft.DataFactory/factories/datasets",
      "apiVersion": "2018-06-01",
      "properties": {
        "linkedServiceName": {
          "referenceName": "AzureBlobStorageLinkedService",
          "type": "LinkedServiceReference"
        },
        "annotations": [],
        "type": "Binary",
        "typeProperties": {
          "location": {
            "type": "AzureBlobStorageLocation",
            "folderPath": "output",
            "container": "adftutorial"
          }
        }
      },
      "dependsOn": [
        "[concat(variables('factoryId'), '/linkedServices/AzureBlobStorageLinkedService')]"
      ]
    },
    {
      "name": "[concat(parameters('factoryName'), '/CopyPipeline')]",
      "type": "Microsoft.DataFactory/factories/pipelines",
      "apiVersion": "2018-06-01",
      "properties": {
        "activities": [
          {
            "name": "CopyFromBlobToBlob",
            "type": "Copy",
            "dependsOn": [],
            "policy": {
              "timeout": "7.00:00:00",
              "retry": 0,
              "retryIntervalInSeconds": 30,
              "secureOutput": false,
              "secureInput": false
            },
            "userProperties": [],
            "typeProperties": {
              "source": {
                "type": "BinarySource",
                "storeSettings": {
                  "type": "AzureBlobStorageReadSettings",
                  "recursive": true
                }
              },
              "sink": {
                "type": "BinarySink",
                "storeSettings": {
                  "type": "AzureBlobStorageWriteSettings"
                }
              },
              "enableStaging": false
            },
            "inputs": [
              {
                "referenceName": "InputDataset",
                "type": "DatasetReference",
                "parameters": {}
              }
            ],
            "outputs": [
              {
                "referenceName": "OutputDataset",
                "type": "DatasetReference",
                "parameters": {}
              }
            ]
          }
        ],
        "annotations": []
      },
      "dependsOn": [
        "[concat(variables('factoryId'), '/datasets/InputDataset')]",
        "[concat(variables('factoryId'), '/datasets/OutputDataset')]"
      ]
    }
  ]
}
azure-data-factory azure-data-factory-2
1个回答
0
投票

修复很简单,只需用空数据工厂的名称替换'factoryName'参数的'defaultValue'。 'TestDataFactory-123Test',而不是现有的一个'TestDataFactory-123'!

© www.soinside.com 2019 - 2024. All rights reserved.