英文:
Azure Data Factory Permission Issue when copying to Parameterized Folder on SFTP Server
问题
以下是您要翻译的内容:
当在SFTP服务器的ROOT文件夹上复制时,如图像所示,复制操作成功。
如您所见,文件顺利复制到了根目录中。
然而,当我尝试复制到一个动态文件夹(在这种情况下,动态文件夹基于复制操作发生的时间),例如RAW\time_folder,请参见图像,您会发现文件夹中没有任何数据。
当将连接参数化到动态目录时,配置/参数如下:
创建目录并将文件发送到目录的实际参数如下:
@{pipeline().parameters.Zone}/@{pipeline().parameters.Time}
因此,是否有人可以告诉我上述参数是否会成功创建目录(在这种情况下是基于动态时间的目录),但不会复制/发送数据到该目录?
根据我收到的帮助,我会附上应用建议后收到的错误信息,如下所示
完整的错误消息如下:
ErrorCode=SftpPermissionDenied,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Permission denied to access 'RAW/02-47/xxxxxxxx_20230613_20230613025522.csv.f95d11f792884fb888f7e535f0fb1a6e'.,Source=Microsoft.DataTransfer.ClientLibrary.SftpConnector,'Type=Renci.SshNet.Common.SftpPermissionDeniedException,Message=Permission denied,Source=Renci.SshNet,'
desTable的表达式如下:
@concat(
pipeline().parameters.TableName,
'',
formatDateTime(utcNow(),'yyyyMMdd'),
'',
formatDateTime(utcNow(),'yyyyMMddhhmmss'), '.csv'
)
英文:
When copying to the ROOT folder on SFTP Server without any parameters as shown in the image the copy activity is successful. T
As you can see the file copies to the root no problems
However, when I try and copy to a dynamic folder (in this the dynamic folders are based on the time the copy activity happened) for example RAW\time_folder, see image, you can see there isn't any data in the folder.
When parameterizing the connection to a dynamic directory the configuration/parmeters are as follows:
The actual parameter to create the directory and send file to the directory is as follows:
@{pipeline().parameters.Zone}/@{pipeline().parameters.Time}
So, can someone let me know where the above parameters will successfully create the directory (in this case the dynamic time based directory), but not copy/send data to the directory?
Following the help I've received, I'm updating question with the error I'm getting after applying the suggestions, see below
The full error message is as follows:
ErrorCode=SftpPermissionDenied,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Permission denied to access 'RAW/02-47/xxxxxxxx_20230613_20230613025522.csv.f95d11f792884fb888f7e535f0fb1a6e'.,Source=Microsoft.DataTransfer.ClientLibrary.SftpConnector,''Type=Renci.SshNet.Common.SftpPermissionDeniedException,Message=Permission denied,Source=Renci.SshNet,'
The Expression for desTable is as follows:
@concat(
pipeline().parameters.TableName,
'_',
formatDateTime(utcNow(),'yyyyMMdd'),
'_',
formatDateTime(utcNow(),'yyyyMMddhhmmss'), '.csv'
)
答案1
得分: 0
当将数据集参数的值设置为@concat(pipeline().parameters.Zone,'/',pipeline().parameters.Time)
而不是@{pipeline().parameters.Zone}/@{pipeline().parameters.Time}
时,文件将被复制而不会出错。
更新:
如果在将数据写入SFTP时收到错误"UserErrorSftpPathNotFound"、"UserErrorSftpPermissionDenied"或"SftpOperationFail",并且您使用的SFTP用户具有适当的权限,请检查您的SFTP服务器是否支持文件重命名操作。如果不支持,禁用使用临时文件重命名 (useTempFileRename) 选项,然后重试。有关此属性的更多信息,请参见上表。如果您使用自托管的集成运行时进行复制活动,请确保使用版本4.6或更高版本。
参考文档: MS文档 关于在Azure数据工厂或Azure Synapse Analytics中使用Azure数据工厂或Azure Synapse Analytics在SFTP服务器上复制和转换数据。
英文:
When the value for dataset parameter is given as @concat(pipeline().parameters.Zone,'/',pipeline().parameters.Time)
instead of @{pipeline().parameters.Zone}/@{pipeline().parameters.Time}
, file is copied without error.
Update:
>If you receive the error "UserErrorSftpPathNotFound," "UserErrorSftpPermissionDenied," or "SftpOperationFail" when you're writing data into SFTP, and the SFTP user you use does have the proper permissions, check to see whether your SFTP server support file rename operation is working. If it isn't, disable the Upload with temp file (useTempFileRename) option and try again. To learn more about this property, see the preceding table. If you use a self-hosted integration runtime for the Copy activity, be sure to use version 4.6 or later.
Reference: MS document on Copy and transform data in SFTP server using Azure Data Factory or Azure Synapse Analytics
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论