如何从 Azure 数据工厂管道连接到网络驱动器

How to connect to a network drive from Azure Data Factory Pipeline

我使用文件系统链接服务成功连接到我的本地机器。但是现在,当我尝试使用类似的方法从网络驱动器访问文件夹时,我无法继续。谁能告诉我哪里错了?

以下是从我的本地计算机连接时的工作版本。

{
    "name": "Test_FileSystem",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "annotations": [],
        "type": "FileServer",
        "typeProperties": {
            "host": "D:\AZURE_FS",
            "userId": "<xxx@org.com>",
            "encryptedCredential": "eyJDcmVkZW50aWFsSWQiOiI0ZDYwMWI1Yi02YmI3LTRlN2YtOTBmYi0xNmIzZjI1MzQ3ZjciLC=="
        },
        "connectVia": {
            "referenceName": "IR-FS-DEV",
            "type": "IntegrationRuntimeReference"
        }
    }
}

但是,当我使用类似的方法尝试连接到网络驱动器时,我的连接失败了。

{
    "name": "NetworkDrive_LS",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "annotations": [],
        "type": "FileServer",
        "typeProperties": {
            "host": "\\<host>:<port>\SD\AZURE_FS",
            "userId": "<userid>",
            "encryptedCredential": "eyJDcmVkZW50aWFsSW=="
        },
        "connectVia": {
            "referenceName": "ServerIR-VM",
            "type": "IntegrationRuntimeReference"
        }
    } }

此外,我正在使用自托管 IR。我做错了什么吗?我的错误如下:

不支持文件路径\<host>:<port>\SD\AZURE_FS。检查配置以确保路径有效。不支持给定路径的格式。

看来我发现了我的错误 -

根据 documentation

中的示例
{
    "name": "FileLinkedService",
    "properties": {
        "type": "FileServer",
        "typeProperties": {
            "host": "<host>",
            "userid": "<domain>\<user>",
            "password": {
                "type": "SecureString",
                "value": "<password>"
            }
        },
        "connectVia": {
            "referenceName": "<name of Integration Runtime>",
            "type": "IntegrationRuntimeReference"
        }
    }
}

我更改为为用户标识添加域并删除了端口号。那解决了。

{
    "name": "NetworkDrive_LS",
    "type": "Microsoft.DataFactory/factories/linkedservices",
    "properties": {
        "annotations": [],
        "type": "FileServer",
        "typeProperties": {
            "host": "\\<host>\SD\AZURE_FS",
            "userId": "<domain>\<user>",
            "encryptedCredential": "eyJDcmVkZW50aWFsSWQiOiIwY=="
        },
        "connectVia": {
            "referenceName": "ServerIR-VM",
            "type": "IntegrationRuntimeReference"
        }
    }
}