如何在手臂模板中创建数据工厂的集成运行时

时间:2020-04-14 19:58:18

标签: azure-data-factory azure-data-factory-2

我正在尝试使用ARM模板部署数据工厂。使用导出的模板创建部署管道很容易。

但是,由于数据工厂需要访问本地数据库服务器,因此我需要具有集成的运行时。问题是如何将运行时间包含在手臂模板中?

模板如下所示,我们可以看到它正在尝试包含运行时:

{
    "name": "[concat(parameters('factoryName'), '/OnPremisesSqlServer')]",
    "type": "Microsoft.DataFactory/factories/linkedServices",
    "apiVersion": "2018-06-01",
    "properties": 
    {
        "annotations": [],
        "type": "SqlServer",
        "typeProperties": {
            "connectionString": "[parameters('OnPremisesSqlServer_connectionString')]"
        },
        "connectVia": {
            "referenceName": "OnPremisesSqlServer",
            "type": "IntegrationRuntimeReference"
        }
    },
    "dependsOn": [
        "[concat(variables('factoryId'), '/integrationRuntimes/OnPremisesSqlServer')]"
    ]
},
{
    "name": "[concat(parameters('factoryName'), '/OnPremisesSqlServer')]",
    "type": "Microsoft.DataFactory/factories/integrationRuntimes",
    "apiVersion": "2018-06-01",
    "properties": {
        "type": "SelfHosted",
        "typeProperties": {}
    },
    "dependsOn": []
}

运行此模板会给我这个错误:

\"connectVia\": {\r\n      \"referenceName\": \"OnPremisesSqlServer\",\r\n      \"type\": \"IntegrationRuntimeReference\"\r\n    }\r\n  }\r\n} and error is: Failed to encrypted linked service credentials on self-hosted IR 'OnPremisesSqlServer', reason is: NotFound, error message is: No online instance..

问题是我将需要在集成运行时的UI中键入一些键,以便可以将其注册为Azure。但是我只能从数据工厂实例的UI中获得该密钥。因此,上臂模板部署将始终至少失败一次。我想知道是否有一种方法可以独立创建运行时间?

1 个答案:

答案 0 :(得分:1)

问题是我需要在集成 运行时的UI,因此可以在Azure中注册。但是我只能得到 我的数据工厂实例的UI中的那个键。所以上面的手臂模板 部署将至少失败一次。我想知道是否有 一种独立创建运行时的方法?

似乎您已经知道如何创建Self-Hosted IR in the ADF ARM

{
          "name": "[concat(parameters('dataFactoryName'), '/integrationRuntime1')]",
          "type": "Microsoft.DataFactory/factories/integrationRuntimes",
          "apiVersion": "2018-06-01",
          "properties": {
            "additionalProperties": {},
            "description": "jaygongIR1",
            "type": "SelfHosted"
            }
        }

结果:

enter image description here

enter image description here

仅需担心的是,Windows IR Tool需要配置AUTHENTICATION KEY才能访问ADF自托管IR节点。因此,一旦创建,它就应该处于Unavailable状态。我认为是有道理的,应该先创建身份验证密钥,然后才能使用它来配置内部部署工具。您无法一步一步实现所有操作,因为这些行为在天蓝色和内部都进行了操作

基于Self-Hosted IR Tool document,Register步骤不能用Powershell代码实现。因此,流程中无法处理的所有步骤都是创建IR并获取Auth密钥,而不是用于在工具中注册。